Return to minires.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / dhcp / includes / minires |
1.1 ! misho 1: /* ! 2: * Copyright (c) 2004,2007-2010 by Internet Systems Consortium, Inc. ("ISC") ! 3: * Copyright (c) 2001-2003 by Internet Software Consortium ! 4: * ! 5: * Permission to use, copy, modify, and 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. ! 8: * ! 9: * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES ! 10: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ! 11: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ! 12: * ANY 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 ! 15: * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ! 16: * ! 17: * Internet Systems Consortium, Inc. ! 18: * 950 Charter Street ! 19: * Redwood City, CA 94063 ! 20: * <info@isc.org> ! 21: * https://www.isc.org/ ! 22: */ ! 23: #ifndef MINIRES_H ! 24: #define MINIRES_H ! 25: ! 26: #include "cdefs.h" ! 27: #include "osdep.h" ! 28: ! 29: #define _ns_flagdata MR_ns_flagdata ! 30: ! 31: #include "minires/resolv.h" ! 32: #include "minires/res_update.h" ! 33: #include "isc-dhcp/result.h" ! 34: ! 35: /* ! 36: * Based on the Dynamic DNS reference implementation by Viraj Bais ! 37: * <viraj_bais@ccm.fm.intel.com> ! 38: */ ! 39: ! 40: int minires_mkupdate (ns_updrec *, unsigned char *, unsigned); ! 41: int minires_update (ns_updrec *); ! 42: ns_updrec *minires_mkupdrec (int, const char *, unsigned int, ! 43: unsigned int, unsigned long); ! 44: void minires_freeupdrec (ns_updrec *); ! 45: int minires_nmkupdate (res_state, ns_updrec *, double *, unsigned *); ! 46: isc_result_t minires_nupdate (res_state, ns_updrec *); ! 47: int minires_ninit (res_state); ! 48: ns_rcode isc_rcode_to_ns (isc_result_t); ! 49: ! 50: int MRns_name_compress(const char *, u_char *, size_t, const unsigned char **, ! 51: const unsigned char **); ! 52: int MRns_name_unpack(const unsigned char *, const unsigned char *, ! 53: const unsigned char *, unsigned char *, size_t); ! 54: int MRns_name_ntop(const unsigned char *, char *, size_t); ! 55: int MRns_name_pton(const char *, u_char *, size_t); ! 56: ! 57: #if defined (MINIRES_LIB) ! 58: #define res_update minires_update ! 59: #define res_mkupdate minires_mkupdate ! 60: #define res_mkupdrec minires_mkupdrec ! 61: #define res_freeupdrec minires_freeupdrec ! 62: #define res_nmkupdate minires_nmkupdate ! 63: #define res_nupdate minires_nupdate ! 64: #define __p_type_syms MR__p_type_syms ! 65: #define dn_comp MRdn_comp ! 66: #define loc_aton MRloc_aton ! 67: #define sym_ston MRsym_ston ! 68: #define res_buildservicelist MRres_buildservicelist ! 69: #define res_destroyservicelist MRres_destroyservicelist ! 70: #define res_buildprotolist MRres_buildprotolist ! 71: #define res_destroyprotolist MRres_destroyprotolist ! 72: #define res_servicenumber MRres_servicenumber ! 73: #define res_protocolnumber MRres_protocolnumber ! 74: #define res_protocolname MRres_protocolname ! 75: #define res_servicename MRres_servicename ! 76: #define ns_datetosecs MRns_datetosecs ! 77: #define b64_pton MRb64_pton ! 78: #define res_ninit minires_ninit ! 79: #define res_randomid MRres_randomid ! 80: #define res_findzonecut MRres_findzonecut ! 81: #define res_nsend MRres_nsend ! 82: #define res_nsendsigned MRres_nsendsigned ! 83: #define ns_samename MRns_samename ! 84: #define res_nameinquery MRres_nameinquery ! 85: #define res_queriesmatch MRres_queriesmatch ! 86: #define dn_expand MRdn_expand ! 87: #define ns_get16 MRns_get16 ! 88: #define res_close MRres_close ! 89: #define res_nclose MRres_nclose ! 90: #define res_ourserver_p MRres_ourserver_p ! 91: #define ns_sign MRns_sign ! 92: #define p_class MRp_class ! 93: #define p_section MRp_section ! 94: #define ns_makecanon MRns_makecanon ! 95: #define ns_parserr MRns_parserr ! 96: #define ns_samedomain MRns_samedomain ! 97: #define ns_name_uncompress MRns_name_uncompress ! 98: #define res_nmkquery MRres_nmkquery ! 99: #define ns_initparse MRns_initparse ! 100: #define res_nquery MRres_nquery ! 101: #define res_nsearch MRres_nsearch ! 102: #define res_hostalias MRres_hostalias ! 103: #define res_nquerydomain MRres_nquerydomain ! 104: #define ns_skiprr MRns_skiprr ! 105: #define dn_skipname MRdn_skipname ! 106: #define ns_name_ntol MRns_name_ntol ! 107: #define ns_sign_tcp_init MRns_sign_tcp_init ! 108: #define ns_sign_tcp MRns_sign_tcp ! 109: #define ns_name_ntop MRns_name_ntop ! 110: #define ns_name_pton MRns_name_pton ! 111: #define ns_name_unpack MRns_name_unpack ! 112: #define ns_name_pack MRns_name_pack ! 113: #define ns_name_compress MRns_name_compress ! 114: #define ns_name_skip MRns_name_skip ! 115: #define ns_subdomain MRns_subdomain ! 116: #define ns_find_tsig MRns_find_tsig ! 117: #define ns_verify MRns_verify ! 118: #define ns_verify_tcp_init MRns_verify_tcp_init ! 119: #define ns_verify_tcp MRns_verify_tcp ! 120: #define b64_ntop MRb64_ntop ! 121: ! 122: extern const struct res_sym __p_type_syms[]; ! 123: extern struct timeval cur_tv; ! 124: #define cur_time cur_tv.tv_sec ! 125: ! 126: int dn_comp (const char *, ! 127: unsigned char *, unsigned, unsigned char **, unsigned char **); ! 128: int loc_aton (const char *, u_char *); ! 129: int sym_ston (const struct res_sym *, const char *, int *); ! 130: void res_buildservicelist (void); ! 131: void res_destroyservicelist (void); ! 132: void res_buildprotolist(void); ! 133: void res_destroyprotolist(void); ! 134: const char *res_protocolname(int); ! 135: const char *res_servicename(u_int16_t, const char *); ! 136: u_int32_t ns_datetosecs (const char *cp, int *errp); ! 137: int b64_pton (char const *, unsigned char *, size_t); ! 138: u_int res_randomid(void); ! 139: isc_result_t res_findzonecut (res_state, const char *, ns_class, int, char *, ! 140: size_t, struct in_addr *, int, int *, void *); ! 141: isc_result_t res_nsend (res_state, ! 142: double *, unsigned, double *, unsigned, unsigned *); ! 143: isc_result_t res_nsendsigned (res_state, double *, unsigned, ns_tsig_key *, ! 144: double *, unsigned, unsigned *); ! 145: int ns_samename (const char *, const char *); ! 146: int res_nameinquery (const char *, int, int, ! 147: const unsigned char *, const unsigned char *); ! 148: int res_queriesmatch (const unsigned char *, const unsigned char *, ! 149: const unsigned char *, const unsigned char *); ! 150: int dn_expand (const unsigned char *, ! 151: const unsigned char *, const unsigned char *, char *, unsigned); ! 152: unsigned int ns_get16 (const unsigned char *); ! 153: void res_close (void); ! 154: void res_nclose (res_state); ! 155: int res_ourserver_p (const res_state, const struct sockaddr_in *); ! 156: isc_result_t ns_sign (unsigned char *, unsigned *, ! 157: unsigned, int, void *, const unsigned char *, ! 158: unsigned, unsigned char *, unsigned *, time_t); ! 159: const char *p_class (int); ! 160: const char *p_section (int section, int opcode); ! 161: isc_result_t ns_makecanon (const char *, char *, size_t); ! 162: isc_result_t ns_parserr (ns_msg *, ns_sect, int, ns_rr *); ! 163: int ns_samedomain (const char *, const char *); ! 164: int ns_name_uncompress (const u_char *, const u_char *, ! 165: const u_char *, char *, size_t); ! 166: isc_result_t res_nmkquery (res_state, int, const char *, ns_class, ns_type, ! 167: const unsigned char *, unsigned, ! 168: const unsigned char *, double *, ! 169: unsigned, unsigned *); ! 170: isc_result_t ns_initparse (const unsigned char *, unsigned, ns_msg *); ! 171: isc_result_t res_nquery(res_state, const char *, ! 172: ns_class, ns_type, double *, unsigned, unsigned *); ! 173: isc_result_t res_nsearch(res_state, const char *, ! 174: ns_class, ns_type, double *, unsigned, unsigned *); ! 175: const char *res_hostalias (const res_state, const char *, char *, size_t); ! 176: isc_result_t res_nquerydomain(res_state, const char *, const char *, ! 177: ns_class class, ns_type type, ! 178: double *, unsigned, unsigned *); ! 179: ! 180: isc_result_t ns_skiprr(const unsigned char *, ! 181: const unsigned char *, ns_sect, int, int *); ! 182: int dn_skipname (const unsigned char *, const unsigned char *); ! 183: u_int32_t getULong (const unsigned char *); ! 184: int32_t getLong (const unsigned char *); ! 185: u_int32_t getUShort (const unsigned char *); ! 186: int32_t getShort (const unsigned char *); ! 187: u_int32_t getUChar (const unsigned char *); ! 188: void putULong (unsigned char *, u_int32_t); ! 189: void putLong (unsigned char *, int32_t); ! 190: void putUShort (unsigned char *, u_int32_t); ! 191: void putShort (unsigned char *, int32_t); ! 192: void putUChar (unsigned char *, u_int32_t); ! 193: int ns_name_ntol (const unsigned char *, unsigned char *, size_t); ! 194: isc_result_t ns_sign_tcp_init (void *, const unsigned char *, ! 195: unsigned, ns_tcp_tsig_state *); ! 196: isc_result_t ns_sign_tcp (unsigned char *, ! 197: unsigned *, unsigned, int, ns_tcp_tsig_state *, int); ! 198: int ns_name_pack (const unsigned char *, unsigned char *, ! 199: unsigned, const unsigned char **, const unsigned char **); ! 200: int ns_name_skip (const unsigned char **, const unsigned char *); ! 201: int ns_subdomain (const char *, const char *); ! 202: unsigned char *ns_find_tsig (unsigned char *, unsigned char *); ! 203: isc_result_t ns_verify (unsigned char *, unsigned *, void *, ! 204: const unsigned char *, ! 205: unsigned, unsigned char *, unsigned *, time_t *, int); ! 206: isc_result_t ns_verify_tcp_init (void *, const unsigned char *, unsigned, ! 207: ns_tcp_tsig_state *); ! 208: isc_result_t ns_verify_tcp (unsigned char *, unsigned *, ! 209: ns_tcp_tsig_state *, int); ! 210: int b64_ntop (unsigned char const *, size_t, char *, size_t); ! 211: ! 212: isc_result_t find_cached_zone (const char *, ns_class, char *, ! 213: size_t, struct in_addr *, int, int *, void *); ! 214: int find_tsig_key (ns_tsig_key **, const char *, void *); ! 215: int forget_zone (void *); ! 216: int repudiate_zone (void *); ! 217: void cache_found_zone (ns_class, char *, struct in_addr *, int); ! 218: isc_result_t uerr2isc (int); ! 219: isc_result_t ns_rcode_to_isc (int); ! 220: ! 221: #define DprintQ(a,b,c,d) ! 222: #define Dprint(a,b) ! 223: #define Perror(a, b, c, d) ! 224: #define Aerror(a, b, c, d, e) ! 225: #define DPRINTF(x) ! 226: ! 227: #define USE_MD5 ! 228: #endif ! 229: ! 230: #if defined (TRACING) ! 231: void trace_mr_statp_setup (res_state); ! 232: #endif ! 233: ! 234: #endif /* MINIRES_H */