MFC r1.27:
[dragonfly.git] / sys / netgraph7 / atm / ngatmbase.h
blob8539a2534647aa9d32de0ea19668d229fb840fe3
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 $
31 * $DragonFly: src/sys/netgraph7/atm/ngatmbase.h,v 1.2 2008/06/26 23:05:37 dillon Exp $
33 * In-kernel UNI stack message functions.
35 #ifndef _NETGRAPH_ATM_NGATMBASE_H_
36 #define _NETGRAPH_ATM_NGATMBASE_H_
38 /* forward declarations */
39 struct mbuf;
40 struct uni_msg;
42 struct mbuf *uni_msg_pack_mbuf(struct uni_msg *, void *, size_t);
44 #ifdef NGATM_DEBUG
46 struct uni_msg *_uni_msg_alloc(size_t, const char *, int);
47 struct uni_msg *_uni_msg_build(const char *, int, void *, ...);
48 void _uni_msg_destroy(struct uni_msg *, const char *, int);
49 int _uni_msg_unpack_mbuf(struct mbuf *, struct uni_msg **, const char *, int);
51 #define uni_msg_alloc(S) _uni_msg_alloc((S), __FILE__, __LINE__)
52 #define uni_msg_build(P...) _uni_msg_build(__FILE__, __LINE__, P)
53 #define uni_msg_destroy(M) _uni_msg_destroy((M), __FILE__, __LINE__)
54 #define uni_msg_unpack_mbuf(M, PP) \
55 _uni_msg_unpack_mbuf((M), (PP), __FILE__, __LINE__)
57 #else /* !NGATM_DEBUG */
59 struct uni_msg *uni_msg_alloc(size_t);
60 struct uni_msg *uni_msg_build(void *, ...);
61 void uni_msg_destroy(struct uni_msg *);
62 int uni_msg_unpack_mbuf(struct mbuf *, struct uni_msg **);
64 #endif
65 #endif