|
EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the implementation of the mdns packet decoder utilities. More...
#include <netinet/udp.h>#include "../../../utils/allocs.h"#include "../../../utils/hash.h"#include "../../../utils/iface.h"#include "../../../utils/os.h"#include "../../../utils/squeue.h"#include "mdns_decoder.h"#include "packet_decoder.h"Macros | |
| #define | COMPRESSION_FLAG 0xC0 |
| #define | COMPRESSION_FLAG_BIT7 0x80 |
| #define | COMPRESSION_FLAG_BIT6 0x40 |
Functions | |
| int | copy_mdns_query_name (uint8_t *start, char **out) |
| uint16_t | get_mdns_query_offset (uint8_t low, uint8_t high) |
| int | decode_mdns_query_name (uint8_t *payload, size_t len, size_t *first, char **out) |
| int | decode_mdns_queries (uint8_t *payload, size_t len, size_t *first, uint16_t nqueries, UT_array *queries) |
| Decodes the mdns queries. More... | |
| int | decode_mdns_answers (uint8_t *payload, size_t len, size_t *first, uint16_t nanswers, UT_array *answers) |
| Decodes the mdns answers. More... | |
| int | decode_mdns_header (uint8_t *packet, struct mdns_header *out) |
| Decodes the mdns header. More... | |
| bool | decode_mdns_packet (struct capture_packet *cpac) |
| Decode mdns packet. More... | |
File containing the implementation of the mdns packet decoder utilities.
| #define COMPRESSION_FLAG 0xC0 |
| #define COMPRESSION_FLAG_BIT6 0x40 |
| #define COMPRESSION_FLAG_BIT7 0x80 |
| int copy_mdns_query_name | ( | uint8_t * | start, |
| char ** | out | ||
| ) |
| int decode_mdns_answers | ( | uint8_t * | payload, |
| size_t | len, | ||
| size_t * | first, | ||
| uint16_t | nanswers, | ||
| UT_array * | answers | ||
| ) |
Decodes the mdns answers.
| payload | The mdns payload | |
| len | The mdns payload length | |
| [in,out] | first | The starting index to the answers field in the mdns payload. When done, this will be modified to be the starting index of the next field. |
| nanswers | The number of answers | |
| [in,out] | answers | The mdns_answer_entry answers array |
| int decode_mdns_header | ( | uint8_t * | packet, |
| struct mdns_header * | out | ||
| ) |
Decodes the mdns header.
| packet | The mdns packet |
| out | The output mdns decoded header |
| bool decode_mdns_packet | ( | struct capture_packet * | cpac | ) |
Decode mdns packet.
| cpac | The capture packet structure |
| int decode_mdns_queries | ( | uint8_t * | payload, |
| size_t | len, | ||
| size_t * | first, | ||
| uint16_t | nqueries, | ||
| UT_array * | queries | ||
| ) |
Decodes the mdns queries.
| payload | The mdns payload | |
| len | The mdns payload length | |
| [in,out] | first | The starting index to the queries field in the mdns payload. When done, this will be modified to be the starting index of the next field. |
| nqueries | The number of queries | |
| [in,out] | queries | The mdns_query_entry queries array |
| int decode_mdns_query_name | ( | uint8_t * | payload, |
| size_t | len, | ||
| size_t * | first, | ||
| char ** | out | ||
| ) |
| uint16_t get_mdns_query_offset | ( | uint8_t | low, |
| uint8_t | high | ||
| ) |