WINSOCK_MINOR_VERSION), &wsaData) != 0)
{
if (errbuf)
- pcap_snprintf(errbuf, errbuflen, "Failed to initialize Winsock\n");
+ snprintf(errbuf, errbuflen, "Failed to initialize Winsock\n");
WSACleanup();
(char *)&on, sizeof (int)) == -1)
{
if (errbuf)
- pcap_snprintf(errbuf, errbuflen, "setsockopt(IPV6_V6ONLY)");
+ snprintf(errbuf, errbuflen, "setsockopt(IPV6_V6ONLY)");
closesocket(sock);
return INVALID_SOCKET;
}
/* Returns the numeric address of the host that triggered the error */
sock_getascii_addrport((struct sockaddr_storage *) tempaddrinfo->ai_addr, TmpBuffer, sizeof(TmpBuffer), NULL, 0, NI_NUMERICHOST, TmpBuffer, sizeof(TmpBuffer));
- pcap_snprintf(errbufptr, bufspaceleft,
+ snprintf(errbufptr, bufspaceleft,
"Is the server properly installed on %s? %s", TmpBuffer, SocketErrorMessage);
/* In case more then one 'connect' fails, we manage to keep all the error messages */
char hostport[PCAP_ERRBUF_SIZE];
if (hostname != NULL && portname != NULL)
- pcap_snprintf(hostport, PCAP_ERRBUF_SIZE, "%s:%s",
+ snprintf(hostport, PCAP_ERRBUF_SIZE, "%s:%s",
hostname, portname);
else if (hostname != NULL)
- pcap_snprintf(hostport, PCAP_ERRBUF_SIZE, "%s",
+ snprintf(hostport, PCAP_ERRBUF_SIZE, "%s",
hostname);
else if (portname != NULL)
- pcap_snprintf(hostport, PCAP_ERRBUF_SIZE, ":%s",
+ snprintf(hostport, PCAP_ERRBUF_SIZE, ":%s",
portname);
else
- pcap_snprintf(hostport, PCAP_ERRBUF_SIZE, "<no host or port!>");
+ snprintf(hostport, PCAP_ERRBUF_SIZE, "<no host or port!>");
switch (err)
{
#ifdef EAI_ADDRFAMILY
case EAI_ADDRFAMILY:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sAddress family for %s not supported",
prefix, hostport);
break;
#endif
case EAI_AGAIN:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%s%s could not be resolved at this time",
prefix, hostport);
break;
case EAI_BADFLAGS:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sThe ai_flags parameter for looking up %s had an invalid value",
prefix, hostport);
break;
case EAI_FAIL:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sA non-recoverable error occurred when attempting to resolve %s",
prefix, hostport);
break;
case EAI_FAMILY:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sThe address family for looking up %s was not recognized",
prefix, hostport);
break;
case EAI_MEMORY:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sOut of memory trying to allocate storage when looking up %s",
prefix, hostport);
break;
*/
#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME
case EAI_NODATA:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sNo address associated with %s",
prefix, hostport);
break;
#endif
case EAI_NONAME:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sThe host name %s couldn't be resolved",
prefix, hostport);
break;
case EAI_SERVICE:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sThe service value specified when looking up %s as not recognized for the socket type",
prefix, hostport);
break;
case EAI_SOCKTYPE:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sThe socket type specified when looking up %s as not recognized",
prefix, hostport);
break;
/*
* Assumed to be UN*X.
*/
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sAn error occurred when looking up %s: %s",
prefix, hostport, pcap_strerror(errno));
break;
#ifdef EAI_BADHINTS
case EAI_BADHINTS:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sInvalid value for hints when looking up %s",
prefix, hostport);
break;
#ifdef EAI_PROTOCOL
case EAI_PROTOCOL:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sResolved protocol when looking up %s is unknown",
prefix, hostport);
break;
#ifdef EAI_OVERFLOW
case EAI_OVERFLOW:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sArgument buffer overflow when looking up %s",
prefix, hostport);
break;
#endif
default:
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"%sgetaddrinfo() error %d when looking up %s",
prefix, err, hostport);
break;
((*addrinfo)->ai_family != PF_INET6))
{
if (errbuf)
- pcap_snprintf(errbuf, errbuflen, "getaddrinfo(): socket type not supported");
+ snprintf(errbuf, errbuflen, "getaddrinfo(): socket type not supported");
freeaddrinfo(*addrinfo);
*addrinfo = NULL;
return -1;
(sock_ismcastaddr((*addrinfo)->ai_addr) == 0))
{
if (errbuf)
- pcap_snprintf(errbuf, errbuflen, "getaddrinfo(): multicast addresses are not valid when using TCP streams");
+ snprintf(errbuf, errbuflen, "getaddrinfo(): multicast addresses are not valid when using TCP streams");
freeaddrinfo(*addrinfo);
*addrinfo = NULL;
return -1;
{
if (errbuf)
{
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"Can't send more than %u bytes with sock_send",
INT_MAX);
}
if ((*offset + size) > totsize)
{
if (errbuf)
- pcap_snprintf(errbuf, errbuflen, "Not enough space in the temporary send buffer.");
+ snprintf(errbuf, errbuflen, "Not enough space in the temporary send buffer.");
return -1;
}
{
if (errbuf)
{
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"Can't read more than %u bytes with sock_recv",
INT_MAX);
}
*/
if (errbuf)
{
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"The other host terminated the connection.");
}
return -1;
{
if (errbuf)
{
- pcap_snprintf(errbuf, errbuflen,
+ snprintf(errbuf, errbuflen,
"Can't read more than %u bytes with sock_recv_dgram",
INT_MAX);
}
// TODO: DTLS
if (ssl)
{
- pcap_snprintf(errbuf, errbuflen, "DTLS not implemented yet");
+ snprintf(errbuf, errbuflen, "DTLS not implemented yet");
return -1;
}
#endif
* Report this as an error, as the Microsoft documentation
* implies we'd do in a similar case on Windows.
*/
- pcap_snprintf(errbuf, errbuflen, "recv(): Message too long");
+ snprintf(errbuf, errbuflen, "recv(): Message too long");
return -1;
}
#endif /* HAVE_STRUCT_MSGHDR_MSG_FLAGS */
* the host wasn't in the list.
*/
if (errbuf)
- pcap_snprintf(errbuf, errbuflen, "The host is not in the allowed host list. Connection refused.");
+ snprintf(errbuf, errbuflen, "The host is not in the allowed host list. Connection refused.");
return -1;
}
}
freeaddrinfo(addrinfo);
if (errbuf)
- pcap_snprintf(errbuf, errbuflen, "More than one socket requested; using the first one returned");
+ snprintf(errbuf, errbuflen, "More than one socket requested; using the first one returned");
return -2;
}