1    | /***************************************
2    |   $Revision: 1.7 $
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_STANDALONE            0x04
49   | 
50   | /* macros for update mode operation */
51   | #define IS_DUMMY_ALLOWED(a)     ((a)&(B_DUMMY))
52   | #define IS_UPDATE(a)            ((a)&(B_UPDATE))
53   | #define IS_STANDALONE(a)        ((a)&(B_STANDALONE))
54   | 
55   | 
56   | /* XXX SQL transaction types */
57   | 
58   | #define TR_UPDATE   1000
59   | #define TR_INSERT   2000
60   | #define TR_CREATE   TR_INSERT
61   | #define TR_DELETE   3000
62   | 
63   | 
64   | 
65   | /* Transaction action (tr.action ) */
66   | #define TA_CREATE	0x01
67   | #define TA_UPDATE	0x02
68   | #define TA_DELETE       0x04
69   | #define TA_UPD_NHR      0x08
70   | 
71   | 
72   | 
73   | 
74   | /* macros for transaction operation bitmask (tr.action) */
75   | #define ACT_CREATE(a)           ((a)&0x01)
76   | #define ACT_UPDATE(a)           ((a)&0x02)
77   | #define ACT_DELETE(a)           ((a)&0x04)
78   | #define ACT_UPD_NHR(a)          ((a)&0x08) /* update Nic Handle Repository  */
79   | 
80   |  
81   | 
82   | #define OP_ADD          1
83   | #define OP_DEL          2
84   | #define OP_UPD          3
85   | #define OP_NOOP         4
86   | 
87   | 
88   | void UD_do_nrtm();
89   | void UD_do_updates(void *args);
90   | 
91   | 
92   | #endif /* _UD_H */
93   |