privacore-open-source-searc.../ip.h
Ivan Skytte Jørgensen 7db9c4354e Removed non-renetrant version of iptoa()
Mass-change. Many places it could have been done in a better way (eg. calculate nice name for UdpSlot peer once and not for every log line).
2017-05-10 17:54:00 +02:00

26 lines
576 B
C

// Matt Wells, copyright Jun 2001
#ifndef GB_IP_H
#define GB_IP_H
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int32_t atoip ( const char *s , int32_t slen );
int32_t atoip ( const char *s );
//char *iptoa ( int32_t ip );
const char *iptoa(int32_t ip, char *buf);
// . get domain of ip address
// . first byte is the host (little endian)
int32_t ipdom ( int32_t ip ) ;
// most significant 2 bytes of ip
int32_t iptop ( int32_t ip ) ;
// returns number of top bytes in comon
int32_t ipCmp ( int32_t ip1 , int32_t ip2 ) ;
#endif // GB_IP_H