2010-09-08 23:46:36 +02:00
|
|
|
#ifndef _IPV6_PROTOCOL_DEFINES_
|
|
|
|
#define _IPV6_PROTOCOL_DEFINES_
|
|
|
|
|
|
|
|
#define IPV6HDR_TYPE_HOPBYHOP 0x0
|
|
|
|
#define IPV6HDR_TYPE_ROUTING 0x2B
|
|
|
|
#define IPV6HDR_TYPE_FRAGMENTATION 0x2C
|
|
|
|
#define IPV6HDR_TYPE_DESTOPTS 0x3c
|
|
|
|
#define IPV6HDR_TYPE_AUTHENTICATION 0x33
|
|
|
|
#define IPV6HDR_TYPE_ENCRYPTEDSECURITYPAYLOAD 0x34
|
|
|
|
#define MASK_IPV6_CS_SPEC 0x2
|
|
|
|
|
2012-12-11 03:54:54 +01:00
|
|
|
#define TCP_HEADER_TYPE 0x6
|
|
|
|
#define UDP_HEADER_TYPE 0x11
|
2010-09-08 23:46:36 +02:00
|
|
|
#define IPV6_ICMP_HDR_TYPE 0x2
|
|
|
|
#define IPV6_FLOWLABEL_BITOFFSET 9
|
|
|
|
|
|
|
|
#define IPV6_MAX_CHAINEDHDR_BUFFBYTES 0x64
|
|
|
|
/*
|
2012-12-11 03:54:55 +01:00
|
|
|
* Size of Dest Options field of Destinations Options Header
|
|
|
|
* in bytes.
|
|
|
|
*/
|
2010-09-08 23:46:36 +02:00
|
|
|
#define IPV6_DESTOPTS_HDR_OPTIONSIZE 0x8
|
|
|
|
|
2012-12-11 03:55:10 +01:00
|
|
|
struct bcm_ipv6_hdr {
|
2012-12-11 03:54:59 +01:00
|
|
|
unsigned char ucVersionPrio;
|
|
|
|
unsigned char aucFlowLabel[3];
|
2012-12-11 03:54:57 +01:00
|
|
|
unsigned short usPayloadLength;
|
2012-12-11 03:54:59 +01:00
|
|
|
unsigned char ucNextHeader;
|
|
|
|
unsigned char ucHopLimit;
|
2012-12-11 03:54:58 +01:00
|
|
|
unsigned long ulSrcIpAddress[4];
|
|
|
|
unsigned long ulDestIpAddress[4];
|
2012-12-11 03:55:10 +01:00
|
|
|
};
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:55:09 +01:00
|
|
|
struct bcm_ipv6_routing_hdr {
|
2012-12-11 03:54:59 +01:00
|
|
|
unsigned char ucNextHeader;
|
|
|
|
unsigned char ucRoutingType;
|
|
|
|
unsigned char ucNumAddresses;
|
|
|
|
unsigned char ucNextAddress;
|
2012-12-11 03:54:58 +01:00
|
|
|
unsigned long ulReserved;
|
2012-12-11 03:55:09 +01:00
|
|
|
};
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:55:08 +01:00
|
|
|
struct bcm_ipv6_fragment_hdr {
|
2012-12-11 03:54:59 +01:00
|
|
|
unsigned char ucNextHeader;
|
|
|
|
unsigned char ucReserved;
|
2012-12-11 03:54:57 +01:00
|
|
|
unsigned short usFragmentOffset;
|
2012-12-11 03:54:58 +01:00
|
|
|
unsigned long ulIdentification;
|
2012-12-11 03:55:08 +01:00
|
|
|
};
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:55:07 +01:00
|
|
|
struct bcm_ipv6_dest_options_hdr {
|
2012-12-11 03:54:59 +01:00
|
|
|
unsigned char ucNextHeader;
|
|
|
|
unsigned char ucHdrExtLen;
|
|
|
|
unsigned char ucDestOptions[6];
|
2012-12-11 03:55:07 +01:00
|
|
|
};
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:55:06 +01:00
|
|
|
struct bcm_ipv6_options_hdr {
|
2012-12-11 03:54:59 +01:00
|
|
|
unsigned char ucNextHeader;
|
|
|
|
unsigned char ucMisc[3];
|
2012-12-11 03:54:58 +01:00
|
|
|
unsigned long ulJumboPayloadLen;
|
2012-12-11 03:55:06 +01:00
|
|
|
};
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:55:05 +01:00
|
|
|
struct bcm_ipv6_authentication_hdr {
|
2012-12-11 03:54:59 +01:00
|
|
|
unsigned char ucNextHeader;
|
|
|
|
unsigned char ucLength;
|
2012-12-11 03:54:57 +01:00
|
|
|
unsigned short usReserved;
|
2012-12-11 03:54:58 +01:00
|
|
|
unsigned long ulSecurityParametersIndex;
|
2012-12-11 03:55:05 +01:00
|
|
|
};
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:55:03 +01:00
|
|
|
enum bcm_ipaddr_context {
|
2010-09-08 23:46:36 +02:00
|
|
|
eSrcIpAddress,
|
|
|
|
eDestIpAddress
|
2012-12-11 03:55:03 +01:00
|
|
|
};
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:54:55 +01:00
|
|
|
/* Function Prototypes */
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:54:57 +01:00
|
|
|
unsigned short IpVersion6(struct bcm_mini_adapter *Adapter, /* < Pointer to the driver control structure */
|
2012-12-11 03:55:00 +01:00
|
|
|
void *pcIpHeader, /* <Pointer to the IP Hdr of the packet */
|
2012-12-11 03:54:54 +01:00
|
|
|
struct bcm_classifier_rule *pstClassifierRule);
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:55:01 +01:00
|
|
|
void DumpIpv6Address(unsigned long *puIpv6Address);
|
2010-09-08 23:46:36 +02:00
|
|
|
|
2012-12-11 03:55:02 +01:00
|
|
|
extern bool MatchSrcPort(struct bcm_classifier_rule *pstClassifierRule, unsigned short ushSrcPort);
|
|
|
|
extern bool MatchDestPort(struct bcm_classifier_rule *pstClassifierRule, unsigned short ushSrcPort);
|
|
|
|
extern bool MatchProtocol(struct bcm_classifier_rule *pstClassifierRule, unsigned char ucProtocol);
|
2010-09-08 23:46:36 +02:00
|
|
|
|
|
|
|
#endif
|