diff options
Diffstat (limited to 'contrib/bind9/lib/bind/dst/support.c')
-rw-r--r-- | contrib/bind9/lib/bind/dst/support.c | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/contrib/bind9/lib/bind/dst/support.c b/contrib/bind9/lib/bind/dst/support.c index 8fe3cdb..ec228d0 100644 --- a/contrib/bind9/lib/bind/dst/support.c +++ b/contrib/bind9/lib/bind/dst/support.c @@ -1,4 +1,4 @@ -static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/support.c,v 1.2.2.1.10.2 2005/10/11 00:48:14 marka Exp $"; +static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/support.c,v 1.3.332.3 2005/10/11 00:25:09 marka Exp $"; /* @@ -34,7 +34,7 @@ static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/support. #include "port_after.h" -/* +/*% * dst_s_verify_str() * Validate that the input string(*str) is at the head of the input * buffer(**buf). If so, move the buffer head pointer (*buf) to @@ -52,20 +52,20 @@ int dst_s_verify_str(const char **buf, const char *str) { int b, s; - if (*buf == NULL) /* error checks */ + if (*buf == NULL) /*%< error checks */ return (0); if (str == NULL || *str == '\0') return (1); - b = strlen(*buf); /* get length of strings */ + b = strlen(*buf); /*%< get length of strings */ s = strlen(str); - if (s > b || strncmp(*buf, str, s)) /* check if same */ - return (0); /* not a match */ - (*buf) += s; /* advance pointer */ + if (s > b || strncmp(*buf, str, s)) /*%< check if same */ + return (0); /*%< not a match */ + (*buf) += s; /*%< advance pointer */ return (1); } -/* +/*% * dst_s_calculate_bits * Given a binary number represented in a u_char[], determine * the number of significant bits used. @@ -89,8 +89,7 @@ dst_s_calculate_bits(const u_char *str, const int max_bits) return (bits); } - -/* +/*% * calculates a checksum used in dst for an id. * takes an array of bytes and a length. * returns a 16 bit checksum. @@ -115,7 +114,7 @@ dst_s_id_calc(const u_char *key, const int keysize) return (ac & 0xffff); } -/* +/*% * dst_s_dns_key_id() Function to calculate DNSSEC footprint from KEY record * rdata * Input: @@ -131,7 +130,7 @@ dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len) return 0; /* compute id */ - if (dns_key_rdata[3] == KEY_RSA) /* Algorithm RSA */ + if (dns_key_rdata[3] == KEY_RSA) /*%< Algorithm RSA */ return dst_s_get_int16((const u_char *) &dns_key_rdata[rdata_len - 3]); else if (dns_key_rdata[3] == KEY_HMAC_MD5) @@ -142,7 +141,7 @@ dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len) return dst_s_id_calc(dns_key_rdata, rdata_len); } -/* +/*% * dst_s_get_int16 * This routine extracts a 16 bit integer from a two byte character * string. The character string is assumed to be in network byte @@ -161,8 +160,7 @@ dst_s_get_int16(const u_char *buf) return (a); } - -/* +/*% * dst_s_get_int32 * This routine extracts a 32 bit integer from a four byte character * string. The character string is assumed to be in network byte @@ -182,8 +180,7 @@ dst_s_get_int32(const u_char *buf) return (a); } - -/* +/*% * dst_s_put_int16 * Take a 16 bit integer and store the value in a two byte * character string. The integer is assumed to be in network @@ -201,8 +198,7 @@ dst_s_put_int16(u_int8_t *buf, const u_int16_t val) buf[1] = (u_int8_t)(val); } - -/* +/*% * dst_s_put_int32 * Take a 32 bit integer and store the value in a four byte * character string. The integer is assumed to be in network @@ -222,13 +218,12 @@ dst_s_put_int32(u_int8_t *buf, const u_int32_t val) buf[3] = (u_int8_t)(val); } - -/* +/*% * dst_s_filename_length * * This function returns the number of bytes needed to hold the * filename for a key file. '/', '\' and ':' are not allowed. - * form: K<keyname>+<alg>+<id>.<suffix> + * form: K<keyname>+<alg>+<id>.<suffix> * * Returns 0 if the filename would contain either '\', '/' or ':' */ @@ -254,13 +249,12 @@ dst_s_filename_length(const char *name, const char *suffix) return (1 + strlen(name) + 6 + strlen(suffix)); } - -/* +/*% * dst_s_build_filename () * Builds a key filename from the key name, it's id, and a * suffix. '\', '/' and ':' are not allowed. fA filename is of the - * form: K<keyname><id>.<suffix> - * form: K<keyname>+<alg>+<id>.<suffix> + * form: K<keyname><id>.<suffix> + * form: K<keyname>+<alg>+<id>.<suffix> * * Returns -1 if the conversion fails: * if the filename would be too long for space allotted @@ -294,7 +288,7 @@ dst_s_build_filename(char *filename, const char *name, u_int16_t id, return (0); } -/* +/*% * dst_s_fopen () * Open a file in the dst_path directory. If perm is specified, the * file is checked for existence first, and not opened if it exists. @@ -344,3 +338,5 @@ dst_s_dump(const int mode, const u_char *data, const int size, #endif } } + +/*! \file */ |