open62541 1.4.19
Open source implementation of OPC UA
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
1035.h File Reference
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>

Go to the source code of this file.

Data Structures

struct  question
 
struct  resource
 
struct  message
 

Macros

#define MAX_PACKET_LEN   65535
 
#define MAX_NUM_LABELS   512
 
#define QTYPE_A   1
 
#define QTYPE_NS   2
 
#define QTYPE_CNAME   5
 
#define QTYPE_PTR   12
 
#define QTYPE_TXT   16
 
#define QTYPE_AAAA   28
 
#define QTYPE_SRV   33
 
#define QTYPE_ANY   255
 

Functions

unsigned short int net2short (unsigned char **buf)
 
unsigned long int net2long (unsigned char **buf)
 
void short2net (unsigned short int i, unsigned char **buf)
 
void long2net (unsigned long int l, unsigned char **buf)
 
int message_parse (struct message *m, unsigned char *packet)
 
struct message * message_wire (void)
 
void message_qd (struct message *m, char *name, unsigned short int type, unsigned short int class)
 
void message_an (struct message *m, char *name, unsigned short int type, unsigned short int class, unsigned long int ttl)
 
void message_ns (struct message *m, char *name, unsigned short int type, unsigned short int class, unsigned long int ttl)
 
void message_ar (struct message *m, char *name, unsigned short int type, unsigned short int class, unsigned long int ttl)
 
void message_rdata_long (struct message *m, unsigned long l)
 
void message_rdata_ipv4 (struct message *m, struct in_addr a)
 
void message_rdata_ipv6 (struct message *m, struct in6_addr a6)
 
void message_rdata_name (struct message *m, char *name)
 
void message_rdata_srv (struct message *m, unsigned short int priority, unsigned short int weight, unsigned short int port, char *name)
 
void message_rdata_raw (struct message *m, unsigned char *rdata, unsigned short int rdlength)
 
unsigned char * message_packet (struct message *m)
 
int message_packet_len (struct message *m)
 

Macro Definition Documentation

◆ MAX_NUM_LABELS

#define MAX_NUM_LABELS   512

Definition at line 56 of file 1035.h.

◆ MAX_PACKET_LEN

#define MAX_PACKET_LEN   65535

Standalone DNS parsing, RFC10350.

Copyright (c) 2003 Jeremie Miller jer@j.nosp@m.abbe.nosp@m.r.org Copyright (c) 2016-2026 Joachim Wiberg trogl.nosp@m.obit.nosp@m.@gmai.nosp@m.l.co.nosp@m.m All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 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 55 of file 1035.h.

◆ QTYPE_A

#define QTYPE_A   1

Definition at line 63 of file 1035.h.

◆ QTYPE_AAAA

#define QTYPE_AAAA   28

Definition at line 68 of file 1035.h.

◆ QTYPE_ANY

#define QTYPE_ANY   255

Definition at line 70 of file 1035.h.

◆ QTYPE_CNAME

#define QTYPE_CNAME   5

Definition at line 65 of file 1035.h.

◆ QTYPE_NS

#define QTYPE_NS   2

Definition at line 64 of file 1035.h.

◆ QTYPE_PTR

#define QTYPE_PTR   12

Definition at line 66 of file 1035.h.

◆ QTYPE_SRV

#define QTYPE_SRV   33

Definition at line 69 of file 1035.h.

◆ QTYPE_TXT

#define QTYPE_TXT   16

Definition at line 67 of file 1035.h.

Function Documentation

◆ long2net()

void long2net ( unsigned long int  l,
unsigned char **  buf 
)

◆ message_an()

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

◆ message_ar()

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

◆ message_ns()

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

◆ message_packet()

unsigned char * message_packet ( struct message *  m)

◆ message_packet_len()

int message_packet_len ( struct message *  m)

◆ message_parse()

int message_parse ( struct message *  m,
unsigned char *  packet 
)

◆ message_qd()

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

◆ message_rdata_ipv4()

void message_rdata_ipv4 ( struct message *  m,
struct in_addr  a 
)

◆ message_rdata_ipv6()

void message_rdata_ipv6 ( struct message *  m,
struct in6_addr  a6 
)

◆ message_rdata_long()

void message_rdata_long ( struct message *  m,
unsigned long  l 
)

◆ message_rdata_name()

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

◆ message_rdata_raw()

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

◆ message_rdata_srv()

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

◆ message_wire()

struct message * message_wire ( void  )

◆ net2long()

unsigned long int net2long ( unsigned char **  buf)

◆ net2short()

unsigned short int net2short ( unsigned char **  buf)

◆ short2net()

void short2net ( unsigned short int  i,
unsigned char **  buf 
)