Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / drivers / staging / bcm / IPv6ProtocolHdr.h
bloba0db5a1de763ea7a7d0bd0a8cccd21771ebf630f
1 #ifndef _IPV6_PROTOCOL_DEFINES_
2 #define _IPV6_PROTOCOL_DEFINES_
5 #define IPV6HDR_TYPE_HOPBYHOP 0x0
6 #define IPV6HDR_TYPE_ROUTING 0x2B
7 #define IPV6HDR_TYPE_FRAGMENTATION 0x2C
8 #define IPV6HDR_TYPE_DESTOPTS 0x3c
9 #define IPV6HDR_TYPE_AUTHENTICATION 0x33
10 #define IPV6HDR_TYPE_ENCRYPTEDSECURITYPAYLOAD 0x34
11 #define MASK_IPV6_CS_SPEC 0x2
14 #define TCP_HEADER_TYPE 0x6
15 #define UDP_HEADER_TYPE 0x11
16 #define IPV6_ICMP_HDR_TYPE 0x2
17 #define IPV6_FLOWLABEL_BITOFFSET 9
19 #define IPV6_MAX_CHAINEDHDR_BUFFBYTES 0x64
21 // Size of Dest Options field of Destinations Options Header
22 // in bytes.
24 #define IPV6_DESTOPTS_HDR_OPTIONSIZE 0x8
26 //typedef unsigned char UCHAR;
27 //typedef unsigned short USHORT;
28 //typedef unsigned long int ULONG;
30 typedef struct IPV6HeaderFormatTag
32 UCHAR ucVersionPrio;
33 UCHAR aucFlowLabel[3];
34 USHORT usPayloadLength;
35 UCHAR ucNextHeader;
36 UCHAR ucHopLimit;
37 ULONG ulSrcIpAddress[4];
38 ULONG ulDestIpAddress[4];
39 }IPV6Header;
41 typedef struct IPV6RoutingHeaderFormatTag
43 UCHAR ucNextHeader;
44 UCHAR ucRoutingType;
45 UCHAR ucNumAddresses;
46 UCHAR ucNextAddress;
47 ULONG ulReserved;
48 //UCHAR aucAddressList[0];
50 }IPV6RoutingHeader;
52 typedef struct IPV6FragmentHeaderFormatTag
54 UCHAR ucNextHeader;
55 UCHAR ucReserved;
56 USHORT usFragmentOffset;
57 ULONG ulIdentification;
58 }IPV6FragmentHeader;
60 typedef struct IPV6DestOptionsHeaderFormatTag
62 UCHAR ucNextHeader;
63 UCHAR ucHdrExtLen;
64 UCHAR ucDestOptions[6];
65 //UCHAR udExtDestOptions[0];
66 }IPV6DestOptionsHeader;
68 typedef struct IPV6HopByHopOptionsHeaderFormatTag
70 UCHAR ucNextHeader;
71 UCHAR ucMisc[3];
72 ULONG ulJumboPayloadLen;
73 }IPV6HopByHopOptionsHeader;
75 typedef struct IPV6AuthenticationHeaderFormatTag
77 UCHAR ucNextHeader;
78 UCHAR ucLength;
79 USHORT usReserved;
80 ULONG ulSecurityParametersIndex;
81 //UCHAR ucAuthenticationData[0];
83 }IPV6AuthenticationHeader;
85 typedef struct IPV6IcmpHeaderFormatTag
87 UCHAR ucType;
88 UCHAR ucCode;
89 USHORT usChecksum;
90 //UCHAR ucIcmpMsg[0];
92 }IPV6IcmpHeader;
94 typedef enum _E_IPADDR_CONTEXT
96 eSrcIpAddress,
97 eDestIpAddress
99 }E_IPADDR_CONTEXT;
103 //Function Prototypes
105 USHORT IpVersion6(PMINI_ADAPTER Adapter, /**< Pointer to the driver control structure */
106 PVOID pcIpHeader, /**<Pointer to the IP Hdr of the packet*/
107 S_CLASSIFIER_RULE *pstClassifierRule );
109 VOID DumpIpv6Address(ULONG *puIpv6Address);
111 extern BOOLEAN MatchSrcPort(S_CLASSIFIER_RULE *pstClassifierRule,USHORT ushSrcPort);
112 extern BOOLEAN MatchDestPort(S_CLASSIFIER_RULE *pstClassifierRule,USHORT ushSrcPort);
113 extern BOOLEAN MatchProtocol(S_CLASSIFIER_RULE *pstClassifierRule,UCHAR ucProtocol);
116 #endif