version 1.1.1.1, 2012/02/21 17:26:12
|
version 1.1.1.3, 2016/11/02 10:09:12
|
Line 23
|
Line 23
|
#include <zebra.h> |
#include <zebra.h> |
|
|
#ifdef SUPPORT_OSPF_API |
#ifdef SUPPORT_OSPF_API |
#ifndef HAVE_OPAQUE_LSA |
|
#error "Core Opaque-LSA module must be configured." |
|
#endif /* HAVE_OPAQUE_LSA */ |
|
|
|
#include "linklist.h" |
#include "linklist.h" |
#include "prefix.h" |
#include "prefix.h" |
Line 105 ospf_apiserver_if_lookup_by_ifp (struct interface *ifp
|
Line 102 ospf_apiserver_if_lookup_by_ifp (struct interface *ifp
|
struct ospf_interface *oi; |
struct ospf_interface *oi; |
struct ospf *ospf; |
struct ospf *ospf; |
|
|
if (!(ospf = ospf_lookup ())); | if (!(ospf = ospf_lookup ())) |
return NULL; |
return NULL; |
|
|
for (ALL_LIST_ELEMENTS (ospf->oiflist, node, nnode, oi)) |
for (ALL_LIST_ELEMENTS (ospf->oiflist, node, nnode, oi)) |
Line 244 static int
|
Line 241 static int
|
ospf_apiserver_new_lsa_hook (struct ospf_lsa *lsa) |
ospf_apiserver_new_lsa_hook (struct ospf_lsa *lsa) |
{ |
{ |
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("API: Put LSA(%p)[%s] into reserve, total=%ld", lsa, dump_lsa_key (lsa), lsa->lsdb->total); | zlog_debug ("API: Put LSA(%p)[%s] into reserve, total=%ld", (void *)lsa, |
| dump_lsa_key (lsa), lsa->lsdb->total); |
return 0; |
return 0; |
} |
} |
|
|
Line 252 static int
|
Line 250 static int
|
ospf_apiserver_del_lsa_hook (struct ospf_lsa *lsa) |
ospf_apiserver_del_lsa_hook (struct ospf_lsa *lsa) |
{ |
{ |
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("API: Get LSA(%p)[%s] from reserve, total=%ld", lsa, dump_lsa_key (lsa), lsa->lsdb->total); | zlog_debug ("API: Get LSA(%p)[%s] from reserve, total=%ld", (void *)lsa, |
| dump_lsa_key (lsa), lsa->lsdb->total); |
return 0; |
return 0; |
} |
} |
|
|
Line 299 void
|
Line 298 void
|
ospf_apiserver_event (enum event event, int fd, |
ospf_apiserver_event (enum event event, int fd, |
struct ospf_apiserver *apiserv) |
struct ospf_apiserver *apiserv) |
{ |
{ |
struct thread *apiserver_serv_thread; |
|
|
|
switch (event) |
switch (event) |
{ |
{ |
case OSPF_APISERVER_ACCEPT: |
case OSPF_APISERVER_ACCEPT: |
apiserver_serv_thread = | (void)thread_add_read (master, ospf_apiserver_accept, apiserv, fd); |
thread_add_read (master, ospf_apiserver_accept, apiserv, fd); | |
break; |
break; |
case OSPF_APISERVER_SYNC_READ: |
case OSPF_APISERVER_SYNC_READ: |
apiserv->t_sync_read = |
apiserv->t_sync_read = |
Line 398 ospf_apiserver_free (struct ospf_apiserver *apiserv)
|
Line 394 ospf_apiserver_free (struct ospf_apiserver *apiserv)
|
listnode_delete (apiserver_list, apiserv); |
listnode_delete (apiserver_list, apiserv); |
|
|
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("API: Delete apiserv(%p), total#(%d)", apiserv, apiserver_list->count); | zlog_debug ("API: Delete apiserv(%p), total#(%d)", |
| (void *)apiserv, apiserver_list->count); |
|
|
/* And free instance. */ |
/* And free instance. */ |
XFREE (MTYPE_OSPF_APISERVER, apiserv); |
XFREE (MTYPE_OSPF_APISERVER, apiserv); |
Line 758 ospf_apiserver_accept (struct thread *thread)
|
Line 755 ospf_apiserver_accept (struct thread *thread)
|
#endif /* USE_ASYNC_READ */ |
#endif /* USE_ASYNC_READ */ |
|
|
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("API: New apiserv(%p), total#(%d)", apiserv, apiserver_list->count); | zlog_debug ("API: New apiserv(%p), total#(%d)", |
| (void *)apiserv, apiserver_list->count); |
|
|
return 0; |
return 0; |
} |
} |
Line 947 ospf_apiserver_register_opaque_type (struct ospf_apise
|
Line 945 ospf_apiserver_register_opaque_type (struct ospf_apise
|
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("API: Add LSA-type(%d)/Opaque-type(%d) into" |
zlog_debug ("API: Add LSA-type(%d)/Opaque-type(%d) into" |
" apiserv(%p), total#(%d)", |
" apiserv(%p), total#(%d)", |
lsa_type, opaque_type, apiserv, | lsa_type, opaque_type, (void *)apiserv, |
listcount (apiserv->opaque_types)); |
listcount (apiserv->opaque_types)); |
|
|
return 0; |
return 0; |
Line 979 ospf_apiserver_unregister_opaque_type (struct ospf_api
|
Line 977 ospf_apiserver_unregister_opaque_type (struct ospf_api
|
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("API: Del LSA-type(%d)/Opaque-type(%d)" |
zlog_debug ("API: Del LSA-type(%d)/Opaque-type(%d)" |
" from apiserv(%p), total#(%d)", |
" from apiserv(%p), total#(%d)", |
lsa_type, opaque_type, apiserv, | lsa_type, opaque_type, (void *)apiserv, |
listcount (apiserv->opaque_types)); |
listcount (apiserv->opaque_types)); |
|
|
return 0; |
return 0; |