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

Go to the source code of this file.

Data Structures

struct  question
 
struct  resource
 
struct  message
 

Macros

#define MAX_PACKET_LEN   10000
 
#define MAX_NUM_LABELS   20
 
#define QTYPE_A   1
 
#define QTYPE_NS   2
 
#define QTYPE_CNAME   5
 
#define QTYPE_PTR   12
 
#define QTYPE_TXT   16
 
#define QTYPE_SRV   33
 

Functions

uint16_t net2short (const unsigned char **bufp)
 
uint32_t net2long (const unsigned char **bufp)
 
void MDNSD_EXPORT short2net (uint16_t i, unsigned char **bufp)
 
void MDNSD_EXPORT long2net (uint32_t l, unsigned char **bufp)
 
bool MDNSD_EXPORT message_parse (struct message *m, unsigned char *packet, size_t packetLen)
 
struct messagemessage_wire (void)
 
void MDNSD_EXPORT message_qd (struct message *m, char *name, unsigned short int type, unsigned short int clazz)
 
void MDNSD_EXPORT message_an (struct message *m, char *name, unsigned short int type, unsigned short int clazz, unsigned long ttl)
 
void MDNSD_EXPORT message_ns (struct message *m, char *name, unsigned short int type, unsigned short int clazz, unsigned long ttl)
 
void MDNSD_EXPORT message_ar (struct message *m, char *name, unsigned short int type, unsigned short int clazz, unsigned long ttl)
 
void MDNSD_EXPORT message_rdata_long (struct message *m, struct in_addr l)
 
void MDNSD_EXPORT message_rdata_name (struct message *m, char *name)
 
void MDNSD_EXPORT message_rdata_srv (struct message *m, unsigned short int priority, unsigned short int weight, unsigned short int port, char *name)
 
void MDNSD_EXPORT message_rdata_raw (struct message *m, unsigned char *rdata, unsigned short int rdlength)
 
unsigned char MDNSD_EXPORT * message_packet (struct message *m)
 
int MDNSD_EXPORT message_packet_len (struct message *m)
 

Macro Definition Documentation

◆ MAX_PACKET_LEN

#define MAX_PACKET_LEN   10000

Familiarize yourself with RFC1035 if you want to know what all the variable names mean.

This file hides most of the dirty work all of this code depends on the buffer space a packet is in being 4096 and zero'd before the packet is copied in also conveniently decodes srv rr's, type 33, see RFC2782 Should be reasonably large, for UDP

Definition at line 62 of file 1035.h.

◆ MAX_NUM_LABELS

#define MAX_NUM_LABELS   20

Definition at line 63 of file 1035.h.

◆ QTYPE_A

#define QTYPE_A   1

Definition at line 70 of file 1035.h.

◆ QTYPE_NS

#define QTYPE_NS   2

Definition at line 71 of file 1035.h.

◆ QTYPE_CNAME

#define QTYPE_CNAME   5

Definition at line 72 of file 1035.h.

◆ QTYPE_PTR

#define QTYPE_PTR   12

Definition at line 73 of file 1035.h.

◆ QTYPE_TXT

#define QTYPE_TXT   16

Definition at line 74 of file 1035.h.

◆ QTYPE_SRV

#define QTYPE_SRV   33

Definition at line 75 of file 1035.h.

Function Documentation

◆ net2short()

uint16_t net2short ( const unsigned char ** bufp)

◆ net2long()

uint32_t net2long ( const unsigned char ** bufp)

◆ short2net()

void MDNSD_EXPORT short2net ( uint16_t i,
unsigned char ** bufp )

◆ long2net()

void MDNSD_EXPORT long2net ( uint32_t l,
unsigned char ** bufp )

◆ message_parse()

bool MDNSD_EXPORT message_parse ( struct message * m,
unsigned char * packet,
size_t packetLen )

◆ message_wire()

struct message * message_wire ( void )

◆ message_qd()

void MDNSD_EXPORT message_qd ( struct message * m,
char * name,
unsigned short int type,
unsigned short int clazz )

◆ message_an()

void MDNSD_EXPORT message_an ( struct message * m,
char * name,
unsigned short int type,
unsigned short int clazz,
unsigned long ttl )

◆ message_ns()

void MDNSD_EXPORT message_ns ( struct message * m,
char * name,
unsigned short int type,
unsigned short int clazz,
unsigned long ttl )

◆ message_ar()

void MDNSD_EXPORT message_ar ( struct message * m,
char * name,
unsigned short int type,
unsigned short int clazz,
unsigned long ttl )

◆ message_rdata_long()

void MDNSD_EXPORT message_rdata_long ( struct message * m,
struct in_addr l )

◆ message_rdata_name()

void MDNSD_EXPORT message_rdata_name ( struct message * m,
char * name )

◆ message_rdata_srv()

void MDNSD_EXPORT message_rdata_srv ( struct message * m,
unsigned short int priority,
unsigned short int weight,
unsigned short int port,
char * name )

◆ message_rdata_raw()

void MDNSD_EXPORT message_rdata_raw ( struct message * m,
unsigned char * rdata,
unsigned short int rdlength )

◆ message_packet()

unsigned char MDNSD_EXPORT * message_packet ( struct message * m)

◆ message_packet_len()

int MDNSD_EXPORT message_packet_len ( struct message * m)