#include <sync/common.h>
#include <jnx/provider_info.h>
#include "ped_services.h"
#include "ped_kcom.h"
#include "ped_config.h"
#include "ped_conn.h"
#include "ped_policy_table.h"
#include "ped_service_route.h"
#include "ped_logging.h"
Go to the source code of this file.
Defines | |
#define | KCOM_ID_PED 77 |
ID of this app with KCOM. | |
#define | MSP_IFD_NAME_PATTERN "ms-" |
common part of MS PIC interface names | |
#define | INT_NAME_STR_SIZE 64 |
string size for interface names | |
Functions | |
static int | iff_async_handler (kcom_iff_t *msg, void *user_info __unused) |
static int | iff_manage_handler (kcom_iff_t *msg, void *user_info __unused) |
static int | ifd_async_handler (kcom_ifdev_t *msg, void *user_info __unused) |
int | get_interface_total (void) |
void | update_all_interfaces (void) |
int | ped_kcom_init (void) |
Variables | |
evContext | ped_ctx |
Event context for ped. | |
static int | if_count |
# of IFFs interfaces counted in callback | |
static int | if_total = 0 |
Total # of IFFs after junos_kcom_iff_get_all. |
Initialize KCOM and register a handler for iff changes
Definition in file ped_kcom.c.
int get_interface_total | ( | void | ) |
Get the number of all interfaces.
Definition at line 174 of file ped_kcom.c.
References if_total.
Referenced by handler_if_total().
static int ifd_async_handler | ( | kcom_ifdev_t * | msg, | |
void *user_info | __unused | |||
) | [static] |
Gets called for all ifds and calls update_interface with INTERFACE_REFRESH.
[in] | msg | The ifd we want to know about |
[in] | user_info | User info that was registered to be passed to this callback |
Definition at line 147 of file ped_kcom.c.
References MSP_IFD_NAME_PATTERN, and mspic_offline().
Referenced by ped_kcom_init().
static int iff_async_handler | ( | kcom_iff_t * | msg, | |
void *user_info | __unused | |||
) | [static] |
The callback registered to handle changes in the iffs.
[in] | msg | The iff we want to know about |
[in] | user_info | User info that was registered to be passed to this callback |
Definition at line 65 of file ped_kcom.c.
References INTERFACE_ADD, INTERFACE_DELETE, and update_interface().
Referenced by ped_kcom_init().
static int iff_manage_handler | ( | kcom_iff_t * | msg, | |
void *user_info | __unused | |||
) | [static] |
Gets called for all iffs and calls update_interface with INTERFACE_REFRESH.
[in] | msg | The iff we want to know about |
[in] | user_info | User info that was registered to be passed to this callback |
Definition at line 118 of file ped_kcom.c.
References if_count, INTERFACE_REFRESH, and update_interface().
Referenced by update_all_interfaces().
int ped_kcom_init | ( | void | ) |
Init KCOM library and register handlers for asynchronous KCOM messages.
Definition at line 208 of file ped_kcom.c.
References ifd_async_handler(), iff_async_handler(), and ped_ctx.
Referenced by ped_init().
void update_all_interfaces | ( | void | ) |
Update policy information and apply it for all interfaces which match the configured conditions by calling update_interface for all IFFs
Definition at line 184 of file ped_kcom.c.
References if_count, if_total, and iff_manage_handler().
Referenced by psd_ipc_read().