1139823Simp/*- 2121461Sharti * Copyright (c) 2001-2003 3121461Sharti * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4121461Sharti * All rights reserved. 5121461Sharti * 6121461Sharti * Author: Harti Brandt <harti@freebsd.org> 7121461Sharti * 8121461Sharti * Redistribution of this software and documentation and use in source and 9121461Sharti * binary forms, with or without modification, are permitted provided that 10121461Sharti * the following conditions are met: 11121461Sharti * 12121461Sharti * 1. Redistributions of source code or documentation must retain the above 13121461Sharti * copyright notice, this list of conditions and the following disclaimer. 14121461Sharti * 2. Redistributions in binary form must reproduce the above copyright 15121461Sharti * notice, this list of conditions and the following disclaimer in the 16121461Sharti * documentation and/or other materials provided with the distribution. 17121461Sharti * 18121461Sharti * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY FRAUNHOFER FOKUS 19121461Sharti * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 20121461Sharti * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 21121461Sharti * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22121461Sharti * FRAUNHOFER FOKUS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23121461Sharti * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24121461Sharti * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 25121461Sharti * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26121461Sharti * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27121461Sharti * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 28121461Sharti * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29121461Sharti * 30121461Sharti * $FreeBSD$ 31121461Sharti * 32121461Sharti * In-kernel UNI stack message functions. 33121461Sharti */ 34122614Sharti#ifndef _NETGRAPH_ATM_NGATMBASE_H_ 35122614Sharti#define _NETGRAPH_ATM_NGATMBASE_H_ 36121461Sharti 37121461Sharti/* forward declarations */ 38121461Shartistruct mbuf; 39121461Shartistruct uni_msg; 40121461Sharti 41121461Shartistruct mbuf *uni_msg_pack_mbuf(struct uni_msg *, void *, size_t); 42121461Sharti 43121461Sharti#ifdef NGATM_DEBUG 44121461Sharti 45121461Shartistruct uni_msg *_uni_msg_alloc(size_t, const char *, int); 46121461Shartistruct uni_msg *_uni_msg_build(const char *, int, void *, ...); 47121461Shartivoid _uni_msg_destroy(struct uni_msg *, const char *, int); 48121461Shartiint _uni_msg_unpack_mbuf(struct mbuf *, struct uni_msg **, const char *, int); 49121461Sharti 50121461Sharti#define uni_msg_alloc(S) _uni_msg_alloc((S), __FILE__, __LINE__) 51121461Sharti#define uni_msg_build(P...) _uni_msg_build(__FILE__, __LINE__, P) 52121461Sharti#define uni_msg_destroy(M) _uni_msg_destroy((M), __FILE__, __LINE__) 53121461Sharti#define uni_msg_unpack_mbuf(M, PP) \ 54121461Sharti _uni_msg_unpack_mbuf((M), (PP), __FILE__, __LINE__) 55121461Sharti 56121461Sharti#else /* !NGATM_DEBUG */ 57121461Sharti 58121461Shartistruct uni_msg *uni_msg_alloc(size_t); 59121461Shartistruct uni_msg *uni_msg_build(void *, ...); 60121461Shartivoid uni_msg_destroy(struct uni_msg *); 61121461Shartiint uni_msg_unpack_mbuf(struct mbuf *, struct uni_msg **); 62121461Sharti 63121461Sharti#endif 64121461Sharti#endif 65