Lines Matching +full:vs +full:- +full:p +full:- +full:supply

40      *    https://msdn.microsoft.com/en-us/library/windows/desktop/ms738520(v=vs.85).aspx
133 #include "pcap-int.h"
135 #include "diag-control.h"
141 #include "thread-local.h"
144 #include "os-proto.h"
155 * XXX - not thread-safe; don't use it inside libpcap.
163 bpf_u_int32 **p; in pcap_nametoaddr() local
168 * it's not thread-safe, or because it doesn't support IPv6, in pcap_nametoaddr()
172 * it's not thread-safe; we supply it for backwards compatibility, in pcap_nametoaddr()
176 * this thread-safe - we can't change the API to require that in pcap_nametoaddr()
184 hlist[0] = (bpf_u_int32 *)hp->h_addr; in pcap_nametoaddr()
185 NTOHL(hp->h_addr); in pcap_nametoaddr()
188 for (p = (bpf_u_int32 **)hp->h_addr_list; *p; ++p) in pcap_nametoaddr()
189 NTOHL(**p); in pcap_nametoaddr()
190 return (bpf_u_int32 **)hp->h_addr_list; in pcap_nametoaddr()
217 * XXX - not guaranteed to be thread-safe! See below for platforms
218 * on which it is thread-safe and on which it isn't.
227 * XXX - I guess we could use the BSD code to read in pcap_nametonetaddr()
258 * http://man7.org/linux/man-pages/man3/getnetbyname_r.3.html in pcap_nametonetaddr()
274 * XXX - dynamically allocate the buffer, and make it in pcap_nametonetaddr()
294 if (getnetbyname_r(name, &result_buf, &net_data) == -1) in pcap_nametonetaddr()
301 * getnetbyname() that uses thread-specific data, in which in pcap_nametonetaddr()
302 * case we're thread-safe (sufficiently recent FreeBSD, in pcap_nametonetaddr()
303 * sufficiently recent Darwin-based OS, sufficiently recent in pcap_nametonetaddr()
304 * HP-UX, sufficiently recent Tru64 UNIX), or we have the in pcap_nametonetaddr()
307 * thread-safe. in pcap_nametonetaddr()
312 return np->n_net; in pcap_nametonetaddr()
332 int tcp_port = -1; in pcap_nametoport()
333 int udp_port = -1; in pcap_nametoport()
350 * XXX - this doesn't return an error string. in pcap_nametoport()
358 for (ai = res; ai != NULL; ai = ai->ai_next) { in pcap_nametoport()
362 if (ai->ai_addr != NULL) { in pcap_nametoport()
366 if (ai->ai_addr->sa_family == AF_INET) { in pcap_nametoport()
367 in4 = (struct sockaddr_in *)ai->ai_addr; in pcap_nametoport()
368 tcp_port = ntohs(in4->sin_port); in pcap_nametoport()
372 if (ai->ai_addr->sa_family == AF_INET6) { in pcap_nametoport()
373 in6 = (struct sockaddr_in6 *)ai->ai_addr; in pcap_nametoport()
374 tcp_port = ntohs(in6->sin6_port); in pcap_nametoport()
394 * XXX - this doesn't return an error string. in pcap_nametoport()
402 for (ai = res; ai != NULL; ai = ai->ai_next) { in pcap_nametoport()
406 if (ai->ai_addr != NULL) { in pcap_nametoport()
410 if (ai->ai_addr->sa_family == AF_INET) { in pcap_nametoport()
411 in4 = (struct sockaddr_in *)ai->ai_addr; in pcap_nametoport()
412 udp_port = ntohs(in4->sin_port); in pcap_nametoport()
416 if (ai->ai_addr->sa_family == AF_INET6) { in pcap_nametoport()
417 in6 = (struct sockaddr_in6 *)ai->ai_addr; in pcap_nametoport()
418 udp_port = ntohs(in6->sin6_port); in pcap_nametoport()
466 * Convert a string in the form PPP-PPP, where correspond to ports, to
479 if ((off = strchr(cpy, '-')) == NULL) { in pcap_nametoportrange()
505 * XXX - not guaranteed to be thread-safe! See below for platforms
506 * on which it is thread-safe and on which it isn't.
511 struct protoent *p; in pcap_nametoproto() local
520 err = getprotobyname_r(str, &result_buf, buf, sizeof buf, &p); in pcap_nametoproto()
523 * XXX - dynamically allocate the buffer, and make it in pcap_nametoproto()
535 p = getprotobyname_r(str, &result_buf, buf, (int)sizeof buf); in pcap_nametoproto()
543 if (getprotobyname_r(str, &result_buf, &proto_data) == -1) in pcap_nametoproto()
544 p = NULL; in pcap_nametoproto()
546 p = &result_buf; in pcap_nametoproto()
550 * getprotobyname() that uses thread-specific data, in which in pcap_nametoproto()
551 * case we're thread-safe (sufficiently recent FreeBSD, in pcap_nametoproto()
552 * sufficiently recent Darwin-based OS, sufficiently recent in pcap_nametoproto()
553 * HP-UX, sufficiently recent Tru64 UNIX, Windows), or we have in pcap_nametoproto()
556 * thread-safe. in pcap_nametoproto()
558 p = getprotobyname(str); in pcap_nametoproto()
560 if (p != 0) in pcap_nametoproto()
561 return p->p_proto; in pcap_nametoproto()
570 u_short p; member
606 struct eproto *p = eproto_db; in pcap_nametoeproto() local
608 while (p->s != 0) { in pcap_nametoeproto()
609 if (strcmp(p->s, s) == 0) in pcap_nametoeproto()
610 return p->p; in pcap_nametoeproto()
611 p += 1; in pcap_nametoeproto()
630 struct eproto *p = llc_db; in pcap_nametollc() local
632 while (p->s != 0) { in pcap_nametollc()
633 if (strcmp(p->s, s) == 0) in pcap_nametollc()
634 return p->p; in pcap_nametollc()
635 p += 1; in pcap_nametollc()
640 /* Hex digit to 8-bit unsigned integer. */
645 return (u_char)(c - '0'); in xdtoi()
647 return (u_char)(c - 'a' + 10); in xdtoi()
649 return (u_char)(c - 'A' + 10); in xdtoi()
665 return -1; in __pcap_atoin()
667 n = n * 10 + *s++ - '0'; in __pcap_atoin()
670 return -1; in __pcap_atoin()
704 * "xx-xx-xx-xx-xx-xx"
708 * (or various mixes of ':', '.', and '-') into a new
722 if (*s == ':' || *s == '.' || *s == '-') in pcap_ether_aton()
739 * This should be thread-safe, as we define the static variables
740 * we use to be thread-local, and as pcap_next_etherent() does so
762 if (strcmp(ep->name, name) == 0) { in pcap_ether_hostton()
765 memcpy(ap, ep->addr, 6); in pcap_ether_hostton()
775 * Use the OS-supplied routine.
776 * This *should* be thread-safe; the API doesn't have a static buffer.
800 * XXX - not guaranteed to be thread-safe!
813 memcpy((char *)res, (char *)nep->n_addr, sizeof(unsigned short));