#include <string.h>
#include <isc/eventlib.h>
#include <jnx/bits.h>
#include <jnx/aux_types.h>
#include <jnx/provider_info.h>
#include <jnx/junos_kcom.h>
#include "counterd_kcom.h"
#include "counterd_logging.h"
Go to the source code of this file.
Defines | |
#define | COUNTERD_GENCFG_KEY 0xc01dface |
A key we pick unique to this app. | |
#define | COUNTERD_MINOR_NUM 2 |
A minor number we picked. | |
Functions | |
static int | counterd_gencfg_async (junos_kcom_gencfg_t *jk_gencfg) |
int | counterd_kcom_init (evContext ctx) |
int | counterd_add_data (void *data, uint32_t data_len) |
int | counterd_get_data (void *data, uint32_t data_len) |
Functions to initialize KCOM and to do GENCFG
Definition in file counterd_kcom.c.
int counterd_add_data | ( | void * | data, | |
uint32_t | data_len | |||
) |
Add or replace some data in KCOM GENCFG
[in] | data | data to add |
[in] | data_len | length in bytes of data |
Definition at line 159 of file counterd_kcom.c.
References COUNTERD_GENCFG_KEY, and COUNTERD_MINOR_NUM.
Referenced by get_message(), and reset_message().
static int counterd_gencfg_async | ( | junos_kcom_gencfg_t * | jk_gencfg | ) | [static] |
Bare minimum setup for a GENCFG callback function. It is required!
[in] | jk_gencfg | gencfg data structure which needs to be free'd like after a GET |
Definition at line 56 of file counterd_kcom.c.
Referenced by counterd_kcom_init().
int counterd_get_data | ( | void * | data, | |
uint32_t | data_len | |||
) |
Get some data from KCOM GENCFG
[in] | data | pointer of where to copy the data |
[in] | data_len | max number of bytes to copy to into data |
Definition at line 245 of file counterd_kcom.c.
References COUNTERD_GENCFG_KEY, and COUNTERD_MINOR_NUM.
Referenced by reset_message().
int counterd_kcom_init | ( | evContext | ctx | ) |
Init KCOM library so we can use it
[in] | ctx | event context for app |
Definition at line 84 of file counterd_kcom.c.
References counterd_gencfg_async(), and COUNTERD_MINOR_NUM.
Referenced by counterd_init().