sctp_os_bsd.h (237540) | sctp_os_bsd.h (237715) |
---|---|
1/*- 2 * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_os_bsd.h 237540 2012-06-24 21:25:54Z tuexen $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_os_bsd.h 237715 2012-06-28 16:01:08Z tuexen $"); |
35 36#ifndef _NETINET_SCTP_OS_BSD_H_ 37#define _NETINET_SCTP_OS_BSD_H_ 38/* 39 * includes 40 */ 41#include "opt_ipsec.h" 42#include "opt_compat.h" --- 129 unchanged lines hidden (view full) --- 172#define SCTPDBG_ADDR(level, addr) \ 173{ \ 174 do { \ 175 if (SCTP_BASE_SYSCTL(sctp_debug_on) & level ) { \ 176 sctp_print_address(addr); \ 177 } \ 178 } while (0); \ 179} | 35 36#ifndef _NETINET_SCTP_OS_BSD_H_ 37#define _NETINET_SCTP_OS_BSD_H_ 38/* 39 * includes 40 */ 41#include "opt_ipsec.h" 42#include "opt_compat.h" --- 129 unchanged lines hidden (view full) --- 172#define SCTPDBG_ADDR(level, addr) \ 173{ \ 174 do { \ 175 if (SCTP_BASE_SYSCTL(sctp_debug_on) & level ) { \ 176 sctp_print_address(addr); \ 177 } \ 178 } while (0); \ 179} |
180#define SCTPDBG_PKT(level, iph, sh) \ 181{ \ 182 do { \ 183 if (SCTP_BASE_SYSCTL(sctp_debug_on) & level) { \ 184 sctp_print_address_pkt(iph, sh); \ 185 } \ 186 } while (0); \ 187} | |
188#else 189#define SCTPDBG(level, params...) 190#define SCTPDBG_ADDR(level, addr) | 180#else 181#define SCTPDBG(level, params...) 182#define SCTPDBG_ADDR(level, addr) |
191#define SCTPDBG_PKT(level, iph, sh) | |
192#endif 193 194#ifdef SCTP_LTRACE_CHUNKS 195#define SCTP_LTRACE_CHK(a, b, c, d) if(SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LTRACE_CHUNK_ENABLE) SCTP_CTR6(KTR_SUBSYS, "SCTP:%d[%d]:%x-%x-%x-%x", SCTP_LOG_CHUNK_PROC, 0, a, b, c, d) 196#else 197#define SCTP_LTRACE_CHK(a, b, c, d) 198#endif 199 --- 189 unchanged lines hidden (view full) --- 389#define SCTP_IS_IT_LOOPBACK(m) ((m->m_flags & M_PKTHDR) && ((m->m_pkthdr.rcvif == NULL) || (m->m_pkthdr.rcvif->if_type == IFT_LOOP))) 390 391 392/* This converts any input packet header 393 * into the chain of data holders, for BSD 394 * its a NOP. 395 */ 396 | 183#endif 184 185#ifdef SCTP_LTRACE_CHUNKS 186#define SCTP_LTRACE_CHK(a, b, c, d) if(SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LTRACE_CHUNK_ENABLE) SCTP_CTR6(KTR_SUBSYS, "SCTP:%d[%d]:%x-%x-%x-%x", SCTP_LOG_CHUNK_PROC, 0, a, b, c, d) 187#else 188#define SCTP_LTRACE_CHK(a, b, c, d) 189#endif 190 --- 189 unchanged lines hidden (view full) --- 380#define SCTP_IS_IT_LOOPBACK(m) ((m->m_flags & M_PKTHDR) && ((m->m_pkthdr.rcvif == NULL) || (m->m_pkthdr.rcvif->if_type == IFT_LOOP))) 381 382 383/* This converts any input packet header 384 * into the chain of data holders, for BSD 385 * its a NOP. 386 */ 387 |
397/* Macro's for getting length from V6/V4 header */ 398#define SCTP_GET_IPV4_LENGTH(iph) (iph->ip_len) 399#define SCTP_GET_IPV6_LENGTH(ip6) (ntohs(ip6->ip6_plen)) 400 | |
401/* get the v6 hop limit */ 402#define SCTP_GET_HLIM(inp, ro) in6_selecthlim((struct in6pcb *)&inp->ip_inp.inp, (ro ? (ro->ro_rt ? (ro->ro_rt->rt_ifp) : (NULL)) : (NULL))); 403 404/* is the endpoint v6only? */ 405#define SCTP_IPV6_V6ONLY(inp) (((struct inpcb *)inp)->inp_flags & IN6P_IPV6_V6ONLY) 406/* is the socket non-blocking? */ 407#define SCTP_SO_IS_NBIO(so) ((so)->so_state & SS_NBIO) 408#define SCTP_SET_SO_NBIO(so) ((so)->so_state |= SS_NBIO) --- 108 unchanged lines hidden --- | 388/* get the v6 hop limit */ 389#define SCTP_GET_HLIM(inp, ro) in6_selecthlim((struct in6pcb *)&inp->ip_inp.inp, (ro ? (ro->ro_rt ? (ro->ro_rt->rt_ifp) : (NULL)) : (NULL))); 390 391/* is the endpoint v6only? */ 392#define SCTP_IPV6_V6ONLY(inp) (((struct inpcb *)inp)->inp_flags & IN6P_IPV6_V6ONLY) 393/* is the socket non-blocking? */ 394#define SCTP_SO_IS_NBIO(so) ((so)->so_state & SS_NBIO) 395#define SCTP_SET_SO_NBIO(so) ((so)->so_state |= SS_NBIO) --- 108 unchanged lines hidden --- |