1 | /*************************************** 2 | $Revision: 1.9 $ 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 | /* macros for update mode operation */ 52 | #define IS_DUMMY_ALLOWED(a) ((a)&(B_DUMMY)) 53 | #define IS_UPDATE(a) ((a)&(B_UPDATE)) 54 | #define IS_NRTM_CLNT(a) ((a)&(B_NRTM_CLNT)) 55 | #define IS_STANDALONE(a) ((a)&(B_STANDALONE)) 56 | 57 | 58 | /* XXX SQL transaction types */ 59 | 60 | #define TR_UPDATE 1000 61 | #define TR_INSERT 2000 62 | #define TR_CREATE TR_INSERT 63 | #define TR_DELETE 3000 64 | 65 | 66 | 67 | /* Transaction action (tr.action ) */ 68 | #define TA_CREATE 0x01 69 | #define TA_UPDATE 0x02 70 | #define TA_DELETE 0x04 71 | #define TA_UPD_NHR 0x08 72 | #define TA_UPD_RX 0x10 73 | #define TA_DUMMY 0x20 74 | #define TA_CLLPS 0x40 75 | #define TA_UPD_DUMMY (TA_UPDATE | TA_DUMMY) 76 | #define TA_UPD_CLLPS (TA_UPDATE | TA_CLLPS) 77 | 78 | 79 | 80 | /* macros for transaction operation bitmask (tr.action) */ 81 | #define ACT_CREATE(a) ((a)&TA_CREATE) 82 | #define ACT_UPDATE(a) ((a)&TA_UPDATE) 83 | #define ACT_DELETE(a) ((a)&TA_DELETE) 84 | #define ACT_UPD_NHR(a) ((a)&TA_UPD_NHR) /* update Nic Handle Repository */ 85 | #define ACT_UPD_RX(a) ((a)&TA_UPD_RX) /* update radix tree */ 86 | 87 | #define ACT_UPD_DUMMY(a) ((a)&TA_DUMMY) /* update of a dummy object */ 88 | #define ACT_UPD_CLLPS(a) ((a)&TA_CLLPS) /* collapsed (DEL+ADD) update */ 89 | 90 | 91 | 92 | #define OP_ADD 1 93 | #define OP_DEL 2 94 | #define OP_UPD 3 95 | #define OP_NOOP 4 96 | 97 | 98 | void UD_do_nrtm(void *args); 99 | void UD_do_updates(void *args); 100 | 101 | 102 | #endif /* _UD_H */ 103 |