sctp_os.h revision 228653
1163953Srrs/*-
2169382Srrs * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved.
3218319Srrs * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved.
4218319Srrs * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved.
5163953Srrs *
6163953Srrs * Redistribution and use in source and binary forms, with or without
7163953Srrs * modification, are permitted provided that the following conditions are met:
8163953Srrs *
9163953Srrs * a) Redistributions of source code must retain the above copyright notice,
10228653Stuexen *    this list of conditions and the following disclaimer.
11163953Srrs *
12163953Srrs * b) Redistributions in binary form must reproduce the above copyright
13163953Srrs *    notice, this list of conditions and the following disclaimer in
14228653Stuexen *    the documentation and/or other materials provided with the distribution.
15163953Srrs *
16163953Srrs * c) Neither the name of Cisco Systems, Inc. nor the names of its
17163953Srrs *    contributors may be used to endorse or promote products derived
18163953Srrs *    from this software without specific prior written permission.
19163953Srrs *
20163953Srrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21163953Srrs * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22163953Srrs * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23163953Srrs * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24163953Srrs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25163953Srrs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26163953Srrs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27163953Srrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28163953Srrs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29163953Srrs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30163953Srrs * THE POSSIBILITY OF SUCH DAMAGE.
31163953Srrs */
32163954Srrs#include <sys/cdefs.h>
33163953Srrs__FBSDID("$FreeBSD: head/sys/netinet/sctp_os.h 228653 2011-12-17 19:21:40Z tuexen $");
34163953Srrs#ifndef __sctp_os_h__
35163953Srrs#define __sctp_os_h__
36163953Srrs
37163953Srrs/*
38163953Srrs * General kernel memory allocation:
39163953Srrs *  SCTP_MALLOC(element, type, size, name)
40163953Srrs *  SCTP_FREE(element)
41163953Srrs * Kernel memory allocation for "soname"- memory must be zeroed.
42163953Srrs *  SCTP_MALLOC_SONAME(name, type, size)
43163953Srrs *  SCTP_FREE_SONAME(name)
44163953Srrs */
45163953Srrs
46163953Srrs/*
47163953Srrs * Zone(pool) allocation routines: MUST be defined for each OS.
48163953Srrs *  zone = zone/pool pointer.
49163953Srrs *  name = string name of the zone/pool.
50163953Srrs *  size = size of each zone/pool element.
51163953Srrs *  number = number of elements in zone/pool.
52166675Srrs *  type = structure type to allocate
53163953Srrs *
54163953Srrs * sctp_zone_t
55163953Srrs * SCTP_ZONE_INIT(zone, name, size, number)
56166675Srrs * SCTP_ZONE_GET(zone, type)
57163953Srrs * SCTP_ZONE_FREE(zone, element)
58163953Srrs * SCTP_ZONE_DESTROY(zone)
59163953Srrs */
60163953Srrs
61163953Srrs#include <netinet/sctp_os_bsd.h>
62163953Srrs
63163953Srrs
64163953Srrs
65165647Srrs
66171943Srrs
67167598Srrs/* All os's must implement this address gatherer. If
68167598Srrs * no VRF's exist, then vrf 0 is the only one and all
69167598Srrs * addresses and ifn's live here.
70167598Srrs */
71167598Srrs#define SCTP_DEFAULT_VRF 0
72167598Srrsvoid sctp_init_vrf_list(int vrfid);
73167598Srrs
74163953Srrs#endif
75