]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sys/netgraph/atm/ngatmbase.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / sys / netgraph / atm / ngatmbase.h
1 /*-
2  * Copyright (c) 2001-2003
3  *      Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4  *      All rights reserved.
5  *
6  * Author: Harti Brandt <harti@freebsd.org>
7  *
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:
11  *
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.
17  *
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.
29  *
30  * $FreeBSD$
31  *
32  * In-kernel UNI stack message functions.
33  */
34 #ifndef _NETGRAPH_ATM_NGATMBASE_H_
35 #define _NETGRAPH_ATM_NGATMBASE_H_
36
37 /* forward declarations */
38 struct mbuf;
39 struct uni_msg;
40
41 struct mbuf *uni_msg_pack_mbuf(struct uni_msg *, void *, size_t);
42
43 #ifdef NGATM_DEBUG
44
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);
49
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__)
55
56 #else /* !NGATM_DEBUG */
57
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 **);
62
63 #endif
64 #endif