reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ResipHep.hxx
Go to the documentation of this file.
1#if !defined(RESIP_HEP_HXX)
2#define RESIP_HEP_HXX
3
4#if defined(_WIN32)
5#include "rutil/msvc/stdint.h"
6typedef uint8_t u_int8_t;
7typedef uint16_t u_int16_t;
8typedef uint32_t u_int32_t;
9#include <winsock2.h>
10#include <WS2tcpip.h>
11#else
12#include <netinet/in.h>
13#ifdef USE_IPV6
14#include <netinet/ip6.h>
15#endif /* USE_IPV6 */
16#endif
17
18#include "rutil/compat.hxx"
19
20#ifdef _MSC_VER
21#define PACKED_STRUCT( __StructDeclaration__ ) __pragma( pack(push, 1) ) __StructDeclaration__ __pragma( pack(pop) )
22#elif defined(__GNUC__)
23#define PACKED_STRUCT( __StructDeclaration__ ) __StructDeclaration__ __attribute__((__packed__))
24#else
25#define PACKED_STRUCT( __StructDeclaration__ ) __StructDeclaration__
26#endif
27
28/* HEPv3 types */
29
33 u_int16_t length;
34});
35
36typedef struct hep_chunk hep_chunk_t;
37
40 u_int8_t data;
41});
42
44
47 u_int16_t data;
48});
49
51
54 u_int32_t data;
55});
56
58
61 char *data;
62});
63
65
68 struct in_addr data;
69});
70
72
73#ifdef USE_IPV6
76 struct in6_addr data;
77});
78
80#endif // USE_IPV6
81
83 char id[4];
84 u_int16_t length;
85});
86
87typedef struct hep_ctrl hep_ctrl_t;
88
91 char *data;
92});
93
95
96/* Structure of HEP */
97
99 hep_ctrl_t header;
108});
109
111
112/* Ethernet / IP / UDP header IPv4 */
113const int udp_payload_offset = 14 + 20 + 8;
114
115struct hep_hdr {
116 u_int8_t hp_v; /* version */
117 u_int8_t hp_l; /* length */
118 u_int8_t hp_f; /* family */
119 u_int8_t hp_p; /* protocol */
120 u_int16_t hp_sport; /* source port */
121 u_int16_t hp_dport; /* destination port */
122};
123
125 u_int32_t tv_sec; /* seconds */
126 u_int32_t tv_usec; /* useconds */
127 u_int16_t captid; /* Capture ID node */
128};
129
130struct hep_iphdr {
132 struct in_addr hp_dst; /* source and dest address */
133};
134
135#ifdef USE_IPV6
137 struct in6_addr hp6_src; /* source address */
138 struct in6_addr hp6_dst; /* destination address */
139};
140#endif // USE_IPV6
141
143
144#endif // RESIP_HEP_HXX
145
146/* ====================================================================
147*
148* Copyright(c) 2010 - 2016 <Alexandr Dubovikov>
149*
150* All rights reserved.
151*
152* Redistribution and use in source and binary forms are permitted
153* provided that the above copyright notice and this paragraph are
154* duplicated in all such forms and that any documentation,
155* advertising materials, and other materials related to such
156* distribution and use acknowledge that the software was developed
157* by the <SIPCAPTURE>.The name of the SIPCAPTURE may not be used to
158* endorse or promote products derived from this software without specific
159* prior written permission.
160*
161* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
162* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
163* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
164*
165* ====================================================================
166*
167* Contributor(s):
168*
169* Dario Bozzali - IFM Infomaster
170*
171*/
const int udp_payload_offset
Definition ResipHep.hxx:113
struct hep_chunk hep_chunk_t
Definition ResipHep.hxx:36
struct hep_chunk_str hep_chunk_str_t
Definition ResipHep.hxx:64
struct hep_chunk_payload hep_chunk_payload_t
Definition ResipHep.hxx:94
struct hep_chunk_ip6 hep_chunk_ip6_t
Definition ResipHep.hxx:79
#define PACKED_STRUCT(__StructDeclaration__)
Definition ResipHep.hxx:25
struct hep_chunk_uint8 hep_chunk_uint8_t
Definition ResipHep.hxx:43
struct hep_generic hep_generic_t
Definition ResipHep.hxx:110
struct hep_chunk_uint16 hep_chunk_uint16_t
Definition ResipHep.hxx:50
struct hep_chunk_ip4 hep_chunk_ip4_t
Definition ResipHep.hxx:71
uint64_t hepUnixTimestamp()
Definition ResipHep.cxx:18
struct hep_ctrl hep_ctrl_t
Definition ResipHep.hxx:87
struct hep_chunk_uint32 hep_chunk_uint32_t
Definition ResipHep.hxx:57
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
unsigned short uint16_t
Definition stdint.h:84
unsigned int uint32_t
Definition stdint.h:85
unsigned char uint8_t
Definition stdint.h:83
unsigned __int64 uint64_t
Definition stdint.h:95
u_int16_t hp_sport
Definition ResipHep.hxx:120
u_int16_t hp_dport
Definition ResipHep.hxx:121
u_int8_t hp_v
Definition ResipHep.hxx:116
u_int8_t hp_f
Definition ResipHep.hxx:118
u_int8_t hp_p
Definition ResipHep.hxx:119
u_int8_t hp_l
Definition ResipHep.hxx:117
struct in6_addr hp6_src
Definition ResipHep.hxx:137
struct in6_addr hp6_dst
Definition ResipHep.hxx:138
struct in_addr hp_dst
Definition ResipHep.hxx:132
struct in_addr hp_src
Definition ResipHep.hxx:131
u_int16_t captid
Definition ResipHep.hxx:127
u_int32_t tv_usec
Definition ResipHep.hxx:126
u_int32_t tv_sec
Definition ResipHep.hxx:125
void list()
Definition userAdmin.cxx:66