|
open62541 1.4.19
Open source implementation of OPC UA
|
#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) |
| #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:
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
| void long2net | ( | unsigned long int | l, |
| unsigned char ** | buf | ||
| ) |
| void message_an | ( | 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_ns | ( | struct message * | m, |
| char * | name, | ||
| unsigned short int | type, | ||
| unsigned short int | class, | ||
| unsigned long int | ttl | ||
| ) |
| unsigned char * message_packet | ( | struct message * | m | ) |
| int message_packet_len | ( | struct message * | m | ) |
| int message_parse | ( | struct message * | m, |
| unsigned char * | packet | ||
| ) |
| void message_qd | ( | struct message * | m, |
| char * | name, | ||
| unsigned short int | type, | ||
| unsigned short int | class | ||
| ) |
| 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_long | ( | struct message * | m, |
| unsigned long | l | ||
| ) |
| void message_rdata_name | ( | struct message * | m, |
| char * | name | ||
| ) |
| void message_rdata_raw | ( | struct message * | m, |
| unsigned char * | rdata, | ||
| unsigned short int | rdlength | ||
| ) |
| void message_rdata_srv | ( | struct message * | m, |
| unsigned short int | priority, | ||
| unsigned short int | weight, | ||
| unsigned short int | port, | ||
| char * | name | ||
| ) |
| struct message * message_wire | ( | void | ) |
| unsigned long int net2long | ( | unsigned char ** | buf | ) |
| unsigned short int net2short | ( | unsigned char ** | buf | ) |
| void short2net | ( | unsigned short int | i, |
| unsigned char ** | buf | ||
| ) |