]> Pileus Git - ~andy/linux/blob - drivers/staging/bcm/IPv6ProtocolHdr.h
Staging: bcm: Replace VOID with void in IPv6ProtocolHdr.h
[~andy/linux] / drivers / staging / bcm / IPv6ProtocolHdr.h
1 #ifndef _IPV6_PROTOCOL_DEFINES_
2 #define _IPV6_PROTOCOL_DEFINES_
3
4 #define IPV6HDR_TYPE_HOPBYHOP 0x0
5 #define IPV6HDR_TYPE_ROUTING 0x2B
6 #define IPV6HDR_TYPE_FRAGMENTATION 0x2C
7 #define IPV6HDR_TYPE_DESTOPTS 0x3c
8 #define IPV6HDR_TYPE_AUTHENTICATION 0x33
9 #define IPV6HDR_TYPE_ENCRYPTEDSECURITYPAYLOAD 0x34
10 #define MASK_IPV6_CS_SPEC 0x2
11
12 #define TCP_HEADER_TYPE 0x6
13 #define UDP_HEADER_TYPE 0x11
14 #define IPV6_ICMP_HDR_TYPE 0x2
15 #define IPV6_FLOWLABEL_BITOFFSET 9
16
17 #define IPV6_MAX_CHAINEDHDR_BUFFBYTES 0x64
18 /*
19  * Size of Dest Options field of Destinations Options Header
20  * in bytes.
21  */
22 #define IPV6_DESTOPTS_HDR_OPTIONSIZE 0x8
23
24 typedef struct IPV6HeaderFormatTag {
25         unsigned char  ucVersionPrio;
26         unsigned char  aucFlowLabel[3];
27         unsigned short usPayloadLength;
28         unsigned char  ucNextHeader;
29         unsigned char  ucHopLimit;
30         unsigned long  ulSrcIpAddress[4];
31         unsigned long  ulDestIpAddress[4];
32 } IPV6Header;
33
34 typedef struct IPV6RoutingHeaderFormatTag {
35         unsigned char ucNextHeader;
36         unsigned char ucRoutingType;
37         unsigned char ucNumAddresses;
38         unsigned char ucNextAddress;
39         unsigned long ulReserved;
40 } IPV6RoutingHeader;
41
42 typedef struct IPV6FragmentHeaderFormatTag {
43         unsigned char  ucNextHeader;
44         unsigned char  ucReserved;
45         unsigned short usFragmentOffset;
46         unsigned long  ulIdentification;
47 } IPV6FragmentHeader;
48
49 typedef struct IPV6DestOptionsHeaderFormatTag {
50         unsigned char ucNextHeader;
51         unsigned char ucHdrExtLen;
52         unsigned char ucDestOptions[6];
53 } IPV6DestOptionsHeader;
54
55 typedef struct IPV6HopByHopOptionsHeaderFormatTag {
56         unsigned char ucNextHeader;
57         unsigned char ucMisc[3];
58         unsigned long ulJumboPayloadLen;
59 } IPV6HopByHopOptionsHeader;
60
61 typedef struct IPV6AuthenticationHeaderFormatTag {
62         unsigned char  ucNextHeader;
63         unsigned char  ucLength;
64         unsigned short usReserved;
65         unsigned long  ulSecurityParametersIndex;
66 } IPV6AuthenticationHeader;
67
68 typedef struct IPV6IcmpHeaderFormatTag {
69         unsigned char  ucType;
70         unsigned char  ucCode;
71         unsigned short usChecksum;
72 } IPV6IcmpHeader;
73
74 typedef enum _E_IPADDR_CONTEXT {
75         eSrcIpAddress,
76         eDestIpAddress
77 } E_IPADDR_CONTEXT;
78
79 /* Function Prototypes */
80
81 unsigned short IpVersion6(struct bcm_mini_adapter *Adapter, /* < Pointer to the driver control structure */
82                                         void *pcIpHeader, /* <Pointer to the IP Hdr of the packet */
83                                         struct bcm_classifier_rule *pstClassifierRule);
84
85 void DumpIpv6Address(unsigned long *puIpv6Address);
86
87 extern BOOLEAN MatchSrcPort(struct bcm_classifier_rule *pstClassifierRule, unsigned short ushSrcPort);
88 extern BOOLEAN MatchDestPort(struct bcm_classifier_rule *pstClassifierRule, unsigned short ushSrcPort);
89 extern BOOLEAN MatchProtocol(struct bcm_classifier_rule *pstClassifierRule, unsigned char ucProtocol);
90
91 #endif