4 *Copyright (C) 2010 Beceem Communications, Inc.
6 *This program is free software: you can redistribute it and/or modify
7 *it under the terms of the GNU General Public License version 2 as
8 *published by the Free Software Foundation.
10 *This program is distributed in the hope that it will be useful,but
11 *WITHOUT ANY WARRANTY; without even the implied warranty of
12 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *See the GNU General Public License for more details.
15 *You should have received a copy of the GNU General Public License
16 *along with this program. If not, write to the Free Software Foundation, Inc.,
17 *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef _IPV6_PROTOCOL_DEFINES_
23 #define _IPV6_PROTOCOL_DEFINES_
26 #define IPV6HDR_TYPE_HOPBYHOP 0x0
27 #define IPV6HDR_TYPE_ROUTING 0x2B
28 #define IPV6HDR_TYPE_FRAGMENTATION 0x2C
29 #define IPV6HDR_TYPE_DESTOPTS 0x3c
30 #define IPV6HDR_TYPE_AUTHENTICATION 0x33
31 #define IPV6HDR_TYPE_ENCRYPTEDSECURITYPAYLOAD 0x34
32 #define MASK_IPV6_CS_SPEC 0x2
35 #define TCP_HEADER_TYPE 0x6
36 #define UDP_HEADER_TYPE 0x11
37 #define IPV6_ICMP_HDR_TYPE 0x2
38 #define IPV6_FLOWLABEL_BITOFFSET 9
40 #define IPV6_MAX_CHAINEDHDR_BUFFBYTES 0x64
42 // Size of Dest Options field of Destinations Options Header
45 #define IPV6_DESTOPTS_HDR_OPTIONSIZE 0x8
47 //typedef unsigned char UCHAR;
48 //typedef unsigned short USHORT;
49 //typedef unsigned long int ULONG;
51 typedef struct IPV6HeaderFormatTag
54 UCHAR aucFlowLabel
[3];
55 USHORT usPayloadLength
;
58 ULONG ulSrcIpAddress
[4];
59 ULONG ulDestIpAddress
[4];
62 typedef struct IPV6RoutingHeaderFormatTag
69 //UCHAR aucAddressList[0];
73 typedef struct IPV6FragmentHeaderFormatTag
77 USHORT usFragmentOffset
;
78 ULONG ulIdentification
;
81 typedef struct IPV6DestOptionsHeaderFormatTag
85 UCHAR ucDestOptions
[6];
86 //UCHAR udExtDestOptions[0];
87 }IPV6DestOptionsHeader
;
89 typedef struct IPV6HopByHopOptionsHeaderFormatTag
93 ULONG ulJumboPayloadLen
;
94 }IPV6HopByHopOptionsHeader
;
96 typedef struct IPV6AuthenticationHeaderFormatTag
101 ULONG ulSecurityParametersIndex
;
102 //UCHAR ucAuthenticationData[0];
104 }IPV6AuthenticationHeader
;
106 typedef struct IPV6IcmpHeaderFormatTag
111 //UCHAR ucIcmpMsg[0];
115 typedef enum _E_IPADDR_CONTEXT
124 //Function Prototypes
125 BOOLEAN
MatchSrcIpv6Address(S_CLASSIFIER_RULE
*pstClassifierRule
,IPV6Header
*pstIpv6Header
);
126 BOOLEAN
MatchDestIpv6Address(S_CLASSIFIER_RULE
*pstClassifierRule
,IPV6Header
*pstIpv6Header
);
128 USHORT
IpVersion6(PMINI_ADAPTER Adapter
, /**< Pointer to the driver control structure */
129 PVOID pcIpHeader
, /**<Pointer to the IP Hdr of the packet*/
130 S_CLASSIFIER_RULE
*pstClassifierRule
);
132 VOID
DumpIpv6Address(ULONG
*puIpv6Address
);
133 VOID
DumpIpv6Header(IPV6Header
*pstIpv6Header
);
135 extern BOOLEAN
MatchSrcPort(S_CLASSIFIER_RULE
*pstClassifierRule
,USHORT ushSrcPort
);
136 extern BOOLEAN
MatchDestPort(S_CLASSIFIER_RULE
*pstClassifierRule
,USHORT ushSrcPort
);
137 extern BOOLEAN
MatchProtocol(S_CLASSIFIER_RULE
*pstClassifierRule
,UCHAR ucProtocol
);