cc.h

Go to the documentation of this file.
00001 /*
00002  * Portions Copyright (C) 2004-2007, 2013, 2014  Internet Systems Consortium, Inc. ("ISC")
00003  * Portions Copyright (C) 2001  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NOMINUM DISCLAIMS ALL
00010  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
00011  * OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY
00012  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00013  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00014  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00015  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00016  *
00017  * Portions Copyright (C) 2001  Nominum, Inc.
00018  *
00019  * Permission to use, copy, modify, and/or distribute this software for any
00020  * purpose with or without fee is hereby granted, provided that the above
00021  * copyright notice and this permission notice appear in all copies.
00022  *
00023  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NOMINUM DISCLAIMS ALL
00024  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
00025  * OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY
00026  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00027  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00028  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00029  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00030  */
00031 
00032 /* $Id: cc.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
00033 
00034 #ifndef ISCCC_CC_H
00035 #define ISCCC_CC_H 1
00036 
00037 /*! \file isccc/cc.h */
00038 
00039 #include <isc/lang.h>
00040 #include <isc/buffer.h>
00041 #include <isccc/types.h>
00042 
00043 ISC_LANG_BEGINDECLS
00044 
00045 /*% from lib/dns/include/dst/dst.h */
00046 
00047 #define ISCCC_ALG_UNKNOWN       0
00048 #define ISCCC_ALG_HMACMD5       157
00049 #define ISCCC_ALG_HMACSHA1      161
00050 #define ISCCC_ALG_HMACSHA224    162
00051 #define ISCCC_ALG_HMACSHA256    163
00052 #define ISCCC_ALG_HMACSHA384    164
00053 #define ISCCC_ALG_HMACSHA512    165
00054 
00055 /*% Maximum Datagram Package */
00056 #define ISCCC_CC_MAXDGRAMPACKET         4096
00057 
00058 /*% Message Type String */
00059 #define ISCCC_CCMSGTYPE_STRING          0x00
00060 /*% Message Type Binary Data */
00061 #define ISCCC_CCMSGTYPE_BINARYDATA      0x01
00062 /*% Message Type Table */
00063 #define ISCCC_CCMSGTYPE_TABLE           0x02
00064 /*% Message Type List */
00065 #define ISCCC_CCMSGTYPE_LIST            0x03
00066 
00067 /*% Send to Wire */
00068 isc_result_t
00069 isccc_cc_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer,
00070                 isc_uint32_t algorithm, isccc_region_t *secret);
00071 
00072 /*% Get From Wire */
00073 isc_result_t
00074 isccc_cc_fromwire(isccc_region_t *source, isccc_sexpr_t **alistp,
00075                   isc_uint32_t algorithm, isccc_region_t *secret);
00076 
00077 /*% Create Message */
00078 isc_result_t
00079 isccc_cc_createmessage(isc_uint32_t version, const char *from, const char *to,
00080                        isc_uint32_t serial, isccc_time_t now,
00081                        isccc_time_t expires, isccc_sexpr_t **alistp);
00082 
00083 /*% Create Acknowledgment */
00084 isc_result_t
00085 isccc_cc_createack(isccc_sexpr_t *message, isc_boolean_t ok,
00086                    isccc_sexpr_t **ackp);
00087 
00088 /*% Is Ack? */
00089 isc_boolean_t
00090 isccc_cc_isack(isccc_sexpr_t *message);
00091 
00092 /*% Is Reply? */
00093 isc_boolean_t
00094 isccc_cc_isreply(isccc_sexpr_t *message);
00095 
00096 /*% Create Response */
00097 isc_result_t
00098 isccc_cc_createresponse(isccc_sexpr_t *message, isccc_time_t now,
00099                         isccc_time_t expires, isccc_sexpr_t **alistp);
00100 
00101 /*% Define String */
00102 isccc_sexpr_t *
00103 isccc_cc_definestring(isccc_sexpr_t *alist, const char *key, const char *str);
00104 
00105 /*% Define uint 32 */
00106 isccc_sexpr_t *
00107 isccc_cc_defineuint32(isccc_sexpr_t *alist, const char *key, isc_uint32_t i);
00108 
00109 /*% Lookup String */
00110 isc_result_t
00111 isccc_cc_lookupstring(isccc_sexpr_t *alist, const char *key, char **strp);
00112 
00113 /*% Lookup uint 32 */
00114 isc_result_t
00115 isccc_cc_lookupuint32(isccc_sexpr_t *alist, const char *key,
00116                       isc_uint32_t *uintp);
00117 
00118 /*% Create Symbol Table */
00119 isc_result_t
00120 isccc_cc_createsymtab(isccc_symtab_t **symtabp);
00121 
00122 /*% Clean up Symbol Table */
00123 void
00124 isccc_cc_cleansymtab(isccc_symtab_t *symtab, isccc_time_t now);
00125 
00126 /*% Check for Duplicates */
00127 isc_result_t
00128 isccc_cc_checkdup(isccc_symtab_t *symtab, isccc_sexpr_t *message,
00129                   isccc_time_t now);
00130 
00131 ISC_LANG_ENDDECLS
00132 
00133 #endif /* ISCCC_CC_H */

Generated on Tue Apr 28 17:41:06 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha