/* * Copyright (c) 2003-2006 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * * $Id: occ.h,v 1.13 2006/02/17 18:45:12 ca Exp $ */ #ifndef DADB_OCC_H #define DADB_OCC_H 1 #include "sm/generic.h" #include "sm/magic.h" #include "sm/types.h" #include "sm/time.h" #include "sm/net.h" /* IPv4 type */ #include "sm/pthread.h" #include "sm/queue.h" #include "sm/qmgr.h" #include "sm/occstr.h" #include "sm/io.h" #include "sm/occ.h" #if OCC_CHECK # define SM_IS_OCCX(occ_ctx) SM_REQUIRE_ISA((occ_ctx), SM_OCCX_MAGIC) # define SM_IS_OCCE(occ_entry) SM_REQUIRE_ISA((occ_entry), SM_OCCE_MAGIC) #else # define SM_IS_OCCE(occ_entry) SM_REQUIRE((occ_entry) != NULL) # define SM_IS_OCCX(occ_ctx) SM_REQUIRE((occ_ctx) != NULL) #endif #if DA_OCC_RSC sm_ret_T occ_entry_get(occ_ctx_P _occ_ctx, occ_entry_P *_pocc_entry, thr_lock_T _locktype); #endif sm_ret_T occ_sess_open(qmgr_ctx_P _qmgr_ctx, occ_ctx_P _occ_ctx, ipv4_T _srv_ipv4, occ_entry_P *_pocc_entry, thr_lock_T _locktype); sm_ret_T occ_sess_reuse(occ_ctx_P _occ_ctx, occ_entry_P _occ_entry, time_T _now, thr_lock_T _locktype); sm_ret_T occ_sess_close_entry(occ_ctx_P _occ_ctx, ipv4_T _srv_ipv4, bool _ok, time_T _now, uint32_t *_pflags, thr_lock_T _locktype); sm_ret_T occ_ta_close_entry(occ_ctx_P _occ_ctx, ipv4_T _srv_ipv4, time_T now, uint32_t *_pflags, thr_lock_T _locktype); /* default timeout for OCC entries */ #define OCCE_TO 60 /* seconds */ sm_ret_T occ_entry_free(occ_entry_hd_P _occ_fl_hd, occ_entry_P _occ_entry, pthread_mutex_t *_occ_mutex, thr_lock_T _locktype); sm_ret_T occ_entry_new(OCC_HT_P _occ_ht, occ_entry_hd_P _occ_fl_hd, ipv4_T _ipv4, occ_entry_P *_pocc_entry, pthread_mutex_t *_occ_mutex, thr_lock_T _locktype); #endif /* DADB_OCC_H */