9 static UCHAR *GetNextIPV6ChainedHeader(
UCHAR **ppucPayload,
14 USHORT usNextHeaderOffset = 0 ;
17 if ((ppucPayload ==
NULL) || (*pusPayloadLength == 0) ||
23 pucRetHeaderPtr = *ppucPayload;
24 pucPayloadPtr = *ppucPayload;
26 if (!pucRetHeaderPtr || !pucPayloadPtr) {
35 switch (*pucNextHeader) {
60 "\nIPv6 Fragmentation Header");
68 int nTotalOptions = pstIpv6DestOptsHdr->
ucHdrExtLen;
71 "\nIPv6 DestOpts Header Header");
80 int nHdrLen = pstIpv6AuthHdr->
ucLength;
83 "\nIPv6 Authentication Header");
84 usNextHeaderOffset += nHdrLen * 4;
91 "\nIPv6 Encrypted Security Payload Header");
127 if (*bParseDone ==
FALSE) {
128 if (*pusPayloadLength <= usNextHeaderOffset) {
131 *pucNextHeader = *pucPayloadPtr;
132 pucPayloadPtr += usNextHeaderOffset;
133 (*pusPayloadLength) -= usNextHeaderOffset;
138 *ppucPayload = pucPayloadPtr;
139 return pucRetHeaderPtr;
146 UCHAR *pIpv6HdrScanContext = pucPayload;
148 UCHAR ucHeaderType = 0;
152 if (!pucPayload || (usPayloadLength == 0))
155 *pusSrcPort = *pusDestPort = 0;
156 ucHeaderType = ucNextHeader;
158 pucNextHeader = GetNextIPV6ChainedHeader(&pIpv6HdrScanContext,
159 &ucHeaderType, &bDone, &usPayloadLength);
163 *pusSrcPort = *((
PUSHORT)(pucNextHeader));
164 *pusDestPort = *((
PUSHORT)(pucNextHeader+2));
167 "\nProtocol Ports - Src Port :0x%x Dest Port : 0x%x",
169 ntohs(*pusDestPort));
188 UCHAR ucNextProtocolAboveIP = 0;
197 DumpIpv6Header(pstIpv6Header);
203 ucNextProtocolAboveIP = GetIpv6ProtocolPorts((
UCHAR *)(pcIpHeader +
sizeof(
IPV6Header)),
226 bClassificationSucceed = MatchSrcIpv6Address(pstClassifierRule,
228 if (!bClassificationSucceed)
231 bClassificationSucceed = MatchDestIpv6Address(pstClassifierRule,
233 if (!bClassificationSucceed)
242 ucNextProtocolAboveIP);
243 if (!bClassificationSucceed)
255 bClassificationSucceed =
MatchSrcPort(pstClassifierRule,
257 if (!bClassificationSucceed)
269 if (!bClassificationSucceed)
276 if (bClassificationSucceed ==
TRUE) {
277 INT iMatchedSFQueueIndex = 0;
280 bClassificationSucceed =
FALSE;
282 if (Adapter->
PackInfo[iMatchedSFQueueIndex].bActive ==
FALSE)
283 bClassificationSucceed =
FALSE;
287 return bClassificationSucceed;
294 UINT uiLoopIndex = 0;
295 UINT uiIpv6AddIndex = 0;
296 UINT uiIpv6AddrNoLongWords = 4;
306 if (uiCountIPSrcAddresses == 0)
311 for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++)
314 for (uiLoopIndex = 0; uiLoopIndex < uiCountIPSrcAddresses; uiLoopIndex += uiIpv6AddrNoLongWords) {
316 "\n Src Ipv6 Address In Received Packet :\n ");
319 "\n Src Ipv6 Mask In Classifier Rule:\n");
322 "\n Src Ipv6 Address In Classifier Rule :\n");
325 for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++) {
335 if (uiIpv6AddIndex == uiIpv6AddrNoLongWords-1) {
339 "Ipv6 Src Ip Address Matched\n");
350 UINT uiLoopIndex = 0;
351 UINT uiIpv6AddIndex = 0;
352 UINT uiIpv6AddrNoLongWords = 4;
363 if (uiCountIPDestinationAddresses == 0)
368 for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++)
371 for (uiLoopIndex = 0; uiLoopIndex < uiCountIPDestinationAddresses; uiLoopIndex += uiIpv6AddrNoLongWords) {
373 "\n Destination Ipv6 Address In Received Packet :\n ");
376 "\n Destination Ipv6 Mask In Classifier Rule :\n");
379 "\n Destination Ipv6 Address In Classifier Rule :\n");
382 for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++) {
392 if (uiIpv6AddIndex == uiIpv6AddrNoLongWords-1) {
396 "Ipv6 Destination Ip Address Matched\n");
407 UINT uiIpv6AddrNoLongWords = 4;
408 UINT uiIpv6AddIndex = 0;
410 for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++) {
412 ":%lx", puIpv6Address[uiIpv6AddIndex]);
423 "----Ipv6 Header---");
426 "Version : %x\n", ucVersion);
429 "Priority : %x\n", ucPrio);
435 "Payload Length : %x\n",
440 "Hop Limit : %x\n", pstIpv6Header->
ucHopLimit);
448 "----Ipv6 Header End---");