2 * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
3 * Portions Copyright (C) 2001 Internet Software Consortium.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NOMINUM DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
11 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY
12 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * Portions Copyright (C) 2001 Nominum, Inc.
19 * Permission to use, copy, modify, and/or distribute this software for any
20 * purpose with or without fee is hereby granted, provided that the above
21 * copyright notice and this permission notice appear in all copies.
23 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NOMINUM DISCLAIMS ALL
24 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY
26 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
27 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
28 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
29 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
32 /* $Id: cc.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
37 /*! \file isccc/cc.h */
40 #include <isccc/types.h>
44 /*% Maximum Datagram Package */
45 #define ISCCC_CC_MAXDGRAMPACKET 4096
47 /*% Message Type String */
48 #define ISCCC_CCMSGTYPE_STRING 0x00
49 /*% Message Type Binary Data */
50 #define ISCCC_CCMSGTYPE_BINARYDATA 0x01
51 /*% Message Type Table */
52 #define ISCCC_CCMSGTYPE_TABLE 0x02
53 /*% Message Type List */
54 #define ISCCC_CCMSGTYPE_LIST 0x03
58 isccc_cc_towire(isccc_sexpr_t *alist, isccc_region_t *target,
59 isccc_region_t *secret);
63 isccc_cc_fromwire(isccc_region_t *source, isccc_sexpr_t **alistp,
64 isccc_region_t *secret);
68 isccc_cc_createmessage(isc_uint32_t version, const char *from, const char *to,
69 isc_uint32_t serial, isccc_time_t now,
70 isccc_time_t expires, isccc_sexpr_t **alistp);
72 /*% Create Acknowledgment */
74 isccc_cc_createack(isccc_sexpr_t *message, isc_boolean_t ok,
75 isccc_sexpr_t **ackp);
79 isccc_cc_isack(isccc_sexpr_t *message);
83 isccc_cc_isreply(isccc_sexpr_t *message);
85 /*% Create Response */
87 isccc_cc_createresponse(isccc_sexpr_t *message, isccc_time_t now,
88 isccc_time_t expires, isccc_sexpr_t **alistp);
92 isccc_cc_definestring(isccc_sexpr_t *alist, const char *key, const char *str);
96 isccc_cc_defineuint32(isccc_sexpr_t *alist, const char *key, isc_uint32_t i);
100 isccc_cc_lookupstring(isccc_sexpr_t *alist, const char *key, char **strp);
102 /*% Lookup uint 32 */
104 isccc_cc_lookupuint32(isccc_sexpr_t *alist, const char *key,
105 isc_uint32_t *uintp);
107 /*% Create Symbol Table */
109 isccc_cc_createsymtab(isccc_symtab_t **symtabp);
111 /*% Clean up Symbol Table */
113 isccc_cc_cleansymtab(isccc_symtab_t *symtab, isccc_time_t now);
115 /*% Check for Duplicates */
117 isccc_cc_checkdup(isccc_symtab_t *symtab, isccc_sexpr_t *message,
122 #endif /* ISCCC_CC_H */