cc.h File Reference

#include <isc/lang.h>
#include <isc/buffer.h>
#include <isccc/types.h>

Go to the source code of this file.

Defines

#define ISCCC_CC_H   1
#define ISCCC_ALG_UNKNOWN   0
 from lib/dns/include/dst/dst.h
#define ISCCC_ALG_HMACMD5   157
#define ISCCC_ALG_HMACSHA1   161
#define ISCCC_ALG_HMACSHA224   162
#define ISCCC_ALG_HMACSHA256   163
#define ISCCC_ALG_HMACSHA384   164
#define ISCCC_ALG_HMACSHA512   165
#define ISCCC_CC_MAXDGRAMPACKET   4096
 Maximum Datagram Package.
#define ISCCC_CCMSGTYPE_STRING   0x00
 Message Type String.
#define ISCCC_CCMSGTYPE_BINARYDATA   0x01
 Message Type Binary Data.
#define ISCCC_CCMSGTYPE_TABLE   0x02
 Message Type Table.
#define ISCCC_CCMSGTYPE_LIST   0x03
 Message Type List.

Functions

isc_result_t isccc_cc_towire (isccc_sexpr_t *alist, isc_buffer_t **buffer, isc_uint32_t algorithm, isccc_region_t *secret)
 Send to Wire.
isc_result_t isccc_cc_fromwire (isccc_region_t *source, isccc_sexpr_t **alistp, isc_uint32_t algorithm, isccc_region_t *secret)
 Get From Wire.
isc_result_t isccc_cc_createmessage (isc_uint32_t version, const char *from, const char *to, isc_uint32_t serial, isccc_time_t now, isccc_time_t expires, isccc_sexpr_t **alistp)
 Create Message.
isc_result_t isccc_cc_createack (isccc_sexpr_t *message, isc_boolean_t ok, isccc_sexpr_t **ackp)
 Create Acknowledgment.
isc_boolean_t isccc_cc_isack (isccc_sexpr_t *message)
 Is Ack?
isc_boolean_t isccc_cc_isreply (isccc_sexpr_t *message)
 Is Reply?
isc_result_t isccc_cc_createresponse (isccc_sexpr_t *message, isccc_time_t now, isccc_time_t expires, isccc_sexpr_t **alistp)
 Create Response.
isccc_sexpr_tisccc_cc_definestring (isccc_sexpr_t *alist, const char *key, const char *str)
 Define String.
isccc_sexpr_tisccc_cc_defineuint32 (isccc_sexpr_t *alist, const char *key, isc_uint32_t i)
 Define uint 32.
isc_result_t isccc_cc_lookupstring (isccc_sexpr_t *alist, const char *key, char **strp)
 Lookup String.
isc_result_t isccc_cc_lookupuint32 (isccc_sexpr_t *alist, const char *key, isc_uint32_t *uintp)
 Lookup uint 32.
isc_result_t isccc_cc_createsymtab (isccc_symtab_t **symtabp)
 Create Symbol Table.
void isccc_cc_cleansymtab (isccc_symtab_t *symtab, isccc_time_t now)
 Clean up Symbol Table.
isc_result_t isccc_cc_checkdup (isccc_symtab_t *symtab, isccc_sexpr_t *message, isccc_time_t now)
 Check for Duplicates.


Detailed Description

Definition in file cc.h.


Define Documentation

#define ISCCC_CC_H   1

Definition at line 35 of file cc.h.

#define ISCCC_ALG_UNKNOWN   0

from lib/dns/include/dst/dst.h

Definition at line 47 of file cc.h.

#define ISCCC_ALG_HMACMD5   157

Definition at line 48 of file cc.h.

Referenced by isccc_cc_towire(), parse_config(), sign(), and verify().

#define ISCCC_ALG_HMACSHA1   161

Definition at line 49 of file cc.h.

Referenced by parse_config(), sign(), and verify().

#define ISCCC_ALG_HMACSHA224   162

