本文整理汇总了C++中KLIPS_PRINT函数的典型用法代码示例。如果您正苦于以下问题:C++ KLIPS_PRINT函数的具体用法?C++ KLIPS_PRINT怎么用?C++ KLIPS_PRINT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了KLIPS_PRINT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ipsec_mast_open
DEBUG_NO_STATIC int ipsec_mast_open(struct net_device *dev)
{
struct mastpriv *prv = netdev_to_mastpriv(dev);
prv = prv;
/*
* Can't open until attached.
*/
KLIPS_PRINT(debug_mast & DB_MAST_INIT,
"klips_debug:ipsec_mast_open: "
"dev = %s\n",
dev->name);
return 0;
}
示例2: ipsec_klipsdebug_show
IPSEC_PROCFS_DEBUG_NO_STATIC
int ipsec_klipsdebug_show(struct seq_file *seq, void *offset)
{
KLIPS_PRINT(debug_tunnel & DB_TN_PROCFS,
"klips_debug:ipsec_klipsdebug_show: seq=%p, offset=%p\n",
seq, offset);
seq_printf(seq, "debug_tunnel=%08x.\n", debug_tunnel);
seq_printf(seq, "debug_xform=%08x.\n", debug_xform);
seq_printf(seq, "debug_eroute=%08x.\n", debug_eroute);
seq_printf(seq, "debug_spi=%08x.\n", debug_spi);
seq_printf(seq, "debug_radij=%08x.\n", debug_radij);
seq_printf(seq, "debug_esp=%08x.\n", debug_esp);
seq_printf(seq, "debug_ah=%08x.\n", debug_ah);
seq_printf(seq, "debug_rcv=%08x.\n", debug_rcv);
seq_printf(seq, "debug_pfkey=%08x.\n", debug_pfkey);
return 0;
}
示例3: ipsec_saref_freelist_init
int
ipsec_saref_freelist_init(void)
{
int i;
KLIPS_PRINT(debug_xform,
"klips_debug:ipsec_saref_freelist_init: "
"initialising %u elements of FreeList.\n",
IPSEC_SA_REF_FREELIST_NUM_ENTRIES);
for(i = 0; i < IPSEC_SA_REF_FREELIST_NUM_ENTRIES; i++) {
ipsec_sadb.refFreeList[i] = IPSEC_SAREF_NULL;
}
ipsec_sadb.refFreeListHead = IPSEC_SAREF_NULL;
ipsec_sadb.refFreeListCont = IPSEC_SAREF_FIRST;
ipsec_sadb.refFreeListTail = IPSEC_SAREF_NULL;
return 0;
}
示例4: ipsec_saraw_show
IPSEC_PROCFS_DEBUG_NO_STATIC
int ipsec_saraw_show(struct seq_file *seq, void *offset)
{
struct ipsec_sa *sa_p;
extern struct ipsec_sa *ipsec_sa_raw;
KLIPS_PRINT(debug_tunnel & DB_TN_PROCFS,
"klips_debug:ipsec_saraw_show: seq=%p offset=%p\n",
seq, offset);
spin_lock_bh(&tdb_lock);
for (sa_p = ipsec_sa_raw; sa_p; sa_p = sa_p->ips_raw)
ipsec_spi_format(sa_p, seq);
spin_unlock_bh(&tdb_lock);
return 0;
}
示例5: klips_get_secpath_refs
static void klips_get_secpath_refs(struct sec_path *sp,
xfrm_sec_unique_t *refme, xfrm_sec_unique_t *refhim)
{
struct ipsec_sa *sa1;
if(sp==NULL) return;
KLIPS_PRINT(debug_rcv, "klips_debug:klips_get_secpath_refs: "
"retrieving saref=%u from sp=%p\n",
sp->ref, sp);
*refme = sp->ref;
sa1 = ipsec_sa_getbyref(sp->ref, IPSEC_REFOTHER);
*refhim = sa1 ? sa1->ips_refhim : 0;
if(sa1)
ipsec_sa_put(sa1, IPSEC_REFOTHER);
}
示例6: ipsec_spi_show
IPSEC_PROCFS_DEBUG_NO_STATIC
int ipsec_spi_show(struct seq_file *seq, void *offset)
{
int i;
struct ipsec_sa *sa_p;
KLIPS_PRINT(debug_tunnel & DB_TN_PROCFS,
"klips_debug:ipsec_spi_show: seq=%p offset=%p\n",
seq, offset);
spin_lock_bh(&tdb_lock);
for (i = 0; i < SADB_HASHMOD; i++)
for (sa_p = ipsec_sadb_hash[i]; sa_p; sa_p = sa_p->ips_hnext)
ipsec_spi_format(sa_p, seq);
spin_unlock_bh(&tdb_lock);
return 0;
}
示例7: ipsec_sa_alloc
struct ipsec_sa*
ipsec_sa_alloc(int*error) /* pass in error var by pointer */
{
struct ipsec_sa* ips;
if((ips = kmalloc(sizeof(*ips), GFP_ATOMIC) ) == NULL) {
KLIPS_PRINT(debug_xform,
"ipsec_sa_alloc: "
"memory allocation error\n");
*error = -ENOMEM;
return NULL;
}
memset((caddr_t)ips, 0, sizeof(*ips));
/* return with at least counter = 1 */
ipsec_sa_get(ips);
*error = 0;
return(ips);
}
示例8: ipsec_mast_neigh_setup_dev
DEBUG_NO_STATIC int
ipsec_mast_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p)
{
KLIPS_PRINT(debug_mast & DB_MAST_REVEC,
"klips_debug:ipsec_mast_neigh_setup_dev: "
"setting up %s\n",
dev ? dev->name : "NULL");
if (p->tbl->family == AF_INET) {
p->neigh_setup = ipsec_mast_neigh_setup;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
NEIGH_VAR_SET(p, UCAST_PROBES, 0);
NEIGH_VAR_SET(p, MCAST_PROBES, 0);
#else
p->ucast_probes = 0;
p->mcast_probes = 0;
#endif
}
return 0;
}
示例9: ipsec_sa_untern
void ipsec_sa_untern(struct ipsec_sa *ips)
{
IPsecSAref_t ref = ips->ips_ref;
int error;
/* verify that we are removing correct item! */
error = ipsec_saref_verify_slot(ref);
if (error)
return;
if (IPsecSAref2SA(ref) == ips) {
IPsecSAref2SA(ref) = NULL;
ipsec_sa_put(ips, IPSEC_REFINTERN);
} else {
KLIPS_PRINT(debug_xform,
"ipsec_sa_untern: "
"ref=%u -> %p but untern'ing %p\n", ref,
IPsecSAref2SA(ref), ips);
}
}
示例10: ipsec_saref_show
IPSEC_PROCFS_DEBUG_NO_STATIC
int ipsec_saref_show(struct seq_file *seq, void *offset)
{
KLIPS_PRINT(debug_tunnel & DB_TN_PROCFS,
"klips_debug:ipsec_saref_show: seq=%p offset=%p\n",
seq, offset);
#ifdef IP_IPSEC_REFINFO
seq_printf(seq, "refinfo patch applied\n");
#endif
#ifdef IP_IPSEC_BINDREF
seq_printf(seq, "bindref patch applied\n");
#endif
#ifdef CONFIG_INET_IPSEC_SAREF
seq_printf(seq, "saref enabled (%s)\n", ipsec_version_code());
#else
seq_printf(seq, "saref disabled (%s)\n", ipsec_version_code());
#endif
return 0;
}
示例11: ipsec_sa_add
/*
The ipsec_sa table better *NOT* be locked before it is handed in, or SMP locks will happen
*/
int ipsec_sa_add(struct ipsec_sa *ips)
{
int error = 0;
unsigned int hashval;
if (ips == NULL) {
KLIPS_PRINT(debug_xform,
"klips_error:ipsec_sa_add: "
"null pointer passed in!\n");
return -ENODATA;
}
hashval = IPS_HASH(&ips->ips_said);
ipsec_sa_get(ips, IPSEC_REFSAADD);
spin_lock_bh(&tdb_lock);
ips->ips_hnext = ipsec_sadb_hash[hashval];
ipsec_sadb_hash[hashval] = ips;
spin_unlock_bh(&tdb_lock);
return error;
}
示例12: ipsec_sa_put
/*
The tdb table better *NOT* be locked before it is handed in, or SMP locks will happen
*/
int
ipsec_sa_put(struct ipsec_sa *ips)
{
int error = 0;
unsigned int hashval;
if(!ips) {
KLIPS_PRINT(debug_xform,
"klips_error:puttdb: "
"null pointer passed in!\n");
return -ENODATA;
}
hashval = ((ips->ips_said.spi + ips->ips_said.dst.s_addr + ips->ips_said.proto) % SADB_HASHMOD);
spin_lock_bh(&tdb_lock);
ips->ips_hnext = ipsec_sadb_hash[hashval];
ipsec_sadb_hash[hashval] = ips;
spin_unlock_bh(&tdb_lock);
return error;
}
示例13: ipsec_mast_xsm_complete
static void
ipsec_mast_xsm_complete(
struct ipsec_xmit_state *ixs,
enum ipsec_xmit_value stat)
{
if (stat != IPSEC_XMIT_OK) {
KLIPS_PRINT(debug_mast,
"klips_debug:ipsec_mast_xsm_complete: "
"ipsec_xsm failed: %d\n",
stat);
goto cleanup;
}
#ifdef NAT_TRAVERSAL
/* do any final NAT-encapsulation */
stat = ipsec_nat_encap(ixs);
if(stat != IPSEC_XMIT_OK) {
goto cleanup;
}
#endif
ipsec_xmit_send(ixs);
cleanup:
ipsec_xmit_cleanup(ixs);
if(ixs->ipsp) {
ipsec_sa_put(ixs->ipsp, IPSEC_REFOTHER);
ixs->ipsp=NULL;
}
if(ixs->skb) {
ipsec_kfree_skb(ixs->skb);
ixs->skb=NULL;
}
ipsec_xmit_state_delete(ixs);
}
示例14: ipsec_rcv_ipcomp_checks
enum ipsec_rcv_value
ipsec_rcv_ipcomp_checks(struct ipsec_rcv_state *irs,
struct sk_buff *skb)
{
int ipcompminlen;
ipcompminlen = sizeof(struct iphdr);
if(skb->len < (ipcompminlen + sizeof(struct ipcomphdr))) {
KLIPS_PRINT(debug_rcv & DB_RX_INAU,
"klips_debug:ipsec_rcv_ipcomp_checks: "
"runt comp packet of skb->len=%d received from %s, dropped.\n",
skb->len,
irs->ipsaddr_txt);
if(irs->stats) {
irs->stats->rx_errors++;
}
return IPSEC_RCV_BADLEN;
}
irs->protostuff.ipcompstuff.compp = (struct ipcomphdr *)skb_transport_header(skb);
irs->said.spi = htonl((__u32)ntohs(irs->protostuff.ipcompstuff.compp->ipcomp_cpi));
return IPSEC_RCV_OK;
}
示例15: ipsec_sadb_init
int
ipsec_sadb_init(void)
{
int error = 0;
unsigned i;
for(i = 0; i < SADB_HASHMOD; i++) {
ipsec_sadb_hash[i] = NULL;
}
/* parts above are for the old style SADB hash table */
/* initialise SA reference table */
/* initialise the main table */
KLIPS_PRINT(debug_xform,
"klips_debug:ipsec_sadb_init: "
"initialising main table of size %u (2 ^ %u).\n",
IPSEC_SA_REF_MAINTABLE_NUM_ENTRIES,
IPSEC_SA_REF_MAINTABLE_IDX_WIDTH);
{
unsigned table;
for(table = 0; table < IPSEC_SA_REF_MAINTABLE_NUM_ENTRIES; table++) {
ipsec_sadb.refTable[table] = NULL;
}
}
/* allocate the first sub-table */
error = ipsec_SArefSubTable_alloc(0);
if(error) {
return error;
}
error = ipsec_saref_freelist_init();
return error;
}