1 | /***************************************
2 | $Revision: 1.1 $
3 |
4 | Status: NOT REVUED, NOT TESTED
5 |
6 | Author(s): Andrei Robachevsky
7 |
8 | ******************/ /******************
9 | Modification History:
10 | andrei (10/04/2000) Created.
11 | ******************/ /******************
12 | Copyright (c) 2000 RIPE NCC
13 |
14 | All Rights Reserved
15 |
16 | Permission to use, copy, modify, and distribute this software and its
17 | documentation for any purpose and without fee is hereby granted,
18 | provided that the above copyright notice appear in all copies and that
19 | both that copyright notice and this permission notice appear in
20 | supporting documentation, and that the name of the author not be
21 | used in advertising or publicity pertaining to distribution of the
22 | software without specific, written prior permission.
23 |
24 | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
25 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
26 | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
27 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
28 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
29 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30 | ***************************************/
31 | #ifndef _NH_H
32 | #define _NH_H
33 |
34 | #include <mysql_driver.h>
35 |
36 | #define MAX_NH_LENGTH 64
37 | #define MAX_NH_SPACE_LENGTH 5
38 | #define MAX_NH_SOURCE_LENGTH 10
39 |
40 | #define MAX_NIC_ID 99999
41 | #define NULL_NIC_ID (MAX_NIC_ID+1)
42 | #define AUTO_NIC_ID (MAX_NIC_ID+2)
43 | #define MAX_RANGE NULL_NIC_ID
44 | #define MIN_RANGE 0
45 |
46 | typedef struct _range_t {
47 | long start;
48 | long end;
49 | char *space;
50 | char *source;
51 | } range_t;
52 |
53 | /* structure to save nic handle data */
54 | typedef struct _nic_handle_t {
55 | long nic_id;
56 | char *space;
57 | char *source;
58 | } nic_handle_t;
59 |
60 | int NH_check(nic_handle_t *pnh, SQ_connection_t *sql_connection);
61 | int NH_free(nic_handle_t *pnh, SQ_connection_t *sql_connection);
62 | int NH_register(nic_handle_t *pnh, SQ_connection_t *sql_connection);
63 |
64 | int NH_convert(char *nic, nic_handle_t *pnh);
65 | int NH_parse(char *nic, nic_handle_t **pnh);
66 |
67 | void free_nh(nic_handle_t *nh_ptr);
68 |
69 | #endif /* _NH_H */