#include "mdnsd_config.h"
#include <arpa/inet.h>
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
|
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 message * | message_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) |
|
◆ 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 |
◆ QTYPE_A
◆ QTYPE_NS
◆ QTYPE_CNAME
◆ QTYPE_PTR
◆ QTYPE_TXT
◆ QTYPE_SRV
◆ 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 | ) |
|