Skip to content

Commit a47b71e

Browse files
committed
netbuf_* and friends should be static
1 parent db90856 commit a47b71e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/sock.c

+13-13
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ struct dnsquery_resourcerecord
249249
};
250250

251251

252-
void netbuf_add_32bitnum(unsigned char *buf, int buflen, int *offset, unsigned int num)
252+
static void netbuf_add_32bitnum(unsigned char *buf, int buflen, int *offset, unsigned int num)
253253
{
254254
unsigned char *start = buf + *offset;
255255
unsigned char *p = start;
@@ -263,7 +263,7 @@ void netbuf_add_32bitnum(unsigned char *buf, int buflen, int *offset, unsigned i
263263
*offset += 4;
264264
}
265265

266-
void netbuf_get_32bitnum(unsigned char *buf, int buflen, int *offset, unsigned int *num)
266+
static void netbuf_get_32bitnum(unsigned char *buf, int buflen, int *offset, unsigned int *num)
267267
{
268268
unsigned char *start = buf + *offset;
269269
unsigned char *p = start;
@@ -278,7 +278,7 @@ void netbuf_get_32bitnum(unsigned char *buf, int buflen, int *offset, unsigned i
278278
*offset += 4;
279279
}
280280

281-
void netbuf_add_16bitnum(unsigned char *buf, int buflen, int *offset, unsigned short num)
281+
static void netbuf_add_16bitnum(unsigned char *buf, int buflen, int *offset, unsigned short num)
282282
{
283283
unsigned char *start = buf + *offset;
284284
unsigned char *p = start;
@@ -290,7 +290,7 @@ void netbuf_add_16bitnum(unsigned char *buf, int buflen, int *offset, unsigned s
290290
*offset += 2;
291291
}
292292

293-
void netbuf_get_16bitnum(unsigned char *buf, int buflen, int *offset, unsigned short *num)
293+
static void netbuf_get_16bitnum(unsigned char *buf, int buflen, int *offset, unsigned short *num)
294294
{
295295
unsigned char *start = buf + *offset;
296296
unsigned char *p = start;
@@ -303,7 +303,7 @@ void netbuf_get_16bitnum(unsigned char *buf, int buflen, int *offset, unsigned s
303303
*offset += 2;
304304
}
305305

306-
void netbuf_add_domain_name(unsigned char *buf, int buflen, int *offset,
306+
static void netbuf_add_domain_name(unsigned char *buf, int buflen, int *offset,
307307
char *name)
308308
{
309309
unsigned char *start = buf + *offset;
@@ -346,7 +346,7 @@ void netbuf_add_domain_name(unsigned char *buf, int buflen, int *offset,
346346
*offset += p - start;
347347
}
348348

349-
int calc_domain_name_size(unsigned char *buf, int buflen, int offset)
349+
static int calc_domain_name_size(unsigned char *buf, int buflen, int offset)
350350
{
351351
unsigned char *p = buf + offset;
352352
int len = 0;
@@ -375,7 +375,7 @@ int calc_domain_name_size(unsigned char *buf, int buflen, int offset)
375375
return len;
376376
}
377377

378-
int netbuf_get_domain_name(unsigned char *buf, int buflen, int *offset, char *namebuf, int namebuflen)
378+
static int netbuf_get_domain_name(unsigned char *buf, int buflen, int *offset, char *namebuf, int namebuflen)
379379
{
380380
unsigned char *start = buf + *offset;
381381
unsigned char *p, *p2;
@@ -457,7 +457,7 @@ int netbuf_get_domain_name(unsigned char *buf, int buflen, int *offset, char *na
457457
return 0;
458458
}
459459

460-
void netbuf_add_dnsquery_header(unsigned char *buf, int buflen, int *offset, struct dnsquery_header *header)
460+
static void netbuf_add_dnsquery_header(unsigned char *buf, int buflen, int *offset, struct dnsquery_header *header)
461461
{
462462
unsigned char *p;
463463

@@ -480,7 +480,7 @@ void netbuf_add_dnsquery_header(unsigned char *buf, int buflen, int *offset, str
480480
netbuf_add_16bitnum(buf, buflen, offset, header->arcount);
481481
}
482482

483-
void netbuf_get_dnsquery_header(unsigned char *buf, int buflen, int *offset, struct dnsquery_header *header)
483+
static void netbuf_get_dnsquery_header(unsigned char *buf, int buflen, int *offset, struct dnsquery_header *header)
484484
{
485485
unsigned char *p;
486486

@@ -505,29 +505,29 @@ void netbuf_get_dnsquery_header(unsigned char *buf, int buflen, int *offset, str
505505
netbuf_get_16bitnum(buf, buflen, offset, &(header->arcount));
506506
}
507507

508-
void netbuf_add_dnsquery_question(unsigned char *buf, int buflen, int *offset, struct dnsquery_question *question)
508+
static void netbuf_add_dnsquery_question(unsigned char *buf, int buflen, int *offset, struct dnsquery_question *question)
509509
{
510510
netbuf_add_domain_name(buf, buflen, offset, question->qname);
511511
netbuf_add_16bitnum(buf, buflen, offset, question->qtype);
512512
netbuf_add_16bitnum(buf, buflen, offset, question->qclass);
513513
}
514514

515-
void netbuf_get_dnsquery_question(unsigned char *buf, int buflen, int *offset, struct dnsquery_question *question)
515+
static void netbuf_get_dnsquery_question(unsigned char *buf, int buflen, int *offset, struct dnsquery_question *question)
516516
{
517517
netbuf_get_domain_name(buf, buflen, offset, question->qname, 1024);
518518
netbuf_get_16bitnum(buf, buflen, offset, &(question->qtype));
519519
netbuf_get_16bitnum(buf, buflen, offset, &(question->qclass));
520520
}
521521

522-
void netbuf_get_dnsquery_srvrdata(unsigned char *buf, int buflen, int *offset, struct dnsquery_srvrdata *srvrdata)
522+
static void netbuf_get_dnsquery_srvrdata(unsigned char *buf, int buflen, int *offset, struct dnsquery_srvrdata *srvrdata)
523523
{
524524
netbuf_get_16bitnum(buf, buflen, offset, &(srvrdata->priority));
525525
netbuf_get_16bitnum(buf, buflen, offset, &(srvrdata->weight));
526526
netbuf_get_16bitnum(buf, buflen, offset, &(srvrdata->port));
527527
netbuf_get_domain_name(buf, buflen, offset, srvrdata->target, 1024);
528528
}
529529

530-
void netbuf_get_dnsquery_resourcerecord(unsigned char *buf, int buflen, int *offset, struct dnsquery_resourcerecord *rr)
530+
static void netbuf_get_dnsquery_resourcerecord(unsigned char *buf, int buflen, int *offset, struct dnsquery_resourcerecord *rr)
531531
{
532532
netbuf_get_domain_name(buf, buflen, offset, rr->name, 1024);
533533
netbuf_get_16bitnum(buf, buflen, offset, &(rr->type));

0 commit comments

Comments
 (0)