From 061ab802a67cfc336785f6daeecdcbd4910734ed Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 27 Aug 2009 18:25:46 +0200 Subject: Temporary OSPFv3 development commit --- lib/ipv6.c | 54 ------------------------------------------------------ lib/ipv6.h | 3 +++ 2 files changed, 3 insertions(+), 54 deletions(-) (limited to 'lib') diff --git a/lib/ipv6.c b/lib/ipv6.c index 3334b97..88c54eb 100644 --- a/lib/ipv6.c +++ b/lib/ipv6.c @@ -136,60 +136,6 @@ ipv6_compare(ip_addr X, ip_addr Y) return 0; } -/* From Linux include/net/ipv6.h */ -#define NEXTHDR_HOP 0 /* Hop-by-hop option header. */ -#define NEXTHDR_ROUTING 43 /* Routing header. */ -#define NEXTHDR_FRAGMENT 44 /* Fragmentation/reassembly header. */ -#define NEXTHDR_DEST 60 /* Destination options header. */ -#define NEXTHDR_NONE 59 /* No next header */ - -#define NEXTHDR_ESP 50 /* Encapsulating security payload. */ -#define NEXTHDR_AUTH 51 /* Authentication header. */ - - -byte * -ipv6_skip_header(byte *pkt, int *len) -{ - int l = *len; - int q; - u8 nh; - - if (l < 40 || (*pkt & 0xf0) != 0x60) - return NULL; - - /* Skip IPv6 header */ - nh = pkt[6]; - pkt += 40; - - while () - { - switch (nw) - { - case NEXTHDR_FRAGMENT: - - case NEXTHDR_HOP: - case NEXTHDR_ROUTING: - case NEXTHDR_DEST: - - case NEXTHDR_AUTH: - break; - - case NEXTHDR_NONE: - return NULL; - - default: - return pkt; - } - } - - q = (*pkt & 0x0f) * 4; - if (q > l) - return NULL; - *len -= q; - return pkt + q; -} - - /* * Conversion of IPv6 address to presentation format and vice versa. * Heavily inspired by routines written by Paul Vixie for the BIND project diff --git a/lib/ipv6.h b/lib/ipv6.h index d2b77c0..592e57c 100644 --- a/lib/ipv6.h +++ b/lib/ipv6.h @@ -69,6 +69,9 @@ typedef struct ipv6_addr { #define ipa_getbit(x, y) ipv6_getbit(x, y) #define ipa_absolutize(x,y) ipv6_absolutize(x,y) +/* In IPv6, SOCK_RAW does not return packet header */ +#define ip_skip_header(x, y) x + ip_addr ipv6_mkmask(unsigned); unsigned ipv6_mklen(ip_addr *); int ipv6_classify(ip_addr *); -- cgit v1.2.3