Definition at line 50 of file cc.h.

Referenced by parse_config(), sign(), and verify().

#define ISCCC_ALG_HMACSHA256   163

Definition at line 51 of file cc.h.

Referenced by parse_config(), sign(), and verify().

#define ISCCC_ALG_HMACSHA384   164

Definition at line 52 of file cc.h.

Referenced by parse_config(), sign(), and verify().

#define ISCCC_ALG_HMACSHA512   165

Definition at line 53 of file cc.h.

Referenced by parse_config(), sign(), and verify().

#define ISCCC_CC_MAXDGRAMPACKET   4096

Maximum Datagram Package.

Definition at line 56 of file cc.h.

#define ISCCC_CCMSGTYPE_STRING   0x00

Message Type String.

Definition at line 59 of file cc.h.

#define ISCCC_CCMSGTYPE_BINARYDATA   0x01

Message Type Binary Data.

Definition at line 61 of file cc.h.

Referenced by value_fromwire(), and value_towire().

#define ISCCC_CCMSGTYPE_TABLE   0x02

Message Type Table.

Definition at line 63 of file cc.h.

Referenced by value_fromwire(), and value_towire().

#define ISCCC_CCMSGTYPE_LIST   0x03

Message Type List.

Definition at line 65 of file cc.h.

Referenced by value_fromwire(), and value_towire().


Function Documentation

isc_result_t isccc_cc_towire ( isccc_sexpr_t alist,
isc_buffer_t **  buffer,
isc_uint32_t  algorithm,
isccc_region_t secret 
)

Send to Wire.

Definition at line 345 of file cc.c.

References auth_hmd5, auth_hsha, HMD5_OFFSET, HSHA_OFFSET, isc_buffer_putmem, isc_buffer_putuint32, isc_buffer_reserve(), isc_buffer_used, ISC_R_NOSPACE, ISC_R_SUCCESS, ISCCC_ALG_HMACMD5, isccc_alist_delete(), sign(), and table_towire().

Referenced by control_recvmessage(), rndc_connected(), and rndc_recvnonce().

isc_result_t isccc_cc_fromwire ( isccc_region_t source,
isccc_sexpr_t **  alistp,
isc_uint32_t  algorithm,
isccc_region_t secret 
)

Get From Wire.

Definition at line 657 of file cc.c.

References GET32, ISC_R_UNEXPECTEDEND, ISCCC_R_UNKNOWNVERSION, REGION_SIZE, isccc_region::rstart, table_fromwire(), and version.

Referenced by control_recvmessage(), rndc_recvdone(), and rndc_recvnonce().

isc_result_t isccc_cc_createmessage ( isc_uint32_t  version,
const char *  from,
const char *  to,
isc_uint32_t  serial,
isccc_time_t  now,
isccc_time_t  expires,
isccc_sexpr_t **  alistp 
)

Create Message.

Definition at line 732 of file cc.c.

References createmessage(), and ISC_TRUE.

Referenced by isccc_cc_createresponse(), rndc_connected(), and rndc_recvnonce().

isc_result_t isccc_cc_createack ( isccc_sexpr_t message,
isc_boolean_t  ok,
isccc_sexpr_t **  ackp 
)

Create Acknowledgment.

Definition at line 741 of file cc.c.

References createmessage(), ISC_FALSE, ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_SUCCESS, isccc_alist_lookup(), isccc_cc_definestring(), isccc_cc_lookupstring(), isccc_cc_lookupuint32(), isccc_sexpr_free(), REQUIRE, and serial.

isc_boolean_t isccc_cc_isack ( isccc_sexpr_t message  ) 

Is Ack?

Definition at line 793 of file cc.c.

References ISC_FALSE, ISC_R_SUCCESS, ISC_TRUE, isccc_alist_lookup(), and isccc_cc_lookupstring().

isc_boolean_t isccc_cc_isreply ( isccc_sexpr_t message  ) 

Is Reply?

