| Visioscan Set SDK Libraries 1.3.5 Visioscan Set SDK Help documentation file for C++ and C++/CLI |

Loading...
Searching...
No Matches
iphdr.h
1#include <pshpack1.h>
2
3// Ping result
4 typedef struct ping_result
5{
6 int success;
7 int failed;
8 int timeout;
9} PING_RESULT;
10
11// IPv4 header
12 typedef struct ip_hdr
13{
14 unsigned char ip_verlen; // 4-bit IPv4 version
15 // 4-bit header length (in 32-bit words)
16 unsigned char ip_tos; // IP type of service
17 unsigned short ip_totallength; // Total length
18 unsigned short ip_id; // Unique identifier
19 unsigned short ip_offset; // Fragment offset field
20 unsigned char ip_ttl; // Time to live
21 unsigned char ip_protocol; // Protocol(TCP,UDP etc)
22 unsigned short ip_checksum; // IP checksum
23 unsigned int ip_srcaddr; // Source address
24 unsigned int ip_destaddr; // Source address
25} IPV4_HDR, * PIPV4_HDR, FAR* LPIPV4_HDR;
26
27// IPv4 option header
28 typedef struct ipv4_option_hdr
29{
30 unsigned char opt_code; // option type
31 unsigned char opt_len; // length of the option header
32 unsigned char opt_ptr; // offset into options
33 unsigned long opt_addr[9]; // list of IPv4 addresses
34} IPV4_OPTION_HDR, * PIPV4_OPTION_HDR, FAR* LPIPV4_OPTION_HDR;
35
36// ICMP header
37 typedef struct icmp_hdr
38{
39 unsigned char icmp_type;
40 unsigned char icmp_code;
41 unsigned short icmp_checksum;
42 unsigned short icmp_id;
43 unsigned short icmp_sequence;
44} ICMP_HDR, * PICMP_HDR, FAR* LPICMP_HDR;
45
46// IPv6 protocol header
47 typedef struct ipv6_hdr
48{
49 unsigned long ipv6_vertcflow; // 4-bit IPv6 version
50 // 8-bit traffic class
51 // 20-bit flow label
52 unsigned short ipv6_payloadlen; // payload length
53 unsigned char ipv6_nexthdr; // next header protocol value
54 unsigned char ipv6_hoplimit; // TTL
55 struct in6_addr ipv6_srcaddr; // Source address
56 struct in6_addr ipv6_destaddr; // Destination address
57} IPV6_HDR, * PIPV6_HDR, FAR* LPIPV6_HDR;
58
59// IPv6 fragment header
60 typedef struct ipv6_fragment_hdr
61{
62 unsigned char ipv6_frag_nexthdr;
63 unsigned char ipv6_frag_reserved;
64 unsigned short ipv6_frag_offset;
65 unsigned long ipv6_frag_id;
66} IPV6_FRAGMENT_HDR, * PIPV6_FRAGMENT_HDR, FAR* LPIPV6_FRAGMENT_HDR;
67
68// ICMPv6 header
69 typedef struct icmpv6_hdr {
70 unsigned char icmp6_type;
71 unsigned char icmp6_code;
72 unsigned short icmp6_checksum;
73} ICMPV6_HDR;
74
75// ICMPv6 echo request body
76 typedef struct icmpv6_echo_request
77{
78 unsigned short icmp6_echo_id;
79 unsigned short icmp6_echo_sequence;
80} ICMPV6_ECHO_REQUEST;
81
82// Define the UDP header
83 typedef struct udp_hdr
84{
85 unsigned short src_portno; // Source port no.
86 unsigned short dst_portno; // Dest. port no.
87 unsigned short udp_length; // Udp packet length
88 unsigned short udp_checksum; // Udp checksum (optional)
89} UDP_HDR, * PUDP_HDR;
90
91// IPv4 option for record route
92#define IP_RECORD_ROUTE 0x7
93
94// ICMP6 protocol value (used in the socket call and IPv6 header)
95#define IPPROTO_ICMP6 58
96
97// ICMP types and codes
98#define ICMPV4_ECHO_REQUEST_TYPE 8
99#define ICMPV4_ECHO_REQUEST_CODE 0
100#define ICMPV4_ECHO_REPLY_TYPE 0
101#define ICMPV4_ECHO_REPLY_CODE 0
102#define ICMPV4_MINIMUM_HEADER 8
103
104// ICPM6 types and codes
105#define ICMPV6_ECHO_REQUEST_TYPE 128
106#define ICMPV6_ECHO_REQUEST_CODE 0
107#define ICMPV6_ECHO_REPLY_TYPE 129
108#define ICMPV6_ECHO_REPLY_CODE 0
109
110// Restore byte alignment back to default
111#include <poppack.h>
ping_result
Definition iphdr.h:5
ping_result::timeout
int timeout
Definition iphdr.h:8
ping_result::failed
int failed
Definition iphdr.h:7
ping_result::success
int success
Definition iphdr.h:6
ip_hdr
Definition iphdr.h:13
ip_hdr::ip_protocol
unsigned char ip_protocol
Definition iphdr.h:21
ip_hdr::ip_totallength
unsigned short ip_totallength
Definition iphdr.h:17
ip_hdr::ip_offset
unsigned short ip_offset
Definition iphdr.h:19
ip_hdr::ip_id
unsigned short ip_id
Definition iphdr.h:18
ip_hdr::ip_verlen
unsigned char ip_verlen
Definition iphdr.h:14
ip_hdr::ip_srcaddr
unsigned int ip_srcaddr
Definition iphdr.h:23
ip_hdr::ip_checksum
unsigned short ip_checksum
Definition iphdr.h:22
ip_hdr::ip_destaddr
unsigned int ip_destaddr
Definition iphdr.h:24
ip_hdr::ip_tos
unsigned char ip_tos
Definition iphdr.h:16
ip_hdr::ip_ttl
unsigned char ip_ttl
Definition iphdr.h:20
ipv4_option_hdr
Definition iphdr.h:29
ipv4_option_hdr::opt_len
unsigned char opt_len
Definition iphdr.h:31
ipv4_option_hdr::opt_addr
unsigned long opt_addr[9]
Definition iphdr.h:33
ipv4_option_hdr::opt_ptr
unsigned char opt_ptr
Definition iphdr.h:32
ipv4_option_hdr::opt_code
unsigned char opt_code
Definition iphdr.h:30
icmp_hdr
Definition iphdr.h:38
icmp_hdr::icmp_checksum
unsigned short icmp_checksum
Definition iphdr.h:41
icmp_hdr::icmp_type
unsigned char icmp_type
Definition iphdr.h:39
icmp_hdr::icmp_code
unsigned char icmp_code
Definition iphdr.h:40
icmp_hdr::icmp_id
unsigned short icmp_id
Definition iphdr.h:42
icmp_hdr::icmp_sequence
unsigned short icmp_sequence
Definition iphdr.h:43
ipv6_hdr
Definition iphdr.h:48
ipv6_hdr::ipv6_payloadlen
unsigned short ipv6_payloadlen
Definition iphdr.h:52
ipv6_hdr::ipv6_nexthdr
unsigned char ipv6_nexthdr
Definition iphdr.h:53
ipv6_hdr::ipv6_vertcflow
unsigned long ipv6_vertcflow
Definition iphdr.h:49
ipv6_hdr::ipv6_srcaddr
struct in6_addr ipv6_srcaddr
Definition iphdr.h:55
ipv6_hdr::ipv6_hoplimit
unsigned char ipv6_hoplimit
Definition iphdr.h:54
ipv6_hdr::ipv6_destaddr
struct in6_addr ipv6_destaddr
Definition iphdr.h:56
ipv6_fragment_hdr
Definition iphdr.h:61
ipv6_fragment_hdr::ipv6_frag_nexthdr
unsigned char ipv6_frag_nexthdr
Definition iphdr.h:62
ipv6_fragment_hdr::ipv6_frag_id
unsigned long ipv6_frag_id
Definition iphdr.h:65
ipv6_fragment_hdr::ipv6_frag_offset
unsigned short ipv6_frag_offset
Definition iphdr.h:64
ipv6_fragment_hdr::ipv6_frag_reserved
unsigned char ipv6_frag_reserved
Definition iphdr.h:63
icmpv6_hdr
Definition iphdr.h:69
icmpv6_hdr::icmp6_type
unsigned char icmp6_type
Definition iphdr.h:70
icmpv6_hdr::icmp6_checksum
unsigned short icmp6_checksum
Definition iphdr.h:72
icmpv6_hdr::icmp6_code
unsigned char icmp6_code
Definition iphdr.h:71
icmpv6_echo_request
Definition iphdr.h:77
icmpv6_echo_request::icmp6_echo_id
unsigned short icmp6_echo_id
Definition iphdr.h:78
icmpv6_echo_request::icmp6_echo_sequence
unsigned short icmp6_echo_sequence
Definition iphdr.h:79
udp_hdr
Definition iphdr.h:84
udp_hdr::udp_checksum
unsigned short udp_checksum
Definition iphdr.h:88
udp_hdr::src_portno
unsigned short src_portno
Definition iphdr.h:85
udp_hdr::dst_portno
unsigned short dst_portno
Definition iphdr.h:86
udp_hdr::udp_length
unsigned short udp_length
Definition iphdr.h:87