Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

check_addr.c File Reference

#include "config.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <dnet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <check.h>

Go to the source code of this file.

Defines

#define ADDR_PACK(a, ip)
#define SIN_PACK(s, ip, port)

Typedefs

typedef sockaddr SA

Functions

 START_TEST (test_addr_pack)
END_TEST START_TEST (test_addr_cmp)
END_TEST START_TEST (test_addr_bcast)
END_TEST START_TEST (test_addr_net)
END_TEST START_TEST (test_addr_ntop)
END_TEST START_TEST (test_addr_pton)
END_TEST START_TEST (test_addr_ntoa)
END_TEST START_TEST (test_addr_ntos)
END_TEST START_TEST (test_addr_ston)
END_TEST START_TEST (test_addr_btos)
END_TEST START_TEST (test_addr_stob)
END_TEST START_TEST (test_addr_btom)
END_TEST START_TEST (test_addr_mtob)
END_TEST Suite * addr_suite (void)
int main (void)


Define Documentation

#define ADDR_PACK a,
ip   ) 
 

Value:

(a)->addr_type = ADDR_TYPE_IP;  \
        (a)->addr_bits = IP_ADDR_BITS;  \
        (a)->addr_ip = (ip)

Definition at line 18 of file check_addr.c.

Referenced by START_TEST().

#define SIN_PACK s,
ip,
port   ) 
 

Value:

(s)->sin_family = AF_INET;                      \
        (s)->sin_port = htons(port);                    \
        (s)->sin_addr.s_addr = (ip)

Definition at line 30 of file check_addr.c.

Referenced by START_TEST().


Typedef Documentation

typedef struct sockaddr SA
 

Definition at line 36 of file check_addr.c.


Function Documentation

END_TEST Suite* addr_suite void   ) 
 

Definition at line 329 of file check_addr.c.

Referenced by main().

int main void   ) 
 

Definition at line 353 of file check_addr.c.

References addr_suite().

Referenced by do_command().

END_TEST START_TEST test_addr_mtob   ) 
 

Definition at line 317 of file check_addr.c.

References addr::addr_bits, and addr_mtob().

END_TEST START_TEST test_addr_btom   ) 
 

Definition at line 305 of file check_addr.c.

References addr::addr_bits, addr_btom(), and ADDR_PACK.

END_TEST START_TEST test_addr_stob   ) 
 

Definition at line 290 of file check_addr.c.

References addr::addr_bits, addr_stob(), and SIN_PACK.

END_TEST START_TEST test_addr_btos   ) 
 

Definition at line 279 of file check_addr.c.

References addr::addr_bits, addr_btos(), and ADDR_PACK.

END_TEST START_TEST test_addr_ston   ) 
 

Definition at line 256 of file check_addr.c.

References addr_cmp(), ADDR_PACK, addr_ston(), memcmp(), memcpy, memset, and SIN_PACK.

END_TEST START_TEST test_addr_ntos   ) 
 

Definition at line 242 of file check_addr.c.

References addr_ntos(), ADDR_PACK, memcmp(), memset, and SIN_PACK.

END_TEST START_TEST test_addr_ntoa   ) 
 

Definition at line 229 of file check_addr.c.

References addr_ntoa(), and ADDR_PACK.

END_TEST START_TEST test_addr_pton   ) 
 

Definition at line 154 of file check_addr.c.

References addr::addr_bits, addr_cmp(), ADDR_PACK, addr_pton(), addr::addr_type, ADDR_TYPE_ETH, ADDR_TYPE_IP6, ETH_ADDR_BITS, ETH_ADDR_BROADCAST, ETH_ADDR_LEN, IP6_ADDR_BITS, IP6_ADDR_LEN, IP6_ADDR_LOOPBACK, IP6_ADDR_UNSPEC, memcmp(), and NULL.

END_TEST START_TEST test_addr_ntop   ) 
 

Definition at line 100 of file check_addr.c.

References addr::addr_bits, addr_ntop(), addr_pack, ADDR_PACK, ADDR_TYPE_ETH, ADDR_TYPE_IP6, ETH_ADDR_BITS, ETH_ADDR_LEN, IP6_ADDR_BITS, IP6_ADDR_LEN, IP6_ADDR_LOOPBACK, IP6_ADDR_UNSPEC, memcpy, and NULL.

END_TEST START_TEST test_addr_net   ) 
 

Definition at line 85 of file check_addr.c.

References addr_aton, addr::addr_bits, addr_cmp(), addr_net(), ADDR_PACK, and IP6_ADDR_BITS.

END_TEST START_TEST test_addr_bcast   ) 
 

Definition at line 71 of file check_addr.c.

References addr_bcast(), addr::addr_bits, and ADDR_PACK.

END_TEST START_TEST test_addr_cmp   ) 
 

Definition at line 50 of file check_addr.c.

References addr_aton, addr::addr_bits, addr_cmp(), ADDR_PACK, addr::addr_type, ADDR_TYPE_ETH, and memcpy.

START_TEST test_addr_pack   ) 
 

Definition at line 38 of file check_addr.c.

References addr_pack, ADDR_PACK, ADDR_TYPE_IP, IP_ADDR_BITS, IP_ADDR_LEN, memcmp(), and memset.


Generated on Sun May 14 14:51:22 2006 by  doxygen 1.4.2