open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
mdnsd.h File Reference
#include "mdnsd_config.h"
#include "1035.h"
#include <stdbool.h>
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  mdns_answer
 

Macros

#define QCLASS_IN   (1)
 
#define MDNSD_LOG_TRACE(...)
 
#define MDNSD_LOG_DEBUG(...)
 
#define MDNSD_LOG_INFO(...)
 
#define MDNSD_LOG_WARNING(...)
 
#define MDNSD_LOG_ERROR(...)
 
#define MDNSD_LOG_FATAL(...)
 

Typedefs

typedef struct mdns_daemon mdns_daemon_t
 
typedef struct mdns_record mdns_record_t
 
typedef void(* mdnsd_record_received_callback) (const struct resource *r, void *data)
 
typedef struct mdns_answer mdns_answer_t
 

Functions

mdns_daemon_t MDNSD_EXPORT * mdnsd_new (int clazz, int frame)
 
void MDNSD_EXPORT mdnsd_shutdown (mdns_daemon_t *d)
 
void MDNSD_EXPORT mdnsd_flush (mdns_daemon_t *d)
 
void MDNSD_EXPORT mdnsd_free (mdns_daemon_t *d)
 
void MDNSD_EXPORT mdnsd_register_receive_callback (mdns_daemon_t *d, mdnsd_record_received_callback cb, void *data)
 
int MDNSD_EXPORT mdnsd_in (mdns_daemon_t *d, struct message *m, in_addr_t ip, unsigned short int port)
 
int MDNSD_EXPORT mdnsd_out (mdns_daemon_t *d, struct message *m, struct in_addr *ip, unsigned short int *port)
 
struct timeval MDNSD_EXPORT * mdnsd_sleep (mdns_daemon_t *d)
 
void MDNSD_EXPORT mdnsd_query (mdns_daemon_t *d, const char *host, int type, int(*answer)(mdns_answer_t *a, void *arg), void *arg)
 
mdns_answer_t MDNSD_EXPORT * mdnsd_list (mdns_daemon_t *d, const char *host, int type, mdns_answer_t *last)
 
mdns_record_t MDNSD_EXPORT * mdnsd_record_next (const mdns_record_t *r)
 
const mdns_answer_t MDNSD_EXPORT * mdnsd_record_data (const mdns_record_t *r)
 
mdns_record_t MDNSD_EXPORT * mdnsd_unique (mdns_daemon_t *d, const char *host, unsigned short int type, unsigned long int ttl, void(*conflict)(char *host, int type, void *arg), void *arg)
 
mdns_record_t MDNSD_EXPORT * mdnsd_shared (mdns_daemon_t *d, const char *host, unsigned short int type, unsigned long int ttl)
 
mdns_record_t MDNSD_EXPORT * mdnsd_get_published (const mdns_daemon_t *d, const char *host)
 
int MDNSD_EXPORT mdnsd_has_query (const mdns_daemon_t *d, const char *host)
 
void MDNSD_EXPORT mdnsd_done (mdns_daemon_t *d, mdns_record_t *r)
 
void MDNSD_EXPORT mdnsd_set_raw (mdns_daemon_t *d, mdns_record_t *r, const char *data, unsigned short int len)
 
void MDNSD_EXPORT mdnsd_set_host (mdns_daemon_t *d, mdns_record_t *r, const char *name)
 
void MDNSD_EXPORT mdnsd_set_ip (mdns_daemon_t *d, mdns_record_t *r, struct in_addr ip)
 
void MDNSD_EXPORT mdnsd_set_srv (mdns_daemon_t *d, mdns_record_t *r, unsigned short int priority, unsigned short int weight, unsigned short int port, char *name)
 
unsigned short int MDNSD_EXPORT mdnsd_step (mdns_daemon_t *d, int mdns_socket, bool processIn, bool processOut, struct timeval *nextSleep)
 

Macro Definition Documentation

◆ QCLASS_IN

#define QCLASS_IN   (1)

Definition at line 20 of file mdnsd.h.

◆ MDNSD_LOG_TRACE

#define MDNSD_LOG_TRACE ( ...)
Value:
do { \
printf("mdnsd: TRACE - "); printf(__VA_ARGS__); printf("\n"); } while(0)

Definition at line 23 of file mdnsd.h.

◆ MDNSD_LOG_DEBUG

#define MDNSD_LOG_DEBUG ( ...)
Value:
do { \
printf("mdnsd: DEBUG - "); printf(__VA_ARGS__); printf("\n"); } while(0)

Definition at line 30 of file mdnsd.h.

◆ MDNSD_LOG_INFO

#define MDNSD_LOG_INFO ( ...)
Value:
do { \
printf("mdnsd: INFO - "); printf(__VA_ARGS__); printf("\n"); } while(0)

Definition at line 37 of file mdnsd.h.

◆ MDNSD_LOG_WARNING

#define MDNSD_LOG_WARNING ( ...)
Value:
do { \
printf("mdnsd: WARN - "); printf(__VA_ARGS__); printf("\n"); } while(0)

