NCBI C++ ToolKit
|
#include "ncbi_ansi_ext.h"
#include "ncbi_assert.h"
#include <connect/ncbi_iprange.h>
#include <connect/ncbi_socket.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Functions | |
int | NcbiIsInIPRange (const SIPRange *range, const TNCBI_IPv6Addr *addr) |
SIPRange | NcbiTrueIPRange (const SIPRange *range) |
static size_t | x_size (const char *dst, size_t len, const char *ptr) |
const char * | NcbiDumpIPRange (const SIPRange *range, char *buf, size_t bufsize) |
int | NcbiParseIPRange (SIPRange *range, const char *str) |
Acceptable forms (netmasked IPv4s may omit trailing .0s before '/'): 4 quad full IP: 123.123.123.123 IPv4 range: 123.123.1-123 (meaning 123.123.1.0 thru 123.123.123.255) IPv4 w/netmask: 123.123/255.255.240.0 (equivalent to the following line) IPv4 CIDR: 123.123/20 (meaning 123.123.0.0 thru 123.123.15.255) IPv4 wildcard: 123.123. More... | |
Definition at line 144 of file ncbi_iprange.c.
References SIPRange::a, assert, SIPRange::b, buf, bufsize, eIPRange_Application, eIPRange_Host, eIPRange_Network, eIPRange_None, eIPRange_Range, NcbiIPv6ToIPv4(), NcbiIPv6ToString(), NcbiIsIPv4(), NcbiTrueIPRange(), compile_time_bits::range(), result, SOCK_ntoa(), strncpy0(), SIPRange::type, and x_size().
Referenced by NcbiIsLocalIPEx(), and xx_LoadLocalIPs().
int NcbiIsInIPRange | ( | const SIPRange * | range, |
const TNCBI_IPv6Addr * | addr | ||
) |
Definition at line 43 of file ncbi_iprange.c.
References a, assert, b, eIPRange_Application, eIPRange_Host, eIPRange_Network, eIPRange_None, eIPRange_Range, ip, NcbiIPv6ToIPv4(), NcbiIsInIPv6Network(), NcbiIsIPv4(), compile_time_bits::range(), and SOCK_NetToHostLong.
Referenced by NcbiIsLocalIPEx(), and x_IsOverlappingRange().
Acceptable forms (netmasked IPv4s may omit trailing .0s before '/'): 4 quad full IP: 123.123.123.123 IPv4 range: 123.123.1-123 (meaning 123.123.1.0 thru 123.123.123.255) IPv4 w/netmask: 123.123/255.255.240.0 (equivalent to the following line) IPv4 CIDR: 123.123/20 (meaning 123.123.0.0 thru 123.123.15.255) IPv4 wildcard: 123.123.
* (meaning 123.123.0.0 thru 123.123.255.255) IPv6[/CIDR]: aa:bb::cc/64 (IPv6 addr must be complete,/CIDR optional) hostname: DNS format
Definition at line 216 of file ncbi_iprange.c.
References assert, eIPRange_Host, eIPRange_Network, eIPRange_Range, int, isspace(), len, n, NcbiDNSIPToAddr(), NcbiIPToAddr(), NcbiIPv4ToIPv6(), NcbiIPv6ToIPv4(), NcbiIsEmptyIPv6(), NcbiIsIPv4(), NcbiStringToIPv4(), out(), compile_time_bits::range(), SOCK_gethostbyname(), SOCK_HostToNetLong(), SOCK_isip(), SOCK_isipEx(), SOCK_NetToHostLong, str(), and t.
Referenced by xx_LoadLocalIPs().
Definition at line 89 of file ncbi_iprange.c.
References SIPRange::a, a, assert, SIPRange::b, eIPRange_Application, eIPRange_Host, eIPRange_Network, eIPRange_None, eIPRange_Range, NcbiIPv6ToIPv4(), NcbiIsEmptyIPv6(), NcbiIsIPv4(), compile_time_bits::range(), SOCK_NetToHostLong, and SIPRange::type.
Referenced by NcbiDumpIPRange().
Definition at line 138 of file ncbi_iprange.c.
References len.
Referenced by CFile::Compare(), CONN_ReadLine(), MIME_ParseContentTypeEx(), NcbiDumpIPRange(), s_LogSocketError(), SOCK_ReadLine(), and CHTMLPage::x_LoadTemplateLib().