EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Data Structures | Functions
mdns_decoder.h File Reference

File containing the definition of the mdns packet decoder utilities. More...

#include <utarray.h>
#include "../../../utils/net.h"
#include "../../../utils/os.h"
#include "packet_decoder.h"
Include dependency graph for mdns_decoder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mdns_query_entry
 
struct  mdns_answer_entry
 

Functions

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...
 

Detailed Description

File containing the definition of the mdns packet decoder utilities.

Author
Alexandru Mereacre
Date
2021

Function Documentation

◆ decode_mdns_answers()

int decode_mdns_answers ( uint8_t *  payload,
size_t  len,
size_t *  first,
uint16_t  nanswers,
UT_array *  answers 
)

Decodes the mdns answers.

Parameters
payloadThe mdns payload
lenThe mdns payload length
[in,out]firstThe 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.
nanswersThe number of answers
[in,out]answersThe mdns_answer_entry answers array
Returns
0 Success, -1 on failure

◆ decode_mdns_header()

int decode_mdns_header ( uint8_t *  packet,
struct mdns_header out 
)

Decodes the mdns header.

Parameters
packetThe mdns packet
outThe output mdns decoded header
Returns
0 Success, -1 on failure

◆ decode_mdns_packet()

bool decode_mdns_packet ( struct capture_packet cpac)

Decode mdns packet.

Parameters
cpacThe capture packet structure
Returns
true Success, false otherwise

◆ decode_mdns_queries()

int decode_mdns_queries ( uint8_t *  payload,
size_t  len,
size_t *  first,
uint16_t  nqueries,
UT_array *  queries 
)

Decodes the mdns queries.

Parameters
payloadThe mdns payload
lenThe mdns payload length
[in,out]firstThe 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.
nqueriesThe number of queries
[in,out]queriesThe mdns_query_entry queries array
Returns
0 Success, -1 on failure