Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/include/rump add some network-related compat defs



details:   https://anonhg.NetBSD.org/src/rev/74ef3d71cf5f
branches:  trunk
changeset: 780320:74ef3d71cf5f
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Jul 20 09:02:48 2012 +0000

description:
add some network-related compat defs

diffstat:

 sys/rump/include/rump/makerumpdefs.sh |  28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diffs (50 lines):

diff -r 1b57bf207758 -r 74ef3d71cf5f sys/rump/include/rump/makerumpdefs.sh
--- a/sys/rump/include/rump/makerumpdefs.sh     Fri Jul 20 07:55:44 2012 +0000
+++ b/sys/rump/include/rump/makerumpdefs.sh     Fri Jul 20 09:02:48 2012 +0000
@@ -8,7 +8,7 @@
 rm -f rumpdefs.h
 exec > rumpdefs.h
 
-printf '/*     $NetBSD: makerumpdefs.sh,v 1.6 2010/07/02 10:44:26 hannken Exp $        */\n\n'
+printf '/*     $NetBSD: makerumpdefs.sh,v 1.7 2012/07/20 09:02:48 pooka Exp $  */\n\n'
 printf '/*\n *\tAUTOMATICALLY GENERATED.  DO NOT EDIT.\n */\n\n'
 printf '#ifndef _RUMP_RUMPDEFS_H_\n'
 printf '#define _RUMP_RUMPDEFS_H_\n\n'
@@ -19,6 +19,22 @@
        sed -n '1{s/\$//gp;q;}' $1
 }
 
+# Odds of sockaddr_in changing are zero, so no acrobatics needed.  Alas,
+# dealing with in_addr_t for s_addr is very difficult, so have it as
+# an incompatible uint32_t for now.
+echo
+cat <<EOF
+struct rump_sockaddr_in {
+       uint8_t         sin_len;
+       uint8_t         sin_family;
+       uint16_t        sin_port;
+       struct {
+                       uint32_t s_addr;
+       } sin_addr;
+       int8_t          sin_zero[8];
+};
+EOF
+
 fromvers ../../../sys/fcntl.h
 sed -n '/#define       O_[A-Z]*        *0x/s/O_/RUMP_O_/gp' \
     < ../../../sys/fcntl.h
@@ -41,4 +57,14 @@
 sed -n '/#define.*AB_[A-Z]/s/AB_/RUMP_AB_/gp' <../../../sys/reboot.h   \
     | sed 's,/\*.*$,,'
 
+fromvers ../../../sys/socket.h
+sed -n '/#define[      ]*SOCK_[A-Z]/s/SOCK_/RUMP_SOCK_/gp' <../../../sys/socket.h \
+    | sed 's,/\*.*$,,'
+sed -n '/#define[      ]*[AP]F_[A-Z]/s/[AP]F_/RUMP_&/gp' <../../../sys/socket.h \
+    | sed 's,/\*.*$,,'
+sed -n '/#define[      ]*SO_[A-Z]/s/SO_/RUMP_&/gp' <../../../sys/socket.h \
+    | sed 's,/\*.*$,,'
+sed -n '/#define[      ]*SOL_[A-Z]/s/SOL_/RUMP_&/gp' <../../../sys/socket.h \
+    | sed 's,/\*.*$,,'
+
 printf '\n#endif /* _RUMP_RUMPDEFS_H_ */\n'



Home | Main Index | Thread Index | Old Index