1    | /***************************************
2    |   $Revision: 1.11 $
3    | 
4    |   Status: NOT REVUED, NOT TESTED
5    | 
6    |  Author(s):       Andrei Robachevsky
7    | 
8    |   ******************/ /******************
9    |   Modification History:
10   |         andrei (17/01/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 _UD_H
32   | #define _UD_H
33   | 
34   | /* Error codes definition */
35   | #define ERROR_U_MEM     0x0001 /* memory allocation error */
36   | #define ERROR_U_DBS     0x0002 /* database (sql) error */
37   | #define ERROR_U_OBJ     0x0004 /* referential integrity failure */
38   | #define ERROR_U_AUT     0x0008 /* membership authirization failure */
39   | 
40   | #define ERROR_U_BADOP   0x0010 /* unknown operation */
41   | #define ERROR_U_COP     0x0020 /* conflicting operation (e.g. deletig non-existent object) */
42   | #define ERROR_U_NSUP    0x0040 /* object type not supported */
43   | #define ERROR_U_BUG     0x0080 /*  software bug - report to developer */
44   | 
45   | /* definition of mode bits */
46   | #define B_DUMMY                 0x01
47   | #define B_UPDATE                0x02
48   | #define B_NRTM_CLNT             0x04
49   | #define B_STANDALONE            0x08
50   | 
51   | /* no NHR store - when mirroring foreign db */
52   | #define B_NO_NHR                0x10
53   | /* invitation includes -k */
54   | #define B_PERSIST_MIRR          0x20
55   | 
56   |  
57   | /* macros for update mode operation */
58   | #define IS_DUMMY_ALLOWED(a)     ((a)&(B_DUMMY))
59   | #define IS_UPDATE(a)            ((a)&(B_UPDATE))
60   | #define IS_NRTM_CLNT(a)         ((a)&(B_NRTM_CLNT))
61   | #define IS_STANDALONE(a)        ((a)&(B_STANDALONE))
62   | 
63   | #define IS_PERSIST_MIRR(a)      ((a)&(B_PERSIST_MIRR))
64   | #define IS_NO_NHR(a)            ((a)&(B_NO_NHR))
65   | 
66   | /* XXX SQL transaction types */
67   | 
68   | #define TR_UPDATE   1000
69   | #define TR_INSERT   2000
70   | #define TR_CREATE   TR_INSERT
71   | #define TR_DELETE   3000
72   | 
73   | 
74   | 
75   | /* Transaction action (tr.action ) */
76   | #define TA_CREATE	0x01
77   | #define TA_UPDATE	0x02
78   | #define TA_DELETE       0x04
79   | #define TA_UPD_NHR      0x08
80   | #define TA_UPD_RX       0x10
81   | #define TA_DUMMY        0x20
82   | #define TA_CLLPS        0x40
83   | #define TA_UPD_DUMMY    (TA_UPDATE | TA_DUMMY)
84   | #define TA_UPD_CLLPS    (TA_UPDATE | TA_CLLPS)
85   | 
86   | 
87   | 
88   | /* macros for transaction operation bitmask (tr.action) */
89   | #define ACT_CREATE(a)           ((a)&TA_CREATE)
90   | #define ACT_UPDATE(a)           ((a)&TA_UPDATE)
91   | #define ACT_DELETE(a)           ((a)&TA_DELETE)
92   | #define ACT_UPD_NHR(a)          ((a)&TA_UPD_NHR) /* update Nic Handle Repository  */
93   | #define ACT_UPD_RX(a)           ((a)&TA_UPD_RX) /* update radix tree */
94   | 
95   | #define ACT_UPD_DUMMY(a)        ((a)&TA_DUMMY) /* update of a dummy object */
96   | #define ACT_UPD_CLLPS(a)        ((a)&TA_CLLPS) /* collapsed (DEL+ADD) update */
97   | 
98   |  
99   | 
100  | #define OP_ADD          1
101  | #define OP_DEL          2
102  | #define OP_UPD          3
103  | #define OP_NOOP         4
104  | 
105  | /* class type for dummy objects */
106  | #define DUMMY_TYPE	100
107  | 
108  | /* Definitions for "refer" (domain referral mechanism) */
109  | #define S_RIPE "RIPE"
110  | #define S_INTERNIC "InterNIC"
111  | #define S_SIMPLE "SIMPLE"
112  | #define S_CLIENTADDERSS "CLIENTADDRESS"
113  | 
114  | 
115  | typedef enum {
116  |  RF_RIPE=1,
117  |  RF_INTERNIC,
118  |  RF_SIMPLE,
119  |  RF_CLIENTADDRESS
120  | } refer_t;
121  | 
122  | #define RF_DEF_PORT	43
123  | 
124  | 
125  | 
126  | void UD_do_nrtm(void *args);
127  | void UD_do_updates(void *args);
128  | 
129  | 
130  | #endif /* _UD_H */
131  |