3 * Copyright (C) James R. Leu 2000
6 * This software is covered under the LGPL, for more
7 * info check out http://www.gnu.org/copyleft/lgpl.html
10 #include "ldp_struct.h"
13 #include "mpls_assert.h"
14 #include "mpls_lock_impl.h"
15 #include "mpls_mm_impl.h"
17 uint32_t _ldp_l2cc_next_index
= 1;
19 ldp_l2cc
*ldp_l2cc_create()
21 ldp_l2cc
*l
= (ldp_l2cc
*) mpls_malloc(sizeof(ldp_l2cc
));
24 memset(l
, 0, sizeof(ldp_l2cc
));
25 MPLS_REFCNT_INIT(l
, 0);
26 MPLS_LIST_ELEM_INIT(l
, _global
);
27 MPLS_LIST_ELEM_INIT(l
, _addr
);
28 l
->index
= _ldp_l2cc_get_next_index();
33 void ldp_l2cc_delete(ldp_l2cc
* l
)
35 // LDP_PRINT(g->user_data,"l2cc delete\n");
36 MPLS_REFCNT_ASSERT(l
, 0);
40 uint32_t _ldp_l2cc_get_next_index()
42 uint32_t retval
= _ldp_l2cc_next_index
;
44 _ldp_l2cc_next_index
++;
45 if (retval
> _ldp_l2cc_next_index
) {
46 _ldp_l2cc_next_index
= 1;
51 mpls_bool
ldp_l2cc_is_active(ldp_l2cc
*l
) {
52 return MPLS_BOOL_TRUE
;
55 mpls_bool
ldp_l2cc_is_ready(ldp_l2cc
*l
) {
56 return MPLS_BOOL_TRUE
;
59 mpls_return_enum
ldp_l2cc_startup(ldp_global
* g
, ldp_l2cc
* l
) {
63 mpls_return_enum
ldp_l2cc_shutdown(ldp_global
* g
, ldp_l2cc
* l
) {