NetBSD/sbin/route/keywords.sh
gdt c9bfbf1142 Move RTF_ANNOUNCE flag so that it no longer conflicts with RTF_PROTO2.
RTF_ANNOUNCE was defined as RTF_PROTO2.  The flag is used to indicated
that host should act as a proxy for a link level arp or ndp request.
(If RTF_PROTO2 is used as an experimental flag (as advertised),
various problems can occur.)

This commit provides a first-class definition with its own bit for
RTF_ANNOUNCE, removes the old aliasing definitions, and adds support
for the new RTF_ANNOUNCE flag to netstat(8) and route(8).,

Also, remove unused RTF_ flags that collide with RTF_PROTO1:
  netinet/icmp6.h defined RTF_PROBEMTU as RTF_PROTO1
  netinet/if_inarp.h defined RTF_USETRAILERS as RTF_PROTO1
  (Neither of these flags are used anywhere.  Both have been removed
  to reduce chances of collision with RTF_PROTO1.)

Figuring this out and the diff are the work of Beverly Schwartz of
BBN.

(Passed release build, boot in VM, with no apparently related atf
failures.)

Approved for Public Release, Distribution Unlimited
This material is based upon work supported by the Defense Advanced
Research Projects Agency and Space and Naval Warfare Systems Center,
Pacific, under Contract No. N66001-09-C-2073.
2011-11-11 15:09:32 +00:00

131 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
# $NetBSD: keywords.sh,v 1.10 2011/11/11 15:09:32 gdt Exp $
# @(#)keywords 8.2 (Berkeley) 3/19/94
#
# WARNING! If you change this file, re-run it!
# This program requires "new" awk (or GNU awk).
awk=${AWK:-awk}
cat << _EOF_ > _keywords.t1
add
atalk
blackhole
change
cloned
cloning
delete
dst
expire
flush
gateway
genmask
get
host
hopcount
iface
interface
ifa
ifp
inet
inet6
iso
link
llinfo
lock
lockrest
mask
monitor
mtu
net
netmask
nostatic
osi
prefixlen
proto1
proto2
recvpipe
reject
rtt
rttvar
sa
sendpipe
show
ssthresh
static
x25
xns
xresolve
flushall
nocloned
nocloning
noblackhole
noreject
mpls
tag
proxy
_EOF_
################################################################
# Setup
################################################################
# This creates a stream of:
# keyword KEYWORD
# (lower case, upper case).
tr a-z A-Z < _keywords.t1 |
paste _keywords.t1 - > _keywords.t2
################################################################
# Generate the h file
################################################################
exec > keywords.h
echo '/* $'NetBSD'$ */
/* WARNING! This file was generated by keywords.sh */
extern struct keytab {
const char *kt_cp;
int kt_i;
} keywords[];
' # defines follow
$awk '{
printf("#define\tK_%s\t%d\n", $2, NR);
}' < _keywords.t2
################################################################
# Generate the c file
################################################################
exec > keywords.c
echo '/* $'NetBSD'$ */
/* WARNING! This file was generated by keywords.sh */
#include "keywords.h"
struct keytab keywords[] = {
' # initializers follow
$awk '{
printf("\t{\"%s\", K_%s},\n", $1, $2);
}' < _keywords.t2
echo ' {0, 0}
};
' # tail
################################################################
# Cleanup
################################################################
rm -f _keywords.t1 _keywords.t2
exit 0