Lines Matching +full:- +full:- +full:without +full:- +full:host +full:- +full:scanner

5  * Redistribution and use in source and binary forms, with or without
15 * or promote products derived from this software without specific prior
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21 * Name to id translation routines used by the scanner.
42 * https://msdn.microsoft.com/en-us/library/windows/desktop/ms738520(v=vs.85).aspx
136 #include "pcap-int.h"
143 #include "os-proto.h"
152 * Convert host name to internet address.
154 * XXX - not thread-safe; don't use it inside libpcap.
167 hlist[0] = (bpf_u_int32 *)hp->h_addr; in pcap_nametoaddr()
168 NTOHL(hp->h_addr); in pcap_nametoaddr()
171 for (p = (bpf_u_int32 **)hp->h_addr_list; *p; ++p) in pcap_nametoaddr()
173 return (bpf_u_int32 **)hp->h_addr_list; in pcap_nametoaddr()
200 * XXX - not guaranteed to be thread-safe! See below for platforms
201 * on which it is thread-safe and on which it isn't.
210 * XXX - I guess we could use the BSD code to read in pcap_nametonetaddr()
238 * XXX - dynamically allocate the buffer, and make it in pcap_nametonetaddr()
258 if (getnetbyname_r(name, &result_buf, &net_data) == -1) in pcap_nametonetaddr()
265 * getnetbyname() that uses thread-specific data, in which in pcap_nametonetaddr()
266 * case we're thread-safe (sufficiently recent FreeBSD, in pcap_nametonetaddr()
267 * sufficiently recent Darwin-based OS, sufficiently recent in pcap_nametonetaddr()
268 * HP-UX, sufficiently recent Tru64 UNIX), or we have the in pcap_nametonetaddr()
271 * thread-safe. in pcap_nametonetaddr()
276 return np->n_net; in pcap_nametonetaddr()
296 int tcp_port = -1; in pcap_nametoport()
297 int udp_port = -1; in pcap_nametoport()
314 * XXX - this doesn't return an error string. in pcap_nametoport()
322 for (ai = res; ai != NULL; ai = ai->ai_next) { in pcap_nametoport()
326 if (ai->ai_addr != NULL) { in pcap_nametoport()
330 if (ai->ai_addr->sa_family == AF_INET) { in pcap_nametoport()
331 in4 = (struct sockaddr_in *)ai->ai_addr; in pcap_nametoport()
332 tcp_port = ntohs(in4->sin_port); in pcap_nametoport()
336 if (ai->ai_addr->sa_family == AF_INET6) { in pcap_nametoport()
337 in6 = (struct sockaddr_in6 *)ai->ai_addr; in pcap_nametoport()
338 tcp_port = ntohs(in6->sin6_port); in pcap_nametoport()
358 * XXX - this doesn't return an error string. in pcap_nametoport()
366 for (ai = res; ai != NULL; ai = ai->ai_next) { in pcap_nametoport()
370 if (ai->ai_addr != NULL) { in pcap_nametoport()
374 if (ai->ai_addr->sa_family == AF_INET) { in pcap_nametoport()
375 in4 = (struct sockaddr_in *)ai->ai_addr; in pcap_nametoport()
376 udp_port = ntohs(in4->sin_port); in pcap_nametoport()
380 if (ai->ai_addr->sa_family == AF_INET6) { in pcap_nametoport()
381 in6 = (struct sockaddr_in6 *)ai->ai_addr; in pcap_nametoport()
382 udp_port = ntohs(in6->sin6_port); in pcap_nametoport()
430 * Convert a string in the form PPP-PPP, where correspond to ports, to
441 if (sscanf(name, "%d-%d", &p1, &p2) != 2) { in pcap_nametoportrange()
445 if ((off = strchr(cpy, '-')) == NULL) { in pcap_nametoportrange()
476 * XXX - not guaranteed to be thread-safe! See below for platforms
477 * on which it is thread-safe and on which it isn't.
494 * XXX - dynamically allocate the buffer, and make it in pcap_nametoproto()
514 if (getprotobyname_r(str, &result_buf, &proto_data) == -1) in pcap_nametoproto()
521 * getprotobyname() that uses thread-specific data, in which in pcap_nametoproto()
522 * case we're thread-safe (sufficiently recent FreeBSD, in pcap_nametoproto()
523 * sufficiently recent Darwin-based OS, sufficiently recent in pcap_nametoproto()
524 * HP-UX, sufficiently recent Tru64 UNIX, Windows), or we have in pcap_nametoproto()
527 * thread-safe. in pcap_nametoproto()
532 return p->p_proto; in pcap_nametoproto()
587 while (p->s != 0) { in pcap_nametoeproto()
588 if (strcmp(p->s, s) == 0) in pcap_nametoeproto()
589 return p->p; in pcap_nametoeproto()
611 while (p->s != 0) { in pcap_nametollc()
612 if (strcmp(p->s, s) == 0) in pcap_nametollc()
613 return p->p; in pcap_nametollc()
619 /* Hex digit to 8-bit unsigned integer. */
624 return (u_char)(c - '0'); in xdtoi()
626 return (u_char)(c - 'a' + 10); in xdtoi()
628 return (u_char)(c - 'A' + 10); in xdtoi()
642 n = n * 10 + *s++ - '0'; in __pcap_atoin()
676 * "xx-xx-xx-xx-xx-xx"
680 * (or various mixes of ':', '.', and '-') into a new
694 if (*s == ':' || *s == '.' || *s == '-') in pcap_ether_aton()
710 * XXX - not thread-safe, because pcap_next_etherent() isn't thread-
711 * safe! Needs a mutex or a thread-safe pcap_next_etherent().
732 if (strcmp(ep->name, name) == 0) { in pcap_ether_hostton()
735 memcpy(ap, ep->addr, 6); in pcap_ether_hostton()
745 * Use the OS-supplied routine.
746 * This *should* be thread-safe; the API doesn't have a static buffer.
765 * XXX - not guaranteed to be thread-safe!
778 memcpy((char *)res, (char *)nep->n_addr, sizeof(unsigned short));