EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
mdns_list.h
Go to the documentation of this file.
1 
11 #ifndef MDNS_LIST_H
12 #define MDNS_LIST_H
13 
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <inttypes.h>
17 #include <string.h>
18 
19 #include <list.h>
20 
25 };
26 
33  uint32_t ttl;
34  uint16_t rrtype;
35  uint16_t qtype;
36  char *name;
37 };
38 
43 struct mdns_list {
44  struct mdns_list_info info;
45  struct dl_list list;
46 };
47 
53 struct mdns_list *init_mdns_list(void);
54 
62 int push_mdns_list(struct mdns_list *mlist, struct mdns_list_info *info);
63 
69 void free_mdns_list_el(struct mdns_list *el);
70 
76 void free_mdns_list(struct mdns_list *mlist);
77 
85 int check_mdns_list_req(struct mdns_list *mlist,
86  enum MDNS_REQUEST_TYPE request);
87 
88 #endif
void free_mdns_list(struct mdns_list *mlist)
Frees the mdns list.
Definition: mdns_list.c:43
int check_mdns_list_req(struct mdns_list *mlist, enum MDNS_REQUEST_TYPE request)
Checks if MDNS list has an element with a given request type.
Definition: mdns_list.c:97
struct mdns_list * init_mdns_list(void)
Initialises an empty mdns list.
Definition: mdns_list.c:20
MDNS_REQUEST_TYPE
Definition: mdns_list.h:21
@ MDNS_REQUEST_QUERY
Definition: mdns_list.h:23
@ MDNS_REQUEST_NONE
Definition: mdns_list.h:22
@ MDNS_REQUEST_ANSWER
Definition: mdns_list.h:24
void free_mdns_list_el(struct mdns_list *el)
Delete a mdns list entry.
Definition: mdns_list.c:35
int push_mdns_list(struct mdns_list *mlist, struct mdns_list_info *info)
Pushes an mdns info entry in the mdns list.
Definition: mdns_list.c:53
MDNS info list.
Definition: mdns_list.h:31
uint32_t ttl
Definition: mdns_list.h:33
uint16_t rrtype
Definition: mdns_list.h:34
char * name
Definition: mdns_list.h:36
enum MDNS_REQUEST_TYPE request
Definition: mdns_list.h:32
uint16_t qtype
Definition: mdns_list.h:35
MDNS info list.
Definition: mdns_list.h:43
struct mdns_list_info info
Definition: mdns_list.h:44
struct dl_list list
Definition: mdns_list.h:45