Vendor import of netgraph from FreeBSD-current 20080626
[dragonfly.git] / sys / netgraph7 / atm / ngatmbase.h
blob126cb0b0ec36fa32feb6023355e844c5c31f2e86
1 /*-
2 * Copyright (c) 2001-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
6 * Author: Harti Brandt <harti@freebsd.org>
8 * Redistribution of this software and documentation and use in source and
9 * binary forms, with or without modification, are permitted provided that
10 * the following conditions are met:
12 * 1. Redistributions of source code or documentation must retain the above
13 * copyright notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY FRAUNHOFER FOKUS
19 * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 * FRAUNHOFER FOKUS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
25 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * $FreeBSD: src/sys/netgraph/atm/ngatmbase.h,v 1.3 2005/01/07 01:45:40 imp Exp $
32 * In-kernel UNI stack message functions.
34 #ifndef _NETGRAPH_ATM_NGATMBASE_H_
35 #define _NETGRAPH_ATM_NGATMBASE_H_
37 /* forward declarations */
38 struct mbuf;
39 struct uni_msg;
41 struct mbuf *uni_msg_pack_mbuf(struct uni_msg *, void *, size_t);
43 #ifdef NGATM_DEBUG
45 struct uni_msg *_uni_msg_alloc(size_t, const char *, int);
46 struct uni_msg *_uni_msg_build(const char *, int, void *, ...);
47 void _uni_msg_destroy(struct uni_msg *, const char *, int);
48 int _uni_msg_unpack_mbuf(struct mbuf *, struct uni_msg **, const char *, int);
50 #define uni_msg_alloc(S) _uni_msg_alloc((S), __FILE__, __LINE__)
51 #define uni_msg_build(P...) _uni_msg_build(__FILE__, __LINE__, P)
52 #define uni_msg_destroy(M) _uni_msg_destroy((M), __FILE__, __LINE__)
53 #define uni_msg_unpack_mbuf(M, PP) \
54 _uni_msg_unpack_mbuf((M), (PP), __FILE__, __LINE__)
56 #else /* !NGATM_DEBUG */
58 struct uni_msg *uni_msg_alloc(size_t);
59 struct uni_msg *uni_msg_build(void *, ...);
60 void uni_msg_destroy(struct uni_msg *);
61 int uni_msg_unpack_mbuf(struct mbuf *, struct uni_msg **);
63 #endif
64 #endif