1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
diff --git a/apps/gateway/mISDNChannel.cpp b/apps/gateway/mISDNChannel.cpp
index 8abd77a..36e8778 100644
--- a/apps/gateway/mISDNChannel.cpp
+++ b/apps/gateway/mISDNChannel.cpp
@@ -118,8 +118,8 @@ int mISDN_get_free_ext_ie(mISDN::Q931_info_t *qi) {
return (-1);
}
-int mISDN_AddIE(mISDN::Q931_info_t *qi, u_char *p, u_char ie, u_char *iep) {
- u_char *ps;
+int mISDN_AddIE(mISDN::Q931_info_t *qi, unsigned char *p, unsigned char ie, unsigned char *iep) {
+ unsigned char *ps;
mISDN::ie_info_t *ies;
int l;
@@ -158,7 +158,7 @@ int mISDN_AddIE(mISDN::Q931_info_t *qi, u_char *p, u_char ie, u_char *iep) {
}
l = iep[0] + 1;
}
- ps = (u_char *) qi;
+ ps = (unsigned char *) qi;
ps += L3_EXTRA_SIZE;
ies->off = (u16)(p - ps);
*p++ = ie;
diff --git a/core/sip/parse_dns.cpp b/core/sip/parse_dns.cpp
index 2b62f3e..d24f537 100644
--- a/core/sip/parse_dns.cpp
+++ b/core/sip/parse_dns.cpp
@@ -6,10 +6,10 @@
#define SECTION_COUNTS_OFF 4
#define HEADER_OFFSET 12
-unsigned short dns_msg_count(u_char* begin, dns_section_type sect);
-int dns_skip_name(u_char** p, u_char* end);
-int dns_expand_name(u_char** ptr, u_char* begin, u_char* end,
- u_char* buf, unsigned int len);
+unsigned short dns_msg_count(unsigned char* begin, dns_section_type sect);
+int dns_skip_name(unsigned char** p, unsigned char* end);
+int dns_expand_name(unsigned char** ptr, unsigned char* begin, unsigned char* end,
+ unsigned char* buf, unsigned int len);
const char* dns_rr_type_str(dns_rr_type t)
@@ -27,11 +27,11 @@ const char* dns_rr_type_str(dns_rr_type t)
-int dns_msg_parse(u_char* msg, int len, dns_parse_fct fct, void* data)
+int dns_msg_parse(unsigned char* msg, int len, dns_parse_fct fct, void* data)
{
- u_char* begin = msg;
- u_char* p = begin + HEADER_OFFSET;
- u_char* end = msg + len;
+ unsigned char* begin = msg;
+ unsigned char* p = begin + HEADER_OFFSET;
+ unsigned char* end = msg + len;
if(p >= end) return -1;
@@ -48,7 +48,7 @@ int dns_msg_parse(u_char* msg, int len, dns_parse_fct fct, void* data)
for(int i=0; i<dns_msg_count(begin,(dns_section_type)s); i++){
// expand name
- if(dns_expand_name(&p,begin,end,(u_char*)rr.name,NS_MAXDNAME) < 0) return -1;
+ if(dns_expand_name(&p,begin,end,(unsigned char*)rr.name,NS_MAXDNAME) < 0) return -1;
// at least 8 bytes for type+class+ttl left?
if((p + 8) > end) return -1;
@@ -79,14 +79,14 @@ int dns_msg_parse(u_char* msg, int len, dns_parse_fct fct, void* data)
return 0;
}
-unsigned short dns_msg_count(u_char* begin, dns_section_type sect)
+unsigned short dns_msg_count(unsigned char* begin, dns_section_type sect)
{
- u_char* p = begin + SECTION_COUNTS_OFF + 2*sect;
+ unsigned char* p = begin + SECTION_COUNTS_OFF + 2*sect;
return ((u_short)*p)<<8 | ((u_short)*(p+1));
}
-int dns_skip_name(u_char** p, u_char* end)
+int dns_skip_name(unsigned char** p, unsigned char* end)
{
while(*p < end) {
@@ -106,11 +106,11 @@ int dns_skip_name(u_char** p, u_char* end)
return -1;
}
-int dns_expand_name(u_char** ptr, u_char* begin, u_char* end,
- u_char* start_buf, unsigned int len)
+int dns_expand_name(unsigned char** ptr, unsigned char* begin, unsigned char* end,
+ unsigned char* start_buf, unsigned int len)
{
- u_char* buf = start_buf;
- u_char* p = *ptr;
+ unsigned char* buf = start_buf;
+ unsigned char* p = *ptr;
bool is_ptr=false;
while(p < end) {
diff --git a/core/sip/parse_dns.h b/core/sip/parse_dns.h
index c5de8b6..34406b0 100644
--- a/core/sip/parse_dns.h
+++ b/core/sip/parse_dns.h
@@ -39,18 +39,18 @@ struct dns_record
class dns_entry;
-typedef int (*dns_parse_fct)(dns_record* rr, dns_section_type t, u_char* begin, u_char* end, void* data);
+typedef int (*dns_parse_fct)(dns_record* rr, dns_section_type t, unsigned char* begin, unsigned char* end, void* data);
-int dns_msg_parse(u_char* msg, int len, dns_parse_fct fct, void* data);
-int dns_expand_name(u_char** ptr, u_char* begin, u_char* end,
- u_char* buf, unsigned int len);
+int dns_msg_parse(unsigned char* msg, int len, dns_parse_fct fct, void* data);
+int dns_expand_name(unsigned char** ptr, unsigned char* begin, unsigned char* end,
+ unsigned char* buf, unsigned int len);
-inline uint16_t dns_get_16(const u_char* p)
+inline uint16_t dns_get_16(const unsigned char* p)
{
return ntohs(*(uint16_t*)p);
}
-inline uint32_t dns_get_32(const u_char* p)
+inline uint32_t dns_get_32(const unsigned char* p)
{
return ntohl(*(uint32_t*)p);
}
diff --git a/core/sip/resolver.cpp b/core/sip/resolver.cpp
index 9793069..80c547c 100644
--- a/core/sip/resolver.cpp
+++ b/core/sip/resolver.cpp
@@ -169,7 +169,7 @@ public:
stable_sort(ip_vec.begin(),ip_vec.end(),srv_less);
}
- dns_base_entry* get_rr(dns_record* rr, u_char* begin, u_char* end);
+ dns_base_entry* get_rr(dns_record* rr, unsigned char* begin, unsigned char* end);
int next_ip(dns_handle* h, sockaddr_storage* sa)
{
@@ -316,7 +316,7 @@ dns_entry* dns_entry::make_entry(dns_rr_type t)
}
}
-void dns_entry::add_rr(dns_record* rr, u_char* begin, u_char* end, long now)
+void dns_entry::add_rr(dns_record* rr, unsigned char* begin, unsigned char* end, long now)
{
dns_base_entry* e = get_rr(rr,begin,end);
if(!e) return;
@@ -451,7 +451,7 @@ void ip_entry::to_sa(sockaddr_storage* sa)
string ip_entry::to_str()
{
if(type == IPv4) {
- u_char* cp = (u_char*)&addr;
+ unsigned char* cp = (unsigned char*)&addr;
return int2str(cp[0]) +
"." + int2str(cp[1]) +
"." + int2str(cp[2]) +
@@ -496,7 +496,7 @@ string ip_port_entry::to_str()
return ip_entry::to_str() + ":" + int2str(port);
}
-dns_base_entry* dns_ip_entry::get_rr(dns_record* rr, u_char* begin, u_char* end)
+dns_base_entry* dns_ip_entry::get_rr(dns_record* rr, unsigned char* begin, unsigned char* end)
{
if(rr->type != dns_r_a)
return NULL;
@@ -516,16 +516,16 @@ dns_base_entry* dns_ip_entry::get_rr(dns_record* rr, u_char* begin, u_char* end)
return new_ip;
}
-dns_base_entry* dns_srv_entry::get_rr(dns_record* rr, u_char* begin, u_char* end)
+dns_base_entry* dns_srv_entry::get_rr(dns_record* rr, unsigned char* begin, unsigned char* end)
{
if(rr->type != dns_r_srv)
return NULL;
- u_char name_buf[NS_MAXDNAME];
- const u_char * rdata = ns_rr_rdata(*rr);
+ unsigned char name_buf[NS_MAXDNAME];
+ const unsigned char * rdata = ns_rr_rdata(*rr);
/* Expand the target's name */
- u_char* p = (u_char*)rdata+6;
+ unsigned char* p = (unsigned char*)rdata+6;
if (dns_expand_name(&p,begin,end,
name_buf, /* Result */
NS_MAXDNAME) /* Size of result buffer */
@@ -570,7 +570,7 @@ struct dns_search_h
};
int rr_to_dns_entry(dns_record* rr, dns_section_type t,
- u_char* begin, u_char* end, void* data)
+ unsigned char* begin, unsigned char* end, void* data)
{
// only answer and additional sections
if(t != dns_s_an && t != dns_s_ar)
@@ -668,7 +668,7 @@ void dns_naptr_entry::init()
stable_sort(ip_vec.begin(),ip_vec.end(),naptr_less);
}
-dns_base_entry* dns_naptr_entry::get_rr(dns_record* rr, u_char* begin, u_char* end)
+dns_base_entry* dns_naptr_entry::get_rr(dns_record* rr, unsigned char* begin, unsigned char* end)
{
enum NAPTR_FieldIndex {
NAPTR_Flags = 0,
@@ -681,7 +681,7 @@ dns_base_entry* dns_naptr_entry::get_rr(dns_record* rr, u_char* begin, u_char* e
if(rr->type != dns_r_naptr)
return NULL;
- const u_char * rdata = ns_rr_rdata(*rr);
+ const unsigned char * rdata = ns_rr_rdata(*rr);
unsigned short order = dns_get_16(rdata);
rdata += 2;
@@ -856,7 +856,7 @@ _resolver::~_resolver()
int _resolver::query_dns(const char* name, dns_entry_map& entry_map, dns_rr_type t)
{
- u_char dns_res[NS_PACKETSZ];
+ unsigned char dns_res[NS_PACKETSZ];
if(!name) return -1;
diff --git a/core/sip/resolver.h b/core/sip/resolver.h
index 7565898..caa81e8 100644
--- a/core/sip/resolver.h
+++ b/core/sip/resolver.h
@@ -77,7 +77,7 @@ class dns_entry
: public atomic_ref_cnt,
public dns_base_entry
{
- virtual dns_base_entry* get_rr(dns_record* rr, u_char* begin, u_char* end)=0;
+ virtual dns_base_entry* get_rr(dns_record* rr, unsigned char* begin, unsigned char* end)=0;
public:
vector<dns_base_entry*> ip_vec;
@@ -87,7 +87,7 @@ public:
dns_entry();
virtual ~dns_entry();
virtual void init()=0;
- virtual void add_rr(dns_record* rr, u_char* begin, u_char* end, long now);
+ virtual void add_rr(dns_record* rr, unsigned char* begin, unsigned char* end, long now);
virtual int next_ip(dns_handle* h, sockaddr_storage* sa)=0;
virtual string to_str();
@@ -140,7 +140,7 @@ public:
{}
void init(){};
- dns_base_entry* get_rr(dns_record* rr, u_char* begin, u_char* end);
+ dns_base_entry* get_rr(dns_record* rr, unsigned char* begin, unsigned char* end);
int next_ip(dns_handle* h, sockaddr_storage* sa);
int fill_ip_list(const list<sip_destination>& ip_list);
@@ -199,7 +199,7 @@ public:
{}
void init();
- dns_base_entry* get_rr(dns_record* rr, u_char* begin, u_char* end);
+ dns_base_entry* get_rr(dns_record* rr, unsigned char* begin, unsigned char* end);
// not needed
int next_ip(dns_handle* h, sockaddr_storage* sa) { return -1; }
diff --git a/core/sip/udp_trsp.cpp b/core/sip/udp_trsp.cpp
index eb3a1ce..e33a156 100644
--- a/core/sip/udp_trsp.cpp
+++ b/core/sip/udp_trsp.cpp
@@ -300,7 +300,7 @@ void udp_trsp::run()
msg.msg_namelen = sizeof(sockaddr_storage);
msg.msg_iov = iov;
msg.msg_iovlen = 1;
- msg.msg_control = new u_char[DSTADDR_DATASIZE];
+ msg.msg_control = new unsigned char[DSTADDR_DATASIZE];
msg.msg_controllen = DSTADDR_DATASIZE;
if(sock->get_sd()<=0){
|