Moved to /private/net. Not POSIX-standard headers.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7311 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2004-04-25 23:06:36 +00:00
parent 3fb2d6f43a
commit a1269ea0d9
11 changed files with 0 additions and 1134 deletions

View File

@ -1,122 +0,0 @@
/*
* Copyright (c) 1997-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* $Id: assertions.h,v 1.1 2004/04/15 15:54:34 wkornew Exp $
*/
#ifndef ASSERTIONS_H
#define ASSERTIONS_H 1
typedef enum {
assert_require, assert_ensure, assert_insist, assert_invariant
} assertion_type;
typedef void (*assertion_failure_callback)(const char *, int, assertion_type,
const char *, int);
extern assertion_failure_callback __assertion_failed;
void set_assertion_failure_callback(assertion_failure_callback f);
const char *assertion_type_to_text(assertion_type type);
#ifdef CHECK_ALL
#define CHECK_REQUIRE 1
#define CHECK_ENSURE 1
#define CHECK_INSIST 1
#define CHECK_INVARIANT 1
#endif
#ifdef CHECK_NONE
#define CHECK_REQUIRE 0
#define CHECK_ENSURE 0
#define CHECK_INSIST 0
#define CHECK_INVARIANT 0
#endif
#ifndef CHECK_REQUIRE
#define CHECK_REQUIRE 1
#endif
#ifndef CHECK_ENSURE
#define CHECK_ENSURE 1
#endif
#ifndef CHECK_INSIST
#define CHECK_INSIST 1
#endif
#ifndef CHECK_INVARIANT
#define CHECK_INVARIANT 1
#endif
#if CHECK_REQUIRE != 0
#define REQUIRE(cond) \
((void) ((cond) || \
((__assertion_failed)(__FILE__, __LINE__, assert_require, \
#cond, 0), 0)))
#define REQUIRE_ERR(cond) \
((void) ((cond) || \
((__assertion_failed)(__FILE__, __LINE__, assert_require, \
#cond, 1), 0)))
#else
#define REQUIRE(cond) ((void) (cond))
#define REQUIRE_ERR(cond) ((void) (cond))
#endif /* CHECK_REQUIRE */
#if CHECK_ENSURE != 0
#define ENSURE(cond) \
((void) ((cond) || \
((__assertion_failed)(__FILE__, __LINE__, assert_ensure, \
#cond, 0), 0)))
#define ENSURE_ERR(cond) \
((void) ((cond) || \
((__assertion_failed)(__FILE__, __LINE__, assert_ensure, \
#cond, 1), 0)))
#else
#define ENSURE(cond) ((void) (cond))
#define ENSURE_ERR(cond) ((void) (cond))
#endif /* CHECK_ENSURE */
#if CHECK_INSIST != 0
#define INSIST(cond) \
((void) ((cond) || \
((__assertion_failed)(__FILE__, __LINE__, assert_insist, \
#cond, 0), 0)))
#define INSIST_ERR(cond) \
((void) ((cond) || \
((__assertion_failed)(__FILE__, __LINE__, assert_insist, \
#cond, 1), 0)))
#else
#define INSIST(cond) ((void) (cond))
#define INSIST_ERR(cond) ((void) (cond))
#endif /* CHECK_INSIST */
#if CHECK_INVARIANT != 0
#define INVARIANT(cond) \
((void) ((cond) || \
((__assertion_failed)(__FILE__, __LINE__, assert_invariant, \
#cond, 0), 0)))
#define INVARIANT_ERR(cond) \
((void) ((cond) || \
((__assertion_failed)(__FILE__, __LINE__, assert_invariant, \
#cond, 1), 0)))
#else
#define INVARIANT(cond) ((void) (cond))
#define INVARIANT_ERR(cond) ((void) (cond))
#endif /* CHECK_INVARIANT */
#endif /* ASSERTIONS_H */

View File

@ -1,109 +0,0 @@
#ifndef ISC_CTL_H
#define ISC_CTL_H
/*
* Copyright (c) 1998,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* $Id: ctl.h,v 1.1 2004/04/15 15:54:34 wkornew Exp $
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <isc/eventlib.h>
/* Macros. */
#define CTL_MORE 0x0001 /* More will be / should be sent. */
#define CTL_EXIT 0x0002 /* Close connection after this. */
#define CTL_DATA 0x0004 /* Go into / this is DATA mode. */
/* Types. */
struct ctl_cctx;
struct ctl_sctx;
struct ctl_sess;
struct ctl_verb;
enum ctl_severity { ctl_debug, ctl_warning, ctl_error };
typedef void (*ctl_logfunc)(enum ctl_severity, const char *, ...);
typedef void (*ctl_verbfunc)(struct ctl_sctx *, struct ctl_sess *,
const struct ctl_verb *, const char *,
u_int, const void *, void *);
typedef void (*ctl_srvrdone)(struct ctl_sctx *, struct ctl_sess *, void *);
typedef void (*ctl_clntdone)(struct ctl_cctx *, void *, const char *, u_int);
struct ctl_verb {
const char * name;
ctl_verbfunc func;
const char * help;
};
/* General symbols. */
#define ctl_logger __ctl_logger
#ifdef __GNUC__
void ctl_logger(enum ctl_severity, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
#else
void ctl_logger(enum ctl_severity, const char *, ...);
#endif
/* Client symbols. */
#define ctl_client __ctl_client
#define ctl_endclient __ctl_endclient
#define ctl_command __ctl_command
struct ctl_cctx * ctl_client(evContext, const struct sockaddr *, size_t,
const struct sockaddr *, size_t,
ctl_clntdone, void *,
u_int, ctl_logfunc);
void ctl_endclient(struct ctl_cctx *);
int ctl_command(struct ctl_cctx *, const char *, size_t,
ctl_clntdone, void *);
/* Server symbols. */
#define ctl_server __ctl_server
#define ctl_endserver __ctl_endserver
#define ctl_response __ctl_response
#define ctl_sendhelp __ctl_sendhelp
#define ctl_getcsctx __ctl_getcsctx
#define ctl_setcsctx __ctl_setcsctx
struct ctl_sctx * ctl_server(evContext, const struct sockaddr *, size_t,
const struct ctl_verb *,
u_int, u_int,
u_int, int, int,
ctl_logfunc, void *);
void ctl_endserver(struct ctl_sctx *);
void ctl_response(struct ctl_sess *, u_int,
const char *, u_int, const void *,
ctl_srvrdone, void *,
const char *, size_t);
void ctl_sendhelp(struct ctl_sess *, u_int);
void * ctl_getcsctx(struct ctl_sess *);
void * ctl_setcsctx(struct ctl_sess *, void *);
#endif /*ISC_CTL_H*/

View File

@ -1,180 +0,0 @@
#ifndef DST_H
#define DST_H
#ifndef HAS_DST_KEY
typedef struct dst_key {
char *dk_key_name; /* name of the key */
int dk_key_size; /* this is the size of the key in bits */
int dk_proto; /* what protocols this key can be used for */
int dk_alg; /* algorithm number from key record */
u_int32_t dk_flags; /* and the flags of the public key */
u_int16_t dk_id; /* identifier of the key */
} DST_KEY;
#endif /* HAS_DST_KEY */
/*
* do not taint namespace
*/
#define dst_bsafe_init __dst_bsafe_init
#define dst_buffer_to_key __dst_buffer_to_key
#define dst_check_algorithm __dst_check_algorithm
#define dst_compare_keys __dst_compare_keys
#define dst_cylink_init __dst_cylink_init
#define dst_dnskey_to_key __dst_dnskey_to_key
#define dst_eay_dss_init __dst_eay_dss_init
#define dst_free_key __dst_free_key
#define dst_generate_key __dst_generate_key
#define dst_hmac_md5_init __dst_hmac_md5_init
#define dst_init __dst_init
#define dst_key_to_buffer __dst_key_to_buffer
#define dst_key_to_dnskey __dst_key_to_dnskey
#define dst_read_key __dst_read_key
#define dst_rsaref_init __dst_rsaref_init
#define dst_s_build_filename __dst_s_build_filename
#define dst_s_calculate_bits __dst_s_calculate_bits
#define dst_s_conv_bignum_b64_to_u8 __dst_s_conv_bignum_b64_to_u8
#define dst_s_conv_bignum_u8_to_b64 __dst_s_conv_bignum_u8_to_b64
#define dst_s_dns_key_id __dst_s_dns_key_id
#define dst_s_dump __dst_s_dump
#define dst_s_filename_length __dst_s_filename_length
#define dst_s_fopen __dst_s_fopen
#define dst_s_get_int16 __dst_s_get_int16
#define dst_s_get_int32 __dst_s_get_int32
#define dst_s_id_calc __dst_s_id_calc
#define dst_s_put_int16 __dst_s_put_int16
#define dst_s_put_int32 __dst_s_put_int32
#define dst_s_quick_random __dst_s_quick_random
#define dst_s_quick_random_set __dst_s_quick_random_set
#define dst_s_random __dst_s_random
#define dst_s_semi_random __dst_s_semi_random
#define dst_s_verify_str __dst_s_verify_str
#define dst_sig_size __dst_sig_size
#define dst_sign_data __dst_sign_data
#define dst_verify_data __dst_verify_data
#define dst_write_key __dst_write_key
/*
* DST Crypto API defintions
*/
void dst_init(void);
int dst_check_algorithm(const int);
int dst_sign_data(const int, /* specifies INIT/UPDATE/FINAL/ALL */
DST_KEY *, /* the key to use */
void **, /* pointer to state structure */
const u_char *, /* data to be signed */
const int, /* length of input data */
u_char *, /* buffer to write signature to */
const int); /* size of output buffer */
int dst_verify_data(const int, /* specifies INIT/UPDATE/FINAL/ALL */
DST_KEY *, /* the key to use */
void **, /* pointer to state structure */
const u_char *, /* data to be verified */
const int, /* length of input data */
const u_char *, /* buffer containing signature */
const int); /* length of signature */
DST_KEY *dst_read_key(const char *, /* name of key */
const u_int16_t, /* key tag identifier */
const int, /* key algorithm */
const int); /* Private/PublicKey wanted*/
int dst_write_key(const DST_KEY *, /* key to write out */
const int); /* Public/Private */
DST_KEY *dst_dnskey_to_key(const char *, /* KEY record name */
const u_char *, /* KEY RDATA */
const int); /* size of input buffer*/
int dst_key_to_dnskey(const DST_KEY *, /* key to translate */
u_char *, /* output buffer */
const int); /* size of out_storage*/
DST_KEY *dst_buffer_to_key(const char *, /* name of the key */
const int, /* algorithm */
const int, /* dns flags */
const int, /* dns protocol */
const u_char *, /* key in dns wire fmt */
const int); /* size of key */
int dst_key_to_buffer(DST_KEY *, u_char *, int);
DST_KEY *dst_generate_key(const char *, /* name of new key */
const int, /* key algorithm to generate */
const int, /* size of new key */
const int, /* alg dependent parameter*/
const int, /* key DNS flags */
const int); /* key DNS protocol */
DST_KEY *dst_free_key(DST_KEY *);
int dst_compare_keys(const DST_KEY *, const DST_KEY *);
int dst_sig_size(DST_KEY *);
/* support for dns key tags/ids */
u_int16_t dst_s_dns_key_id(const u_char *, const int);
u_int16_t dst_s_id_calc(const u_char *, const int);
/* Used by callers as well as by the library. */
#define RAW_KEY_SIZE 8192 /* large enough to store any key */
/* DST_API control flags */
/* These are used used in functions dst_sign_data and dst_verify_data */
#define SIG_MODE_INIT 1 /* initialize digest */
#define SIG_MODE_UPDATE 2 /* add data to digest */
#define SIG_MODE_FINAL 4 /* generate/verify signature */
#define SIG_MODE_ALL (SIG_MODE_INIT|SIG_MODE_UPDATE|SIG_MODE_FINAL)
/* Flags for dst_read_private_key() */
#define DST_FORCE_READ 0x1000000
#define DST_CAN_SIGN 0x010F
#define DST_NO_AUTHEN 0x8000
#define DST_EXTEND_FLAG 0x1000
#define DST_STANDARD 0
#define DST_PRIVATE 0x2000000
#define DST_PUBLIC 0x4000000
#define DST_RAND_SEMI 1
#define DST_RAND_STD 2
#define DST_RAND_KEY 3
#define DST_RAND_DSS 4
/* DST algorithm codes */
#define KEY_RSA 1
#define KEY_DH 2
#define KEY_DSA 3
#define KEY_PRIVATE 254
#define KEY_EXPAND 255
#define KEY_HMAC_MD5 157
#define KEY_HMAC_SHA1 158
#define UNKNOWN_KEYALG 0
#define DST_MAX_ALGS KEY_HMAC_SHA1
/* DST constants to locations in KEY record changes in new KEY record */
#define DST_FLAGS_SIZE 2
#define DST_KEY_PROT 2
#define DST_KEY_ALG 3
#define DST_EXT_FLAG 4
#define DST_KEY_START 4
#ifndef SIGN_F_NOKEY
#define SIGN_F_NOKEY 0xC000
#endif
/* error codes from dst routines */
#define SIGN_INIT_FAILURE (-23)
#define SIGN_UPDATE_FAILURE (-24)
#define SIGN_FINAL_FAILURE (-25)
#define VERIFY_INIT_FAILURE (-26)
#define VERIFY_UPDATE_FAILURE (-27)
#define VERIFY_FINAL_FAILURE (-28)
#define MISSING_KEY_OR_SIGNATURE (-30)
#define UNSUPPORTED_KEYALG (-31)
#endif /* DST_H */

View File

@ -1,191 +0,0 @@
/*
* Copyright (c) 1995-1999 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/* eventlib.h - exported interfaces for eventlib
* vix 09sep95 [initial]
*
* $Id: eventlib.h,v 1.1 2004/04/15 15:54:34 wkornew Exp $
*/
#ifndef _EVENTLIB_H
#define _EVENTLIB_H
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <stdio.h>
#ifndef __P
# define __EVENTLIB_P_DEFINED
# ifdef __STDC__
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/* In the absence of branded types... */
typedef struct { void *opaque; } evConnID;
typedef struct { void *opaque; } evFileID;
typedef struct { void *opaque; } evStreamID;
typedef struct { void *opaque; } evTimerID;
typedef struct { void *opaque; } evWaitID;
typedef struct { void *opaque; } evContext;
typedef struct { void *opaque; } evEvent;
#define evInitID(id) ((id)->opaque = NULL)
#define evTestID(id) ((id).opaque != NULL)
typedef void (*evConnFunc)__P((evContext, void *, int, const void *, int,
const void *, int));
typedef void (*evFileFunc)__P((evContext, void *, int, int));
typedef void (*evStreamFunc)__P((evContext, void *, int, int));
typedef void (*evTimerFunc)__P((evContext, void *,
struct timespec, struct timespec));
typedef void (*evWaitFunc)__P((evContext, void *, const void *));
typedef struct { unsigned char mask[256/8]; } evByteMask;
#define EV_BYTEMASK_BYTE(b) ((b) / 8)
#define EV_BYTEMASK_MASK(b) (1 << ((b) % 8))
#define EV_BYTEMASK_SET(bm, b) \
((bm).mask[EV_BYTEMASK_BYTE(b)] |= EV_BYTEMASK_MASK(b))
#define EV_BYTEMASK_CLR(bm, b) \
((bm).mask[EV_BYTEMASK_BYTE(b)] &= ~EV_BYTEMASK_MASK(b))
#define EV_BYTEMASK_TST(bm, b) \
((bm).mask[EV_BYTEMASK_BYTE(b)] & EV_BYTEMASK_MASK(b))
#define EV_POLL 1
#define EV_WAIT 2
#define EV_NULL 4
#define EV_READ 1
#define EV_WRITE 2
#define EV_EXCEPT 4
/* eventlib.c */
#define evCreate __evCreate
#define evSetDebug __evSetDebug
#define evDestroy __evDestroy
#define evGetNext __evGetNext
#define evDispatch __evDispatch
#define evDrop __evDrop
#define evMainLoop __evMainLoop
#define evHighestFD __evHighestFD
int evCreate __P((evContext *));
void evSetDebug __P((evContext, int, FILE *));
int evDestroy __P((evContext));
int evGetNext __P((evContext, evEvent *, int));
int evDispatch __P((evContext, evEvent));
void evDrop __P((evContext, evEvent));
int evMainLoop __P((evContext));
int evHighestFD __P((evContext));
/* ev_connects.c */
#define evListen __evListen
#define evConnect __evConnect
#define evCancelConn __evCancelConn
#define evHold __evHold
#define evUnhold __evUnhold
#define evTryAccept __evTryAccept
int evListen __P((evContext, int, int, evConnFunc, void *, evConnID *));
int evConnect __P((evContext, int, const void *, int,
evConnFunc, void *, evConnID *));
int evCancelConn __P((evContext, evConnID));
int evHold __P((evContext, evConnID));
int evUnhold __P((evContext, evConnID));
int evTryAccept __P((evContext, evConnID, int *));
/* ev_files.c */
#define evSelectFD __evSelectFD
#define evDeselectFD __evDeselectFD
int evSelectFD __P((evContext, int, int, evFileFunc, void *, evFileID *));
int evDeselectFD __P((evContext, evFileID));
/* ev_streams.c */
#define evConsIovec __evConsIovec
#define evWrite __evWrite
#define evRead __evRead
#define evTimeRW __evTimeRW
#define evUntimeRW __evUntimeRW
#define evCancelRW __evCancelRW
struct iovec evConsIovec __P((void *, size_t));
int evWrite __P((evContext, int, const struct iovec *, int,
evStreamFunc func, void *, evStreamID *));
int evRead __P((evContext, int, const struct iovec *, int,
evStreamFunc func, void *, evStreamID *));
int evTimeRW __P((evContext, evStreamID, evTimerID timer));
int evUntimeRW __P((evContext, evStreamID));
int evCancelRW __P((evContext, evStreamID));
/* ev_timers.c */
#define evConsTime __evConsTime
#define evAddTime __evAddTime
#define evSubTime __evSubTime
#define evCmpTime __evCmpTime
#define evTimeSpec __evTimeSpec
#define evTimeVal __evTimeVal
#define evNowTime __evNowTime
#define evLastEventTime __evLastEventTime
#define evSetTimer __evSetTimer
#define evClearTimer __evClearTimer
#define evResetTimer __evResetTimer
#define evSetIdleTimer __evSetIdleTimer
#define evClearIdleTimer __evClearIdleTimer
#define evResetIdleTimer __evResetIdleTimer
#define evTouchIdleTimer __evTouchIdleTimer
struct timespec evConsTime __P((time_t sec, long nsec));
struct timespec evAddTime __P((struct timespec, struct timespec));
struct timespec evSubTime __P((struct timespec, struct timespec));
struct timespec evNowTime __P((void));
struct timespec evLastEventTime __P((evContext));
struct timespec evTimeSpec __P((struct timeval));
struct timeval evTimeVal __P((struct timespec));
int evCmpTime __P((struct timespec, struct timespec));
int evSetTimer __P((evContext, evTimerFunc, void *, struct timespec,
struct timespec, evTimerID *));
int evClearTimer __P((evContext, evTimerID));
int evResetTimer __P((evContext, evTimerID, evTimerFunc, void *,
struct timespec, struct timespec));
int evSetIdleTimer __P((evContext, evTimerFunc, void *, struct timespec,
evTimerID *));
int evClearIdleTimer __P((evContext, evTimerID));
int evResetIdleTimer __P((evContext, evTimerID, evTimerFunc, void *,
struct timespec));
int evTouchIdleTimer __P((evContext, evTimerID));
/* ev_waits.c */
#define evWaitFor __evWaitFor
#define evDo __evDo
#define evUnwait __evUnwait
#define evDefer __evDefer
int evWaitFor __P((evContext, const void *, evWaitFunc, void *, evWaitID *));
int evDo __P((evContext, const void *));
int evUnwait __P((evContext, evWaitID));
int evDefer __P((evContext, evWaitFunc, void *));
#ifdef __EVENTLIB_P_DEFINED
# undef __P
#endif
#endif /*_EVENTLIB_H*/

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 1997,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
typedef int (*heap_higher_priority_func)(void *, void *);
typedef void (*heap_index_func)(void *, int);
typedef void (*heap_for_each_func)(void *, void *);
typedef struct heap_context {
int array_size;
int array_size_increment;
int heap_size;
void **heap;
heap_higher_priority_func higher_priority;
heap_index_func index;
} *heap_context;
#define heap_new __heap_new
#define heap_free __heap_free
#define heap_insert __heap_insert
#define heap_delete __heap_delete
#define heap_increased __heap_increased
#define heap_decreased __heap_decreased
#define heap_element __heap_element
#define heap_for_each __heap_for_each
heap_context heap_new(heap_higher_priority_func, heap_index_func, int);
int heap_free(heap_context);
int heap_insert(heap_context, void *);
int heap_delete(heap_context, int);
int heap_increased(heap_context, int);
int heap_decreased(heap_context, int);
void * heap_element(heap_context, int);
int heap_for_each(heap_context, heap_for_each_func, void *);

View File

@ -1,115 +0,0 @@
/*
* Copyright (c) 1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* $Id: irpmarshall.h,v 1.1 2004/04/15 15:54:34 wkornew Exp $
*/
#ifndef _IRPMARSHALL_H_INCLUDED
#define _IRPMARSHALL_H_INCLUDED
/* Hide function names */
#define irp_marshall_gr __irp_marshall_gr
#define irp_marshall_ho __irp_marshall_ho
#define irp_marshall_ne __irp_marshall_ne
#define irp_marshall_ng __irp_marshall_ng
#define irp_marshall_nw __irp_marshall_nw
#define irp_marshall_pr __irp_marshall_pr
#define irp_marshall_pw __irp_marshall_pw
#define irp_marshall_sv __irp_marshall_sv
#define irp_unmarshall_gr __irp_unmarshall_gr
#define irp_unmarshall_ho __irp_unmarshall_ho
#define irp_unmarshall_ne __irp_unmarshall_ne
#define irp_unmarshall_ng __irp_unmarshall_ng
#define irp_unmarshall_nw __irp_unmarshall_nw
#define irp_unmarshall_pr __irp_unmarshall_pr
#define irp_unmarshall_pw __irp_unmarshall_pw
#define irp_unmarshall_sv __irp_unmarshall_sv
#define MAXPADDRSIZE (sizeof "255.255.255.255" + 1)
#define ADDR_T_STR(x) (x == AF_INET ? "AF_INET" :\
(x == AF_INET6 ? "AF_INET6" : "UNKNOWN"))
/* See comment below on usage */
int irp_marshall_pw(const struct passwd *, char **, size_t *);
int irp_unmarshall_pw(struct passwd *, char *);
int irp_marshall_gr(const struct group *, char **, size_t *);
int irp_unmarshall_gr(struct group *, char *);
int irp_marshall_sv(const struct servent *, char **, size_t *);
int irp_unmarshall_sv(struct servent *, char *);
int irp_marshall_pr(struct protoent *, char **, size_t *);
int irp_unmarshall_pr(struct protoent *, char *);
int irp_marshall_ho(struct hostent *, char **, size_t *);
int irp_unmarshall_ho(struct hostent *, char *);
int irp_marshall_ng(const char *, const char *, const char *,
char **, size_t *);
int irp_unmarshall_ng(const char **, const char **, const char **, char *);
int irp_marshall_nw(struct nwent *, char **, size_t *);
int irp_unmarshall_nw(struct nwent *, char *);
int irp_marshall_ne(struct netent *, char **, size_t *);
int irp_unmarshall_ne(struct netent *, char *);
/*
* Functions to marshall and unmarshall various system data structures. We
* use a printable ascii format that is as close to various system config
* files as reasonable (e.g. /etc/passwd format).
*
* We are not forgiving with unmarhsalling misformatted buffers. In
* particular whitespace in fields is not ignored. So a formatted password
* entry "brister :1364:100:...." will yield a username of "brister "
*
* We potentially do a lot of mallocs to fill fields that are of type
* (char **) like a hostent h_addr field. Building (for example) the
* h_addr field and its associated addresses all in one buffer is
* certainly possible, but not done here.
*
* The following description is true for all the marshalling functions:
*
*/
/* int irp_marshall_XX(struct yyyy *XX, char **buffer, size_t *len);
*
* The argument XX (of type struct passwd for example) is marshalled in the
* buffer pointed at by *BUFFER, which is of length *LEN. Returns 0
* on success and -1 on failure. Failure will occur if *LEN is
* smaller than needed.
*
* If BUFFER is NULL, then *LEN is set to the size of the buffer
* needed to marshall the data and no marshalling is actually done.
*
* If *BUFFER is NULL, then a buffer large enough will be allocated
* with memget() and the size allocated will be stored in *LEN. An extra 2
* bytes will be allocated for the client to append CRLF if wanted. The
* value of *LEN will include these two bytes.
*
* All the marshalling functions produce a buffer with the fields
* separated by colons (except for the hostent marshalling, which uses '@'
* to separate fields). Fields that have multiple subfields (like the
* gr_mem field in struct group) have their subparts separated by
* commas.
*/
/*
* int irp_unmarshall_XX(struct YYYYY *XX, char *buffer);
*
* The unmashalling functions break apart the buffer and store the
* values in the struct pointed to by XX. All pointer values inside
* XX are allocated with malloc. All arrays of pointers have a NULL
* as the last element.
*/
#endif

View File

@ -1,112 +0,0 @@
/*
* Copyright (c) 1997,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifndef LIST_H
#define LIST_H 1
#include <isc/assertions.h>
#define LIST(type) struct { type *head, *tail; }
#define INIT_LIST(list) \
do { (list).head = NULL; (list).tail = NULL; } while (0)
#define LINK(type) struct { type *prev, *next; }
#define INIT_LINK_TYPE(elt, link, type) \
do { \
(elt)->link.prev = (type *)(-1); \
(elt)->link.next = (type *)(-1); \
} while (0)
#define INIT_LINK(elt, link) \
INIT_LINK_TYPE(elt, link, void)
#define LINKED(elt, link) ((void *)((elt)->link.prev) != (void *)(-1))
#define HEAD(list) ((list).head)
#define TAIL(list) ((list).tail)
#define EMPTY(list) ((list).head == NULL)
#define PREPEND(list, elt, link) \
do { \
INSIST(!LINKED(elt, link));\
if ((list).head != NULL) \
(list).head->link.prev = (elt); \
else \
(list).tail = (elt); \
(elt)->link.prev = NULL; \
(elt)->link.next = (list).head; \
(list).head = (elt); \
} while (0)
#define APPEND(list, elt, link) \
do { \
INSIST(!LINKED(elt, link));\
if ((list).tail != NULL) \
(list).tail->link.next = (elt); \
else \
(list).head = (elt); \
(elt)->link.prev = (list).tail; \
(elt)->link.next = NULL; \
(list).tail = (elt); \
} while (0)
#define UNLINK_TYPE(list, elt, link, type) \
do { \
INSIST(LINKED(elt, link));\
if ((elt)->link.next != NULL) \
(elt)->link.next->link.prev = (elt)->link.prev; \
else \
(list).tail = (elt)->link.prev; \
if ((elt)->link.prev != NULL) \
(elt)->link.prev->link.next = (elt)->link.next; \
else \
(list).head = (elt)->link.next; \
INIT_LINK_TYPE(elt, link, type); \
} while (0)
#define UNLINK(list, elt, link) \
UNLINK_TYPE(list, elt, link, void)
#define PREV(elt, link) ((elt)->link.prev)
#define NEXT(elt, link) ((elt)->link.next)
#define INSERT_BEFORE(list, before, elt, link) \
do { \
INSIST(!LINKED(elt, link));\
if ((before)->link.prev == NULL) \
PREPEND(list, elt, link); \
else { \
(elt)->link.prev = (before)->link.prev; \
(before)->link.prev = (elt); \
(elt)->link.prev->link.next = (elt); \
(elt)->link.next = (before); \
} \
} while (0)
#define INSERT_AFTER(list, after, elt, link) \
do { \
INSIST(!LINKED(elt, link));\
if ((after)->link.next == NULL) \
APPEND(list, elt, link); \
else { \
(elt)->link.next = (after)->link.next; \
(after)->link.next = (elt); \
(elt)->link.next->link.prev = (elt); \
(elt)->link.prev = (after); \
} \
} while (0)
#define ENQUEUE(list, elt, link) APPEND(list, elt, link)
#define DEQUEUE(list, elt, link) UNLINK(list, elt, link)
#endif /* LIST_H */

View File

@ -1,112 +0,0 @@
/*
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifndef LOGGING_H
#define LOGGING_H
#include <sys/types.h>
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#define log_critical (-5)
#define log_error (-4)
#define log_warning (-3)
#define log_notice (-2)
#define log_info (-1)
#define log_debug(level) (level)
typedef enum { log_syslog, log_file, log_null } log_channel_type;
#define LOG_MAX_VERSIONS 99
#define LOG_CLOSE_STREAM 0x0001
#define LOG_TIMESTAMP 0x0002
#define LOG_TRUNCATE 0x0004
#define LOG_USE_CONTEXT_LEVEL 0x0008
#define LOG_PRINT_LEVEL 0x0010
#define LOG_REQUIRE_DEBUG 0x0020
#define LOG_CHANNEL_BROKEN 0x0040
#define LOG_PRINT_CATEGORY 0x0080
#define LOG_CHANNEL_OFF 0x0100
typedef struct log_context *log_context;
typedef struct log_channel *log_channel;
#define LOG_OPTION_DEBUG 0x01
#define LOG_OPTION_LEVEL 0x02
#define log_open_stream __log_open_stream
#define log_close_stream __log_close_stream
#define log_get_stream __log_get_stream
#define log_get_filename __log_get_filename
#define log_check_channel __log_check_channel
#define log_check __log_check
#define log_vwrite __log_vwrite
#define log_write __log_write
#define log_new_context __log_new_context
#define log_free_context __log_free_context
#define log_add_channel __log_add_channel
#define log_remove_channel __log_remove_channel
#define log_option __log_option
#define log_category_is_active __log_category_is_active
#define log_new_syslog_channel __log_new_syslog_channel
#define log_new_file_channel __log_new_file_channel
#define log_set_file_owner __log_set_file_owner
#define log_new_null_channel __log_new_null_channel
#define log_inc_references __log_inc_references
#define log_dec_references __log_dec_references
#define log_get_channel_type __log_get_channel_type
#define log_free_channel __log_free_channel
#define log_close_debug_channels __log_close_debug_channels
FILE * log_open_stream(log_channel);
int log_close_stream(log_channel);
FILE * log_get_stream(log_channel);
char * log_get_filename(log_channel);
int log_check_channel(log_context, int, log_channel);
int log_check(log_context, int, int);
#ifdef __GNUC__
void log_vwrite(log_context, int, int, const char *,
va_list args)
__attribute__((__format__(__printf__, 4, 0)));
void log_write(log_context, int, int, const char *, ...)
__attribute__((__format__(__printf__, 4, 5)));
#else
void log_vwrite(log_context, int, int, const char *,
va_list args);
void log_write(log_context, int, int, const char *, ...);
#endif
int log_new_context(int, char **, log_context *);
void log_free_context(log_context);
int log_add_channel(log_context, int, log_channel);
int log_remove_channel(log_context, int, log_channel);
int log_option(log_context, int, int);
int log_category_is_active(log_context, int);
log_channel log_new_syslog_channel(unsigned int, int, int);
log_channel log_new_file_channel(unsigned int, int, const char *,
FILE *, unsigned int,
unsigned long);
int log_set_file_owner(log_channel, uid_t, gid_t);
log_channel log_new_null_channel(void);
int log_inc_references(log_channel);
int log_dec_references(log_channel);
log_channel_type log_get_channel_type(log_channel);
int log_free_channel(log_channel);
void log_close_debug_channels(log_context);
#endif /* !LOGGING_H */

View File

@ -1,49 +0,0 @@
/*
* Copyright (c) 1997,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifndef MEMCLUSTER_H
#define MEMCLUSTER_H
#include <stdio.h>
#define meminit __meminit
#ifdef MEMCLUSTER_DEBUG
#define memget(s) __memget_debug(s, __FILE__, __LINE__)
#define memput(p, s) __memput_debug(p, s, __FILE__, __LINE__)
#else /*MEMCLUSTER_DEBUG*/
#ifdef MEMCLUSTER_RECORD
#define memget(s) __memget_record(s, __FILE__, __LINE__)
#define memput(p, s) __memput_record(p, s, __FILE__, __LINE__)
#else /*MEMCLUSTER_RECORD*/
#define memget __memget
#define memput __memput
#endif /*MEMCLUSTER_RECORD*/
#endif /*MEMCLUSTER_DEBUG*/
#define memstats __memstats
#define memactive __memactive
int meminit(size_t, size_t);
void * __memget(size_t);
void __memput(void *, size_t);
void * __memget_debug(size_t, const char *, int);
void __memput_debug(void *, size_t, const char *, int);
void * __memget_record(size_t, const char *, int);
void __memput_record(void *, size_t, const char *, int);
void memstats(FILE *);
int memactive(void);
#endif /* MEMCLUSTER_H */

View File

@ -1,39 +0,0 @@
/*
* Copyright (c) 1995-1999 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* $Id: misc.h,v 1.1 2004/04/15 15:54:34 wkornew Exp $
*/
#ifndef _ISC_MISC_H
#define _ISC_MISC_H
#include <stdio.h>
#define bitncmp __bitncmp
/*#define isc_movefile __isc_movefile */
extern int bitncmp(const void *, const void *, int);
extern int isc_movefile(const char *, const char *);
extern int isc_gethexstring(unsigned char *, size_t, int, FILE *,
int *);
extern void isc_puthexstring(FILE *, const unsigned char *, size_t,
size_t, size_t, const char *);
extern void isc_tohex(const unsigned char *, size_t, char *);
#endif /*_ISC_MISC_H*/

View File

@ -1,58 +0,0 @@
/* tree.h - declare structures used by tree library
*
* vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes]
* vix 27jun86 [broken out of tree.c]
*
* $Id: tree.h,v 1.1 2004/04/15 15:54:34 wkornew Exp $
*/
#ifndef _TREE_H_INCLUDED
#define _TREE_H_INCLUDED
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*
* tree_t is our package-specific anonymous pointer.
*/
#if defined(__STDC__) || defined(__GNUC__)
typedef void *tree_t;
#else
typedef char *tree_t;
#endif
/*
* Do not taint namespace
*/
#define tree_add __tree_add
#define tree_delete __tree_delete
#define tree_init __tree_init
#define tree_mung __tree_mung
#define tree_srch __tree_srch
#define tree_trav __tree_trav
typedef struct tree_s {
tree_t data;
struct tree_s *left, *right;
short bal;
}
tree;
void tree_init __P((tree **));
tree_t tree_srch __P((tree **, int (*)(), tree_t));
tree_t tree_add __P((tree **, int (*)(), tree_t, void (*)()));
int tree_delete __P((tree **, int (*)(), tree_t, void (*)()));
int tree_trav __P((tree **, int (*)()));
void tree_mung __P((tree **, void (*)()));
#endif /* _TREE_H_INCLUDED */