--- /usr/src/sys/conf/files Wed Dec 8 14:46:57 1999 +++ conf/files Mon Jun 5 15:53:48 2000 @@ -561,6 +561,9 @@ netinet/tcp_timer.c optional inet netinet/tcp_usrreq.c optional inet netinet/udp_usrreq.c optional inet +netipopt/ipopt_proto.c optional ipoption +netipopt/ipopt_usrreq.c optional ipoption +netipopt/ipopt_input.c optional ipoption netipx/ipx.c optional ipx netipx/ipx_cksum.c optional ipx netipx/ipx_input.c optional ipx --- /usr/src/sys/conf/options Wed Dec 8 14:46:58 1999 +++ conf/options Mon Jun 5 15:53:52 2000 @@ -220,6 +220,7 @@ INET opt_inet.h IPDIVERT DUMMYNET opt_ipdn.h +IPOPTION opt_ipoption.h IPFIREWALL opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h --- /usr/src/sys/i386/conf/LINT Wed Dec 15 14:35:13 1999 +++ i386/conf/LINT Mon Jun 5 15:54:25 2000 @@ -371,6 +371,8 @@ options NETATALK #Appletalk communications protocols +options IPOPTION # IP Options + # These are currently broken but are shipped due to interest. #options NS #Xerox NS protocols --- /usr/src/sys/netinet/ip.h Sun Aug 29 12:29:38 1999 +++ netinet/ip.h Mon Jun 5 15:54:52 2000 @@ -172,6 +172,20 @@ #define IPOPT_SECUR_TOPSECRET 0x6bc5 /* + * Router Alert option structure. + */ +struct ip_routeralert { + u_char ipa_code; /* IPOPT_RA */ + u_char ipa_len; /* size of structure, 4 */ + u_short ipa_val; /* value */ +}; + +/* Router Alert values */ +#define IPOPT_RA_EXAM 0 +#define IPOPT_RA_RTCP 1 + + +/* * Internet implementation parameters. */ #define MAXTTL 255 /* maximum time to live (seconds) */ --- /usr/src/sys/netinet/in.h Sun Aug 29 12:29:34 1999 +++ netinet/in.h Mon Jun 5 15:54:55 2000 @@ -330,6 +330,11 @@ #define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ #define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ +#define IPOPT_RECVLOCAL 70 /* pick up pkt's coming to local box */ +#define IPOPT_RECVRA 71 /* pick up all router alert pkt's */ +#define IPOPT_RECVRSVP 72 /* pick up RSVP router alert pkt's only */ +#define IPOPT_RECVRTCP 73 /* pick up RTCP router alert pkt's only */ + /* * Defaults and limits for options */ --- /usr/src/sys/netinet/ip_input.c Mon Nov 1 17:23:53 1999 +++ netinet/ip_input.c Mon Jun 5 15:54:58 2000 @@ -43,6 +43,7 @@ #include "opt_ipdivert.h" #include "opt_ipfilter.h" #include "opt_ipstealth.h" +#include "opt_ipoption.h" #include @@ -203,6 +204,15 @@ struct sockaddr_in *ip_fw_fwd_addr; +#ifdef IPOPTION + +#define IPOPT_LOCAL 1 + +void ipopt_map __P((int, u_char *, struct ip *)); +int ipopt_input __P((struct mbuf *m, int flag)); + +#endif + static void save_rte __P((u_char *, struct in_addr)); static int ip_dooptions __P((struct mbuf *)); static void ip_forward __P((struct mbuf *, int)); @@ -574,6 +584,10 @@ ours: +#ifdef IPOPTION + if (ipopt_input(m, IPOPT_LOCAL)) + return; +#endif /* * If offset or IP_MF are set, must reassemble. * Otherwise, nothing need be done. @@ -1217,7 +1231,11 @@ sizeof(n_time)); ipt->ipt_ptr += sizeof(n_time); } +#ifdef IPOPTION + ipopt_map(opt, cp, ip); +#endif } + if (forward && ipforwarding) { ip_forward(m, 1); return (1); @@ -1439,6 +1457,11 @@ ip->ip_ttl -= IPTTLDEC; #ifdef IPSTEALTH } +#endif + +#ifdef IPOPTION + if (ipopt_input(m, 0)) + return; #endif sin = (struct sockaddr_in *)&ipforward_rt.ro_dst; --- /usr/src/sys/sys/mount.h Mon Nov 22 02:08:11 1999 +++ sys/mount.h Mon Jun 5 15:55:17 2000 @@ -373,7 +373,7 @@ #include -#define AF_MAX 33 /* XXX */ +#define AF_MAX 34 /* XXX */ /* * Network address lookup element --- /usr/src/sys/sys/socket.h Mon Nov 22 02:08:12 1999 +++ sys/socket.h Mon Jun 5 15:55:13 2000 @@ -132,8 +132,9 @@ * headers in interface output routine */ #define AF_NETGRAPH 32 /* Netgraph sockets */ +#define AF_IPOPTION 33 /* used to demux on IP Option value */ -#define AF_MAX 33 +#define AF_MAX 34 /* * Structure used by kernel to store most @@ -192,6 +193,7 @@ #define PF_NATM AF_NATM #define PF_ATM AF_ATM #define PF_NETGRAPH AF_NETGRAPH +#define PF_IPOPTION AF_IPOPTION #define PF_MAX AF_MAX @@ -237,6 +239,7 @@ { "inet6", CTLTYPE_NODE }, \ { "natm", CTLTYPE_NODE }, \ { "netgraph", CTLTYPE_NODE } \ + { "ipoption", CTLTYPE_NODE }, \ } /* --- /usr/include/sys/mount.h Wed Dec 29 21:19:29 1999 +++ sys/mount.h Mon Jun 5 15:55:17 2000 @@ -373,7 +373,7 @@ #include -#define AF_MAX 33 /* XXX */ +#define AF_MAX 34 /* XXX */ /* * Network address lookup element --- /usr/include/sys/socket.h Wed Dec 29 21:19:32 1999 +++ sys/socket.h Mon Jun 5 15:55:13 2000 @@ -132,8 +132,9 @@ * headers in interface output routine */ #define AF_NETGRAPH 32 /* Netgraph sockets */ +#define AF_IPOPTION 33 /* used to demux on IP Option value */ -#define AF_MAX 33 +#define AF_MAX 34 /* * Structure used by kernel to store most @@ -192,6 +193,7 @@ #define PF_NATM AF_NATM #define PF_ATM AF_ATM #define PF_NETGRAPH AF_NETGRAPH +#define PF_IPOPTION AF_IPOPTION #define PF_MAX AF_MAX @@ -237,6 +239,7 @@ { "inet6", CTLTYPE_NODE }, \ { "natm", CTLTYPE_NODE }, \ { "netgraph", CTLTYPE_NODE } \ + { "ipoption", CTLTYPE_NODE }, \ } /* --- /usr/include/netinet/ip.h Wed Dec 29 21:19:28 1999 +++ netinet/ip.h Mon Jun 5 15:54:52 2000 @@ -172,6 +172,20 @@ #define IPOPT_SECUR_TOPSECRET 0x6bc5 /* + * Router Alert option structure. + */ +struct ip_routeralert { + u_char ipa_code; /* IPOPT_RA */ + u_char ipa_len; /* size of structure, 4 */ + u_short ipa_val; /* value */ +}; + +/* Router Alert values */ +#define IPOPT_RA_EXAM 0 +#define IPOPT_RA_RTCP 1 + + +/* * Internet implementation parameters. */ #define MAXTTL 255 /* maximum time to live (seconds) */ --- /usr/include/netinet/in.h Wed Dec 29 21:19:28 1999 +++ netinet/in.h Mon Jun 5 15:54:55 2000 @@ -330,6 +330,11 @@ #define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ #define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ +#define IPOPT_RECVLOCAL 70 /* pick up pkt's coming to local box */ +#define IPOPT_RECVRA 71 /* pick up all router alert pkt's */ +#define IPOPT_RECVRSVP 72 /* pick up RSVP router alert pkt's only */ +#define IPOPT_RECVRTCP 73 /* pick up RTCP router alert pkt's only */ + /* * Defaults and limits for options */