ze-filter  (ze-filter-0.8.0-develop-180218)
ze-ipv6.h
Go to the documentation of this file.
1 /*
2  *
3  * ze-filter - Mail Server Filter for sendmail
4  *
5  * Copyright (c) 2001-2018 - Jose-Marcio Martins da Cruz
6  *
7  * Auteur : Jose Marcio Martins da Cruz
8  * jose.marcio.mc@gmail.org
9  *
10  * Historique :
11  * Creation : Sat Jun 23 00:54:01 CEST 2007
12  *
13  * This program is free software, but with restricted license :
14  *
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  *
20  * More details about ze-filter license can be found at ze-filter
21  * web site : http://foss.jose-marcio.org
22  */
23 
24 
25 #ifndef __ZE_IPV6_H
26 
32 typedef struct
33 {
34  uint8_t addr[16];
35  uint8_t mask[16];
36  int prefix;
37  char str[64];
38 } ipv6_T;
39 
40 bool ipv6_check_net(ipv6_T * net, ipv6_T * addr);
41 
42 bool ipv6_str2rec(ipv6_T * ipv6, char *sin);
43 
44 void ipv6_rec2str(char *sout, ipv6_T * ipv6, size_t sz);
45 
46 void ipv6_expand(char *sout, char *sin, size_t size);
47 
48 void ipv6_set_prefix(ipv6_T *addr, int prefix);
49 
50 void ipv6_subnet(ipv6_T *net, ipv6_T *addr);
51 
52 void ipv6_prefix_str(ipv6_T *addr, char *buf, size_t size, int n);
53 
54 #define IPV6_PREFIX_MAX 64
55 #define IPV6_PREFIX_MIN 32
56 #define IPV6_PREFIX_STEP 4
57 
58 /*
59  * ipv6_str2canon
60  * ipv6_canon2str
61  * ipv6_canon_db
62  * ipv6_canon_nibble
63  *
64  * ipv6_truncate
65  */
66 
69 # define __ZE_IPV6_H 1
70 #endif /* __ZE_IPV6_H */
Definition: ze-ipv6.h:32
int prefix
Definition: ze-ipv6.h:36
bool ipv6_check_net(ipv6_T *net, ipv6_T *addr)
Definition: ze-ipv6.c:41
void ipv6_set_prefix(ipv6_T *addr, int prefix)
Definition: ze-ipv6.c:242
bool ipv6_str2rec(ipv6_T *ipv6, char *sin)
Definition: ze-ipv6.c:96
void ipv6_expand(char *sout, char *sin, size_t size)
Definition: ze-ipv6.c:68
void ipv6_subnet(ipv6_T *net, ipv6_T *addr)
Definition: ze-ipv6.c:270
void ipv6_prefix_str(ipv6_T *addr, char *buf, size_t size, int n)
Definition: ze-ipv6.c:290
void ipv6_rec2str(char *sout, ipv6_T *ipv6, size_t sz)
Definition: ze-ipv6.c:210