Updated label mapping to better support the new fec -> nh relationship
[mpls-ldp-portable.git] / ldp / ldp_buf.h
bloba3589ffefed63feaa55392ae32f3e419fcc89429
2 /*
3 * Copyright (C) James R. Leu 2000
4 * jleu@mindspring.com
6 * This software is covered under the LGPL, for more
7 * info check out http://www.gnu.org/copyleft/lgpl.html
8 */
10 #ifndef _LDP_BUF_H_
11 #define _LDP_BUF_H_
13 #include "mpls_mm_impl.h"
15 #define MPLS_MSGMALLOC( e ) mplsLdp ## e ## Msg_t *test ## e ## Msg = (mplsLdp ## e ## Msg_t*)ldp_malloc(sizeof(mplsLdp ## e ## Msg_t))
16 #define MPLS_MSGSTRUCT( e ) mplsLdp ## e ## Msg_t test ## e ## Msg
17 #define MPLS_MSGPTR( e ) mplsLdp ## e ## Msg_t *test ## e ## Msg
18 #define MPLS_MSGCAST( e , f ) test ## e ## Msg = (mplsLdp ## e ## Msg_t*) f
19 #define MPLS_MSGPARAM( e ) test ## e ## Msg
21 #include "ldp_struct.h"
23 extern ldp_buf *ldp_buf_create(int);
24 extern void ldp_buf_delete(ldp_buf *);
25 extern int ldp_encode_one_mesg(ldp_global * g, uint32_t lsraddr,
26 int label_space, ldp_buf * b, ldp_mesg * msg);
27 extern int ldp_decode_one_mesg(ldp_global * g, ldp_buf * pdu, ldp_mesg * msg);
28 extern mpls_return_enum ldp_decode_header(ldp_global * g, ldp_buf * b,
30 ldp_mesg * msg);
32 #endif