Skip to content

Commit 0eead15

Browse files
committed
Commented all the code that called wsockinit(), getservent(), endservent() because those functions are not in the latest libpcap API.
1 parent c555469 commit 0eead15

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

Tcpdump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ main(int argc, char **argv)
491491

492492
#ifdef WIN32
493493
u_int UserBufferSize = 1000000;
494-
if(wsockinit() != 0) return 1;
494+
// if(wsockinit() != 0) return 1;
495495
#endif /* WIN32 */
496496

497497
gndo->ndo_Oflag=1;

addrtoname.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -684,36 +684,36 @@ ipxsap_string(u_short port)
684684
return (tp->name);
685685
}
686686

687-
static void
688-
init_servarray(void)
689-
{
690-
struct servent *sv;
691-
register struct hnamemem *table;
692-
register int i;
693-
char buf[sizeof("0000000000")];
694-
695-
while ((sv = getservent()) != NULL) {
696-
int port = ntohs(sv->s_port);
697-
i = port & (HASHNAMESIZE-1);
698-
if (strcmp(sv->s_proto, "tcp") == 0)
699-
table = &tporttable[i];
700-
else if (strcmp(sv->s_proto, "udp") == 0)
701-
table = &uporttable[i];
702-
else
703-
continue;
704-
705-
while (table->name)
706-
table = table->nxt;
707-
if (nflag) {
708-
(void)snprintf(buf, sizeof(buf), "%d", port);
709-
table->name = strdup(buf);
710-
} else
711-
table->name = strdup(sv->s_name);
712-
table->addr = port;
713-
table->nxt = newhnamemem();
714-
}
715-
endservent();
716-
}
687+
// static void
688+
// init_servarray(void)
689+
// {
690+
// struct servent *sv;
691+
// register struct hnamemem *table;
692+
// register int i;
693+
// char buf[sizeof("0000000000")];
694+
//
695+
// while ((sv = getservent()) != NULL) {
696+
// int port = ntohs(sv->s_port);
697+
// i = port & (HASHNAMESIZE-1);
698+
// if (strcmp(sv->s_proto, "tcp") == 0)
699+
// table = &tporttable[i];
700+
// else if (strcmp(sv->s_proto, "udp") == 0)
701+
// table = &uporttable[i];
702+
// else
703+
// continue;
704+
//
705+
// while (table->name)
706+
// table = table->nxt;
707+
// if (nflag) {
708+
// (void)snprintf(buf, sizeof(buf), "%d", port);
709+
// table->name = strdup(buf);
710+
// } else
711+
// table->name = strdup(sv->s_name);
712+
// table->addr = port;
713+
// table->nxt = newhnamemem();
714+
// }
715+
// endservent();
716+
// }
717717

718718
/* in libpcap.a (nametoaddr.c) */
719719
// #if defined(WIN32) && !defined(USE_STATIC_LIBPCAP)
@@ -1111,7 +1111,7 @@ init_addrtoname(u_int32_t localnet, u_int32_t mask)
11111111
return;
11121112

11131113
init_etherarray();
1114-
init_servarray();
1114+
//init_servarray();
11151115
//init_eprotoarray();
11161116
//init_protoidarray();
11171117
init_ipxsaparray();

0 commit comments

Comments
 (0)