summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/net/gen_ether_subr
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2014-10-14 15:37:19 +0000
committergjb <gjb@FreeBSD.org>2014-10-14 15:37:19 +0000
commit49bc9d1f7ffccd05cb04d7cb7b41a1ee2f39b46d (patch)
treeacfa7870dec8e734f823d6db57d1b0799de03ad1 /contrib/netbsd-tests/lib/libc/net/gen_ether_subr
parent8521a45a5518d0da7ec2b53f2abb0f433d612a61 (diff)
parent594c54630f7d35d5f8feece66ae5ef818703cd18 (diff)
downloadFreeBSD-src-49bc9d1f7ffccd05cb04d7cb7b41a1ee2f39b46d.zip
FreeBSD-src-49bc9d1f7ffccd05cb04d7cb7b41a1ee2f39b46d.tar.gz
Reintegrate head@r273095
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/net/gen_ether_subr')
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/net/gen_ether_subr25
1 files changed, 25 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/net/gen_ether_subr b/contrib/netbsd-tests/lib/libc/net/gen_ether_subr
new file mode 100755
index 0000000..9f9b63c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/gen_ether_subr
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+awk '
+BEGIN {
+ print
+ print "#include <ctype.h>"
+ print "#include <sys/types.h>"
+ print "#include <errno.h>"
+ print
+ print "#define ETHER_ADDR_LEN 6"
+ print
+ print "int ether_aton_r(u_char *dest, size_t len, const char *str);"
+ print
+}
+/^ether_aton_r/ {
+ print prevline
+ out = 1
+}
+{
+ if (out) print
+ else prevline = $0
+}
+/^}$/ {
+ if (out) exit(0)
+}' $1 >$2
OpenPOWER on IntegriCloud