Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ngatmbase(4) [debian man page]

NGATMBASE(4)						   BSD Kernel Interfaces Manual 					      NGATMBASE(4)

NAME
ngatmbase -- netgraph ATM utility module SYNOPSIS
#include <netnatm/unimsg.h> #include <netgraph/atm/ngatmbase.h> struct mbuf * uni_msg_pack_mbuf(struct uni_msg *msg, void *hdr, size_t len); struct uni_msg * uni_msg_alloc(size_t len); struct uni_msg * uni_msg_build(void *buf, ...); void uni_msg_destroy(struct uni_msg *msg); int uni_msg_unpack_mbuf(struct mbuf *m, struct uni_msg *msgp); DESCRIPTION
This module provides utility functions for the handling of signalling messages to the NgATM modules. The uni_msg_pack_mbuf() function packs a message into one or several mbufs optionally prepending a header. The header is given by its address hdr and length len. If hdr is NULL or len equals 0, no header is prepended. Either msg or hdr may be NULL but not both. The uni_msg_pack_mbuf() function returns a pointer to the allocated mbuf chain or NULL in the case of an error. The uni_msg_alloc() function allocates a new message with space for at least len bytes. In the case of an error NULL is returned. The uni_msg_build() function constructs a message from pieces. Each piece is given by a pair of arguments, the first of type void * and the second a size_t. The list of pieces must be terminated by (void *)NULL. The uni_msg_destroy() function destroyes the messages and frees all the messages's memory. The uni_msg_unpack_mbuf() function unpacks an mbuf chain info a uni_msg. A pointer to the newly allocated message is stored in msgp and 0 is returned. In the case of an error (either when no packet header is found in the first mbuf or memory cannot be allocated) the function returns an appropriate error code. SEE ALSO
ng_ccatm(4), ng_sscfu(4), ng_sscop(4), ng_uni(4) AUTHORS
Harti Brandt <harti@FreeBSD.org> BSD
August 24, 2004 BSD

Check Out this Related Man Page

M_TAG(9)						   BSD Kernel Developer's Manual						  M_TAG(9)

NAME
m_tag, m_tag_get, m_tag_free, m_tag_prepend, m_tag_unlink, m_tag_delete, m_tag_delete_chain, m_tag_delete_nonpersistent, m_tag_find, m_tag_copy, m_tag_copy_chain, m_tag_init, m_tag_first, m_tag_next -- mbuf tagging interfaces SYNOPSIS
#include <sys/mbuf.h> struct m_tag * m_tag_get(int type, int len, int wait); void m_tag_free(struct m_tag *t); void m_tag_prepend(struct mbuf *m, struct m_tag *t); void m_tag_unlink(struct mbuf *m, struct m_tag *t); void m_tag_delete(struct mbuf *m, struct m_tag *t); void m_tag_delete_chain(struct mbuf *m, struct m_tag *t); void m_tag_delete_nonpersistent(struct mbuf *); struct m_tag * m_tag_find(struct mbuf *m, int type, struct m_tag *t); struct m_tag * m_tag_copy(struct m_tag *m); int m_tag_copy_chain(struct mbuf *to, struct mbuf *from); void m_tag_init(struct mbuf *m); struct m_tag * m_tag_first(struct mbuf *m); struct m_tag * m_tag_next(struct mbuf *m, struct m_tag *t); DESCRIPTION
The m_tag interface is used to ``tag'' mbufs. FUNCTIONS
m_tag_get(type, len, wait) Allocate an mbuf tag. type is one of the PACKET_TAG_ macros. len is the size of the data associated with the tag, in bytes. wait is either M_WAITOK or M_NOWAIT. m_tag_free(t) Free the mbuf tag t. m_tag_prepend(m, t) Prepend the mbuf tag t to the mbuf m. t will become the first tag of the mbuf m. When m is freed, t will also be freed. m_tag_unlink(m, t) Unlink the mbuf tag t from the mbuf m. m_tag_delete(m, t) The same as m_tag_unlink() followed by m_tag_free(). m_tag_delete_chain(m, t) Unlink and free mbuf tags beginning with the mbuf tag t from the mbuf m. If t is NULL, m_tag_delete_chain() unlinks and frees all mbuf tags associated with the mbuf m. m_tag_delete_nonpersistent(m) Unlink and free all non persistent tags associated with the mbuf m. m_tag_find(m, type, t) Find an mbuf tag with type type after the mbuf tag t in the tag chain associated with the mbuf m. If t is NULL, search from the first mbuf tag. If an mbuf tag is found, return a pointer to it. Otherwise return NULL. m_tag_copy(t) Copy an mbuf tag t. Return a new mbuf tag on success. Otherwise return NULL. m_tag_copy_chain(to, from) Copy all mbuf tags associated with the mbuf from to the mbuf to. If to already has any mbuf tags, they will be unlinked and freed beforehand. Return 1 on success. Otherwise return 0. m_tag_init(m) Initialize mbuf tag chain of the mbuf m. m_tag_first(m) Return the first mbuf tag associated with the mbuf m. Return NULL if no mbuf tags are found. m_tag_next(m, t) Return the next mbuf tag after t associated with the mbuf m. Return NULL if t is the last tag in the chain. CODE REFERENCES
The mbuf tagging interfaces are implemented within the file sys/kern/uipc_mbuf2.c. The PACKET_TAG_ macros are defined in the file sys/sys/mbuf.h. SEE ALSO
intro(9), malloc(9), mbuf(9) BUGS
The semantics of the term "persistent tag" are vague. BSD
September 7, 2004 BSD
Man Page