Added the function to extract the frame from CAPWAP data packet
This commit is contained in:
parent
bb85dc3e23
commit
4c466d68be
@ -337,6 +337,31 @@ int capwap_parsing_packet(struct capwap_packet_rxmng* rxmngpacket, struct capwap
|
||||
return PARSING_COMPLETE;
|
||||
}
|
||||
|
||||
/* */
|
||||
int capwap_packet_getdata(struct capwap_packet_rxmng* rxmngpacket, uint8_t* buffer, int maxlength) {
|
||||
int result;
|
||||
|
||||
ASSERT(rxmngpacket != NULL);
|
||||
ASSERT(buffer != NULL);
|
||||
ASSERT(maxlength > 0);
|
||||
|
||||
/* Get only data packet */
|
||||
if (rxmngpacket->isctrlpacket || IS_FLAG_K_HEADER(rxmngpacket->header)) {
|
||||
return -1;
|
||||
} else if (rxmngpacket->packetlength > maxlength) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Get data packet */
|
||||
rxmngpacket->readerpacketallowed = rxmngpacket->packetlength;
|
||||
result = rxmngpacket->read_ops.read_block((capwap_message_elements_handle)rxmngpacket, buffer, rxmngpacket->packetlength);
|
||||
if (result != rxmngpacket->packetlength) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* */
|
||||
int capwap_validate_parsed_packet(struct capwap_parsed_packet* packet, struct capwap_array* returnedmessage) {
|
||||
unsigned short binding;
|
||||
|
@ -144,7 +144,10 @@ struct capwap_parsed_packet {
|
||||
int capwap_parsing_packet(struct capwap_packet_rxmng* rxmngpacket, struct capwap_connection* connection, struct capwap_parsed_packet* packet);
|
||||
int capwap_validate_parsed_packet(struct capwap_parsed_packet* packet, struct capwap_array* returnedmessage);
|
||||
void capwap_free_parsed_packet(struct capwap_parsed_packet* packet);
|
||||
|
||||
struct capwap_list_item* capwap_get_message_element(struct capwap_parsed_packet* packet, uint16_t type);
|
||||
void* capwap_get_message_element_data(struct capwap_parsed_packet* packet, uint16_t type);
|
||||
|
||||
int capwap_packet_getdata(struct capwap_packet_rxmng* rxmngpacket, uint8_t* buffer, int maxlength);
|
||||
|
||||
#endif /* __CAPWAP_ELEMENT_HEADER__ */
|
||||
|
Loading…
Reference in New Issue
Block a user