The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ipv6-gmp.h
Go to the documentation of this file.
1 /* This file is part of Netsukuku
2  * (c) Copyright 2004 Andrea Lo Pumo aka AlpT <alpt@freaknet.org>
3  *
4  * This source code is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * This source code is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * Please refer to the GNU Public License for more details.
13  *
14  * You should have received a copy of the GNU Public License along with
15  * this source code; if not, write to:
16  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  * --
18  * 128bit-gmp.c: I made this to handle the HUGE ipv6 numbers
19  */
20 
21 #ifndef IPV6_GMP_H
22 #define IPV6_GMP_H
23 
24 #define ZERO128 {0,0,0,0}
25 
26 /* * * Defines used for mpz_import/export * * */
27 /* From info gmp: "ORDER can be 1 for most significant word first or -1 for least
28  * significant first." */
29 #define NETWORK_ORDER 1
30 #define HOST_ORDER -1
31 #define NATIVE_ENDIAN 0
32 #define HOST_ENDIAN -1
33 #define NETWORK_ENDIAN 1
34 
35 int sum_int(unsigned int , unsigned int *);
36 int sum_128(unsigned int *, unsigned int *);
37 int sub_int(unsigned int *, unsigned int);
38 int sub_128(unsigned int *, unsigned int *);
39 int div_128(unsigned int *, unsigned int *);
40 int div_int(unsigned int *, unsigned int);
41 int div_mpz(unsigned int *, mpz_t);
42 int htonl_128(unsigned int *, unsigned int *);
43 int ntohl_128(unsigned int *, unsigned int *);
44 
45 #endif /*IPV6_GMP_H*/
int sub_128(unsigned int *, unsigned int *)
Definition: ipv6-gmp.c:58
int ntohl_128(unsigned int *, unsigned int *)
Definition: ipv6-gmp.c:152
int sum_128(unsigned int *, unsigned int *)
Definition: ipv6-gmp.c:27
int div_mpz(unsigned int *, mpz_t)
Definition: ipv6-gmp.c:120
int div_128(unsigned int *, unsigned int *)
Definition: ipv6-gmp.c:89
int sum_int(unsigned int, unsigned int *)
Definition: ipv6-gmp.c:49
int htonl_128(unsigned int *, unsigned int *)
Definition: ipv6-gmp.c:139
int div_int(unsigned int *, unsigned int)
Definition: ipv6-gmp.c:111
int sub_int(unsigned int *, unsigned int)
Definition: ipv6-gmp.c:80