Deleted Added
full compact
sctp_os_bsd.h (170138) sctp_os_bsd.h (170181)
1/*-
2 * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

--- 14 unchanged lines hidden (view full) ---

23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

--- 14 unchanged lines hidden (view full) ---

23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/netinet/sctp_os_bsd.h 170138 2007-05-30 17:39:45Z rrs $");
31__FBSDID("$FreeBSD: head/sys/netinet/sctp_os_bsd.h 170181 2007-06-01 11:19:54Z rrs $");
32#ifndef __sctp_os_bsd_h__
33#define __sctp_os_bsd_h__
34/*
35 * includes
36 */
37#include "opt_ipsec.h"
38#include "opt_compat.h"
39#include "opt_inet6.h"

--- 227 unchanged lines hidden (view full) ---

267 * 4 16k packets before we would hit
268 * a problem.
269 */
270#define SCTP_PKTLOG_WRITERS_NEED_LOCK 3
271
272/*************************/
273/* MTU */
274/*************************/
32#ifndef __sctp_os_bsd_h__
33#define __sctp_os_bsd_h__
34/*
35 * includes
36 */
37#include "opt_ipsec.h"
38#include "opt_compat.h"
39#include "opt_inet6.h"

--- 227 unchanged lines hidden (view full) ---

267 * 4 16k packets before we would hit
268 * a problem.
269 */
270#define SCTP_PKTLOG_WRITERS_NEED_LOCK 3
271
272/*************************/
273/* MTU */
274/*************************/
275#define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index) ((struct ifnet *)ifn)->if_mtu
275#define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu
276#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_rmx.rmx_mtu : 0)
277#define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0)
278#define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \
279 if (rt != NULL) \
280 rt->rt_rmx.rmx_mtu = mtu; \
281 } while(0)
282
283/* (de-)register interface event notifications */
276#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_rmx.rmx_mtu : 0)
277#define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0)
278#define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \
279 if (rt != NULL) \
280 rt->rt_rmx.rmx_mtu = mtu; \
281 } while(0)
282
283/* (de-)register interface event notifications */
284#define SCTP_REGISTER_INTERFACE(ifhandle, ifname)
285#define SCTP_DEREGISTER_INTERFACE(ifhandle, ifname)
284#define SCTP_REGISTER_INTERFACE(ifhandle, af)
285#define SCTP_DEREGISTER_INTERFACE(ifhandle, af)
286
287/*************************/
288/* These are for logging */
289/*************************/
290/* return the base ext data pointer */
291#define SCTP_BUF_EXTEND_BASE(m) (m->m_ext.ext_buf)
292 /* return the refcnt of the data pointer */
293#define SCTP_BUF_EXTEND_REFCNT(m) (*m->m_ext.ref_cnt)

--- 15 unchanged lines hidden (view full) ---

309#define SCTP_RELEASE_PKT(m) sctp_m_freem(m)
310
311static inline int
312SCTP_GET_PKT_VRFID(void *m, uint32_t vrf_id)
313{
314 vrf_id = SCTP_DEFAULT_VRFID;
315 return (0);
316}
286
287/*************************/
288/* These are for logging */
289/*************************/
290/* return the base ext data pointer */
291#define SCTP_BUF_EXTEND_BASE(m) (m->m_ext.ext_buf)
292 /* return the refcnt of the data pointer */
293#define SCTP_BUF_EXTEND_REFCNT(m) (*m->m_ext.ref_cnt)

--- 15 unchanged lines hidden (view full) ---

309#define SCTP_RELEASE_PKT(m) sctp_m_freem(m)
310
311static inline int
312SCTP_GET_PKT_VRFID(void *m, uint32_t vrf_id)
313{
314 vrf_id = SCTP_DEFAULT_VRFID;
315 return (0);
316}
317static inline int
318SCTP_GET_PKT_TABLEID(void *m, uint32_t table_id)
319{
320 table_id = SCTP_DEFAULT_TABLEID;
321 return (0);
322}
323
324/* Attach the chain of data into the sendable packet. */
325#define SCTP_ATTACH_CHAIN(pak, m, packet_length) do { \
326 pak = m; \
327 pak->m_pkthdr.len = packet_length; \
328 } while(0)
329
330/* Other m_pkthdr type things */