Definition at line 806 of file cc.c.

References ISC_FALSE, ISC_R_SUCCESS, ISC_TRUE, isccc_alist_lookup(), and isccc_cc_lookupstring().

Referenced by control_recvmessage().

isc_result_t isccc_cc_createresponse ( isccc_sexpr_t message,
isccc_time_t  now,
isccc_time_t  expires,
isccc_sexpr_t **  alistp 
)

Create Response.

Definition at line 819 of file cc.c.

References ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_SUCCESS, isccc_alist_lookup(), isccc_cc_createmessage(), isccc_cc_definestring(), isccc_cc_lookupstring(), isccc_cc_lookupuint32(), isccc_sexpr_free(), REQUIRE, and serial.

Referenced by control_recvmessage().

isccc_sexpr_t* isccc_cc_definestring ( isccc_sexpr_t alist,
const char *  key,
const char *  str 
)

Define String.

Definition at line 880 of file cc.c.

References DE_CONST, isccc_alist_definebinary(), r, isccc_region::rend, and isccc_region::rstart.

Referenced by control_recvmessage(), createmessage(), isccc_cc_createack(), isccc_cc_createresponse(), rndc_connected(), and rndc_recvnonce().

isccc_sexpr_t* isccc_cc_defineuint32 ( isccc_sexpr_t alist,
const char *  key,
isc_uint32_t  i 
)

Define uint 32.

Definition at line 893 of file cc.c.

References isccc_alist_definebinary(), r, isccc_region::rend, and isccc_region::rstart.

Referenced by control_recvmessage(), createmessage(), and rndc_recvnonce().

isc_result_t isccc_cc_lookupstring ( isccc_sexpr_t alist,
const char *  key,
char **  strp 
)

Lookup String.

Definition at line 908 of file cc.c.

References ISC_R_EXISTS, ISC_R_NOTFOUND, ISC_R_SUCCESS, isccc_alist_assq(), isccc_sexpr_binaryp(), ISCCC_SEXPR_CDR, isccc_sexpr_tostring(), and REQUIRE.

Referenced by isccc_cc_checkdup(), isccc_cc_createack(), isccc_cc_createresponse(), isccc_cc_isack(), isccc_cc_isreply(), ns_control_docommand(), and rndc_recvdone().

isc_result_t isccc_cc_lookupuint32 ( isccc_sexpr_t alist,
const char *  key,
isc_uint32_t uintp 
)

Lookup uint 32.

Definition at line 929 of file cc.c.

References ISC_R_EXISTS, ISC_R_NOTFOUND, ISC_R_SUCCESS, isccc_alist_assq(), isccc_sexpr_binaryp(), ISCCC_SEXPR_CDR, and isccc_sexpr_tostring().

Referenced by control_recvmessage(), isccc_cc_createack(), isccc_cc_createresponse(), and rndc_recvnonce().

isc_result_t isccc_cc_createsymtab ( isccc_symtab_t **  symtabp  ) 

Create Symbol Table.

Definition at line 980 of file cc.c.

References ISC_FALSE, isccc_symtab_create(), and symtab_undefine().

Referenced by ns_controls_create().

void isccc_cc_cleansymtab ( isccc_symtab_t symtab,
isccc_time_t  now 
)

Clean up Symbol Table.

Definition at line 987 of file cc.c.

References isccc_symtab_foreach(), and symtab_clean().

Referenced by control_recvmessage().

isc_result_t isccc_cc_checkdup ( isccc_symtab_t symtab,
isccc_sexpr_t message,
isccc_time_t  now 
)

Check for Duplicates.

Definition at line 1007 of file cc.c.

References isccc_symvalue::as_uinteger, free(), has_whitespace(), INSIST, ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_SUCCESS, isccc_alist_lookup(), isccc_cc_lookupstring(), isccc_symexists_reject, isccc_symtab_define(), ISCCC_SYMTYPE_CCDUP, and key.

Referenced by control_recvmessage().


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