keysock.c (303989a2f30ecfadc2b76022da579a61008b2951) | keysock.c (3f2e28fe9ffbb70d26e5cc7abba248e981434853) |
---|---|
1/* $FreeBSD$ */ 2/* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 63 unchanged lines hidden (view full) --- 72static int key_sendup0 __P((struct rawcb *, struct mbuf *, int)); 73 74struct pfkeystat pfkeystat; 75 76/* 77 * key_output() 78 */ 79int | 1/* $FreeBSD$ */ 2/* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 63 unchanged lines hidden (view full) --- 72static int key_sendup0 __P((struct rawcb *, struct mbuf *, int)); 73 74struct pfkeystat pfkeystat; 75 76/* 77 * key_output() 78 */ 79int |
80#if __STDC__ 81key_output(struct mbuf *m, ...) 82#else 83key_output(m, va_alist) 84 struct mbuf *m; 85 va_dcl 86#endif | 80key_output(struct mbuf *m, struct socket *so) |
87{ 88 struct sadb_msg *msg; 89 int len, error = 0; 90 int s; | 81{ 82 struct sadb_msg *msg; 83 int len, error = 0; 84 int s; |
91 struct socket *so; 92 va_list ap; | |
93 | 85 |
94 va_start(ap, m); 95 so = va_arg(ap, struct socket *); 96 va_end(ap); 97 | |
98 if (m == 0) 99 panic("%s: NULL pointer was passed.\n", __func__); 100 101 pfkeystat.out_total++; 102 pfkeystat.out_bytes += m->m_pkthdr.len; 103 104 len = m->m_pkthdr.len; 105 if (len < sizeof(struct sadb_msg)) { --- 479 unchanged lines hidden (view full) --- 585extern struct domain keydomain; 586 587struct protosw keysw[] = { 588{ 589 .pr_type = SOCK_RAW, 590 .pr_domain = &keydomain, 591 .pr_protocol = PF_KEY_V2, 592 .pr_flags = PR_ATOMIC|PR_ADDR, | 86 if (m == 0) 87 panic("%s: NULL pointer was passed.\n", __func__); 88 89 pfkeystat.out_total++; 90 pfkeystat.out_bytes += m->m_pkthdr.len; 91 92 len = m->m_pkthdr.len; 93 if (len < sizeof(struct sadb_msg)) { --- 479 unchanged lines hidden (view full) --- 573extern struct domain keydomain; 574 575struct protosw keysw[] = { 576{ 577 .pr_type = SOCK_RAW, 578 .pr_domain = &keydomain, 579 .pr_protocol = PF_KEY_V2, 580 .pr_flags = PR_ATOMIC|PR_ADDR, |
593 .pr_output = (pr_output_t *)key_output, | 581 .pr_output = key_output, |
594 .pr_ctlinput = raw_ctlinput, 595 .pr_init = raw_init, 596 .pr_usrreqs = &key_usrreqs 597} 598}; 599 600static void 601key_init0(void) --- 14 unchanged lines hidden --- | 582 .pr_ctlinput = raw_ctlinput, 583 .pr_init = raw_init, 584 .pr_usrreqs = &key_usrreqs 585} 586}; 587 588static void 589key_init0(void) --- 14 unchanged lines hidden --- |