Lines Matching refs:IkePacket
30 IKE_PACKET *IkePacket; in IkePacketAlloc() local
32 IkePacket = (IKE_PACKET *) AllocateZeroPool (sizeof (IKE_PACKET)); in IkePacketAlloc()
33 if (IkePacket == NULL) { in IkePacketAlloc()
37 IkePacket->RefCount = 1; in IkePacketAlloc()
38 InitializeListHead (&IkePacket->PayloadList); in IkePacketAlloc()
40 IkePacket->Header = (IKE_HEADER *) AllocateZeroPool (sizeof (IKE_HEADER)); in IkePacketAlloc()
41 if (IkePacket->Header == NULL) { in IkePacketAlloc()
42 FreePool (IkePacket); in IkePacketAlloc()
45 return IkePacket; in IkePacketAlloc()
56 IN IKE_PACKET *IkePacket in IkePacketFree() argument
62 if (IkePacket == NULL) { in IkePacketFree()
68 if (--IkePacket->RefCount == 0) { in IkePacketFree()
72 if (!IkePacket->IsHdrExt && IkePacket->Header != NULL) { in IkePacketFree()
73 FreePool (IkePacket->Header); in IkePacketFree()
78 if (!IkePacket->IsPayloadsBufExt && IkePacket->PayloadsBuf != NULL) { in IkePacketFree()
79 FreePool (IkePacket->PayloadsBuf); in IkePacketFree()
84 for (Entry = (IkePacket)->PayloadList.ForwardLink; Entry != &(IkePacket)->PayloadList;) { in IkePacketFree()
91 FreePool (IkePacket); in IkePacketFree()
129 IKE_PACKET *IkePacket; in IkePacketFromNetbuf() local
131 IkePacket = NULL; in IkePacketFromNetbuf()
136 IkePacket = IkePacketAlloc (); in IkePacketFromNetbuf()
137 if (IkePacket == NULL) { in IkePacketFromNetbuf()
143 NetbufCopy (Netbuf, 0, sizeof (IKE_HEADER), (UINT8 *) IkePacket->Header); in IkePacketFromNetbuf()
147 IkeHdrNetToHost (IkePacket->Header); in IkePacketFromNetbuf()
148 if (IkePacket->Header->Length < Netbuf->TotalSize) { in IkePacketFromNetbuf()
152 IkePacket->PayloadTotalSize = IkePacket->Header->Length - sizeof (IKE_HEADER); in IkePacketFromNetbuf()
153 IkePacket->PayloadsBuf = (UINT8 *) AllocateZeroPool (IkePacket->PayloadTotalSize); in IkePacketFromNetbuf()
155 if (IkePacket->PayloadsBuf == NULL) { in IkePacketFromNetbuf()
161 …NetbufCopy (Netbuf, sizeof (IKE_HEADER), (UINT32) IkePacket->PayloadTotalSize, IkePacket->Payloads… in IkePacketFromNetbuf()
162 return IkePacket; in IkePacketFromNetbuf()
165 if (IkePacket != NULL) { in IkePacketFromNetbuf()
166 IkePacketFree (IkePacket); in IkePacketFromNetbuf()
187 IN IKE_PACKET *IkePacket, in IkeNetbufFromPacket() argument
199 if (!IkePacket->IsEncoded) { in IkeNetbufFromPacket()
200 IkePacket->IsEncoded = TRUE; in IkeNetbufFromPacket()
206 Ikev2EncodePacket ((IKEV2_SESSION_COMMON *) SessionCommon, IkePacket, IkeType); in IkeNetbufFromPacket()
219 NET_LIST_FOR_EACH (PacketEntry, &(IkePacket)->PayloadList) { in IkeNetbufFromPacket()
231 Fragments[0].Bulk = (UINT8 *) IkePacket->Header; in IkeNetbufFromPacket()
238 NET_LIST_FOR_EACH (Entry, &(IkePacket)->PayloadList) { in IkeNetbufFromPacket()