--- 35 unchanged lines hidden (view full) ---

366#define SCTP_SB_LIMIT_SND(so) so->so_snd.sb_hiwat
367
368/*
369 * routes, output, etc.
370 */
371typedef struct route sctp_route_t;
372typedef struct rtentry sctp_rtentry_t;
373
317
318/* Attach the chain of data into the sendable packet. */
319#define SCTP_ATTACH_CHAIN(pak, m, packet_length) do { \
320 pak = m; \
321 pak->m_pkthdr.len = packet_length; \
322 } while(0)
323
324/* Other m_pkthdr type things */

--- 35 unchanged lines hidden (view full) ---

360#define SCTP_SB_LIMIT_SND(so) so->so_snd.sb_hiwat
361
362/*
363 * routes, output, etc.
364 */
365typedef struct route sctp_route_t;
366typedef struct rtentry sctp_rtentry_t;
367
374#define SCTP_RTALLOC(ro, vrf_id, table_id) rtalloc_ign((struct route *)ro, 0UL)
368#define SCTP_RTALLOC(ro, vrf_id) rtalloc_ign((struct route *)ro, 0UL)
375
376/* Future zero copy wakeup/send function */
377#define SCTP_ZERO_COPY_EVENT(inp, so)
369
370/* Future zero copy wakeup/send function */
371#define SCTP_ZERO_COPY_EVENT(inp, so)
372/* This is re-pulse ourselves for sendbuf */
373#define SCTP_ZERO_COPY_SENDQ_EVENT(inp, so)
378
379/*
380 * IP output routines
381 */
374
375/*
376 * IP output routines
377 */
382#define SCTP_IP_OUTPUT(result, o_pak, ro, stcb, vrf_id, table_id) \
378#define SCTP_IP_OUTPUT(result, o_pak, ro, stcb, vrf_id) \
383{ \
384 int o_flgs = 0; \
385 if (stcb && stcb->sctp_ep && stcb->sctp_ep->sctp_socket) { \
386 o_flgs = IP_RAWOUTPUT | (stcb->sctp_ep->sctp_socket->so_options & SO_DONTROUTE); \
387 } else { \
388 o_flgs = IP_RAWOUTPUT; \
389 } \
390 result = ip_output(o_pak, NULL, ro, o_flgs, 0, NULL); \
391}
392
379{ \
380 int o_flgs = 0; \
381 if (stcb && stcb->sctp_ep && stcb->sctp_ep->sctp_socket) { \
382 o_flgs = IP_RAWOUTPUT | (stcb->sctp_ep->sctp_socket->so_options & SO_DONTROUTE); \
383 } else { \
384 o_flgs = IP_RAWOUTPUT; \
385 } \
386 result = ip_output(o_pak, NULL, ro, o_flgs, 0, NULL); \
387}
388
393#define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id, table_id) \
389#define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \
394{ \
395 if (stcb && stcb->sctp_ep) \
396 result = ip6_output(o_pak, \
397 ((struct in6pcb *)(stcb->sctp_ep))->in6p_outputopts, \
398 (ro), 0, 0, ifp, NULL); \
399 else \
400 result = ip6_output(o_pak, NULL, (ro), 0, 0, ifp, NULL); \
401}

--- 34 unchanged lines hidden ---
390{ \
391 if (stcb && stcb->sctp_ep) \
392 result = ip6_output(o_pak, \
393 ((struct in6pcb *)(stcb->sctp_ep))->in6p_outputopts, \
394 (ro), 0, 0, ifp, NULL); \
395 else \
396 result = ip6_output(o_pak, NULL, (ro), 0, 0, ifp, NULL); \
397}

--- 34 unchanged lines hidden ---