Definition at line 44 of file mdnsd.h.

◆ MDNSD_LOG_ERROR

#define MDNSD_LOG_ERROR ( ...)
Value:
do { \
printf("mdnsd: ERROR - "); printf(__VA_ARGS__); printf("\n"); } while(0)

Definition at line 51 of file mdnsd.h.

◆ MDNSD_LOG_FATAL

#define MDNSD_LOG_FATAL ( ...)
Value:
do { \
printf("mdnsd: FATAL - "); printf(__VA_ARGS__); printf("\n"); } while(0)

Definition at line 58 of file mdnsd.h.

Typedef Documentation

◆ mdns_daemon_t

typedef struct mdns_daemon mdns_daemon_t

Main daemon data.

Definition at line 66 of file mdnsd.h.

◆ mdns_record_t

typedef struct mdns_record mdns_record_t

Record entry.

Definition at line 68 of file mdnsd.h.

◆ mdnsd_record_received_callback

typedef void(* mdnsd_record_received_callback) (const struct resource *r, void *data)

Callback for received record.

Data is passed from the register call

Definition at line 71 of file mdnsd.h.

◆ mdns_answer_t

typedef struct mdns_answer mdns_answer_t

Answer data.

Function Documentation

◆ mdnsd_new()

mdns_daemon_t MDNSD_EXPORT * mdnsd_new ( int clazz,
int frame )

◆ mdnsd_shutdown()

void MDNSD_EXPORT mdnsd_shutdown ( mdns_daemon_t * d)

◆ mdnsd_flush()

void MDNSD_EXPORT mdnsd_flush ( mdns_daemon_t * d)

◆ mdnsd_free()

void MDNSD_EXPORT mdnsd_free ( mdns_daemon_t * d)

◆ mdnsd_register_receive_callback()

void MDNSD_EXPORT mdnsd_register_receive_callback ( mdns_daemon_t * d,
mdnsd_record_received_callback cb,
void * data )

◆ mdnsd_in()

int MDNSD_EXPORT mdnsd_in ( mdns_daemon_t * d,
struct message * m,
in_addr_t ip,
unsigned short int port )

◆ mdnsd_out()

int MDNSD_EXPORT mdnsd_out ( mdns_daemon_t * d,
struct message * m,
struct in_addr * ip,
unsigned short int * port )

◆ mdnsd_sleep()

struct timeval MDNSD_EXPORT * mdnsd_sleep ( mdns_daemon_t * d)

◆ mdnsd_query()

void MDNSD_EXPORT mdnsd_query ( mdns_daemon_t * d,
const char * host,
int type,
int(* answer )(mdns_answer_t *a, void *arg),
void * arg )

◆ mdnsd_list()

mdns_answer_t MDNSD_EXPORT * mdnsd_list ( mdns_daemon_t * d,
const char * host,
int type,
mdns_answer_t * last )

◆ mdnsd_record_next()

mdns_record_t MDNSD_EXPORT * mdnsd_record_next ( const mdns_record_t * r)

◆ mdnsd_record_data()

const mdns_answer_t MDNSD_EXPORT * mdnsd_record_data ( const mdns_record_t * r)

◆ mdnsd_unique()

mdns_record_t MDNSD_EXPORT * mdnsd_unique ( mdns_daemon_t * d,
const char * host,
unsigned short int type,
unsigned long int ttl,
void(* conflict )(char *host, int type, void *arg),
void * arg )

◆ mdnsd_shared()

mdns_record_t MDNSD_EXPORT * mdnsd_shared ( mdns_daemon_t * d,
const char * host,
unsigned short int type,
unsigned long int ttl )

◆ mdnsd_get_published()

mdns_record_t MDNSD_EXPORT * mdnsd_get_published ( const mdns_daemon_t * d,
const char * host )

◆ mdnsd_has_query()

int MDNSD_EXPORT mdnsd_has_query ( const mdns_daemon_t * d,
const char * host )

◆ mdnsd_done()

void MDNSD_EXPORT mdnsd_done ( mdns_daemon_t * d,
mdns_record_t * r )

◆ mdnsd_set_raw()

void MDNSD_EXPORT mdnsd_set_raw ( mdns_daemon_t * d,
mdns_record_t * r,
const char * data,
unsigned short int len )

◆ mdnsd_set_host()

void MDNSD_EXPORT mdnsd_set_host ( mdns_daemon_t * d,
mdns_record_t * r,
const char * name )

◆ mdnsd_set_ip()

void MDNSD_EXPORT mdnsd_set_ip ( mdns_daemon_t * d,
mdns_record_t * r,
struct in_addr ip )

◆ mdnsd_set_srv()

void MDNSD_EXPORT mdnsd_set_srv ( mdns_daemon_t * d,
mdns_record_t * r,
unsigned short int priority,
unsigned short int weight,
unsigned short int port,
char * name )

◆ mdnsd_step()

unsigned short int MDNSD_EXPORT mdnsd_step ( mdns_daemon_t * d,
int mdns_socket,
bool processIn,
bool processOut,
struct timeval * nextSleep )