equilibrium2-mgmt.h File Reference

Contains includes and definitions and prototypes. More...

#include <netinet/in.h>
#include <jnx/ipc_types.h>
#include <jnx/aux_types.h>
#include <jnx/junos_kcom_pub_blob.h>
#include <jnx/pconn.h>

Go to the source code of this file.

Data Structures

struct  svc_gate_s
struct  svc_type_s
struct  svc_term_s
struct  svc_rule_s
struct  svc_set_rule_s
struct  svc_set_s
struct  svc_if_s
struct  ssrb_node_s
struct  client_s

Defines

#define DNAME_EQUILIBRIUM2_MGMT   "equilibrium2-mgmt"
#define PMON_HB_INTERVAL   30
#define EQ2_TRACE(_msg_type, _fmt,...)   junos_trace((_msg_type), _fmt, ##__VA_ARGS__)
#define EQ2_LOG(_level, _fmt,...)   ERRMSG(EQ2_MGMT, (_level), _fmt, ##__VA_ARGS__)

Typedefs

typedef enum config_ssrb_op_e config_ssrb_op_t
typedef enum ssrb_state_e ssrb_state_t
typedef svc_gate_s svc_gate_t
typedef svc_type_s svc_type_t
typedef svc_term_s svc_term_t
typedef svc_rule_s svc_rule_t
typedef svc_set_rule_s svc_set_rule_t
typedef svc_set_s svc_set_t
typedef svc_if_s svc_if_t
typedef ssrb_node_s ssrb_node_t
typedef client_s client_t

Enumerations

enum  config_ssrb_op_e { CONFIG_SSRB_ADD = 1, CONFIG_SSRB_CHANGE, CONFIG_SSRB_DEL }
enum  ssrb_state_e { SSRB_IDLE = 0, SSRB_PENDING, SSRB_UPDATED }

Functions

typedef LIST_HEAD (svc_gate_head_s, svc_gate_s) svc_gate_head_t
typedef LIST_HEAD (svc_type_head_s, svc_type_s) svc_type_head_t
typedef LIST_HEAD (svc_term_head_s, svc_term_s) svc_term_head_t
typedef LIST_HEAD (svc_rule_head_s, svc_rule_s) svc_rule_head_t
typedef LIST_HEAD (svc_set_rule_head_s, svc_set_rule_s) svc_set_rule_head_t
typedef LIST_HEAD (svc_set_head_s, svc_set_s) svc_set_head_t
typedef LIST_HEAD (svc_if_head_s, svc_if_s) svc_if_head_t
typedef LIST_HEAD (ssrb_head_s, ssrb_node_s) ssrb_head_t
typedef LIST_HEAD (client_head_s, client_s) client_head_t
int kcom_init (evContext ctx)
 Init KCOM library and register handlers for asynchronous KCOM messages.
void kcom_close (void)
 Shutdown KCOM library and register handlers for asynchronous KCOM messages.
int kcom_get_config_blob (void)
 Get all configuration blobs.
int kcom_add_config_blob (config_blob_key_t *key, void *blob)
 Add a configuration blob.
int kcom_del_config_blob (config_blob_key_t *key)
 Delete a configuration blob.
int server_open (evContext ctx)
 Open the manager server.
void server_close (void)
 Close existing connections and shutdown server.
void config_init (void)
 Init the data structure that will store configuration info, or in other words, the condition(s).
void config_clear (void)
 Clear the (non-SSRB) configuration info.
void clear_ssrb_config (void)
 Clear the SSRB configuration info.
int config_ssrb_op (junos_kcom_pub_ssrb_t *ssrb, config_ssrb_op_t op)
 Add/delete/update SSRB in the configuration.
int eq2_config_read (int check)
 Read daemon configuration from the database. (nothing to do except traceoptions).
void config_svr_group_blob_proc (config_blob_key_t *key, void *blob)
 Process server group blob.
void config_svc_set_blob_proc (config_blob_key_t *key, void *blob)
 Process service-set config blob.
client_tclient_get_next (client_t *client)
 Get the next client.

Variables

provider_origin_id_t eq2_origin_id
provider_id_t eq2_provider_id
svc_if_head_t svc_if_head
int svc_if_count


Detailed Description

Contains includes and definitions and prototypes.

Definition in file equilibrium2-mgmt.h.


Define Documentation

#define DNAME_EQUILIBRIUM2_MGMT   "equilibrium2-mgmt"

Constant string for the daemon name.

Definition at line 33 of file equilibrium2-mgmt.h.

Referenced by main().

#define EQ2_LOG ( _level,
_fmt,
...   )     ERRMSG(EQ2_MGMT, (_level), _fmt, ##__VA_ARGS__)

The macro to log syslog message.

Definition at line 43 of file equilibrium2-mgmt.h.

Referenced by client_add(), client_del(), get_initial_ssrb(), kcom_add_config_blob(), kcom_del_config_blob(), kcom_get_config_blob(), kcom_init(), main_init(), pack_svc_set_blob(), server_event_hdlr(), server_msg_hdlr(), server_open(), and ssrb_async_hdlr().

#define EQ2_TRACE ( _msg_type,
_fmt,
...   )     junos_trace((_msg_type), _fmt, ##__VA_ARGS__)

The macro to log tracing message.

Definition at line 39 of file equilibrium2-mgmt.h.

Referenced by add_eq2_svc_gate(), add_eq2_svc_type(), add_eq2_svr_group(), clear_eq2_svc_gate(), clear_eq2_svc_rule(), clear_eq2_svc_type(), clear_eq2_svr_group(), clear_svc_set(), config_init(), config_post_proc(), config_ssrb_op(), config_svc_set_blob_proc(), config_svr_group_blob_proc(), del_eq2_svc_rule(), del_svc_set(), eq2_config_read(), free_eq2_svc_rule(), gencfg_async_hdlr(), get_initial_ssrb(), ifd_async_hdlr(), kcom_add_config_blob(), kcom_close(), kcom_del_config_blob(), kcom_get_config_blob(), kcom_init(), main_exit(), main_init(), pack_svc_set_blob(), pack_svr_group_blob(), read_eq2_rule(), read_eq2_svc_gate(), read_eq2_svc_type(), read_eq2_svr_group(), read_eq2_term(), read_svc_set(), read_svc_set_rule(), server_event_hdlr(), server_msg_hdlr(), server_open(), and ssrb_async_hdlr().

#define PMON_HB_INTERVAL   30

The heartbeat interval.

Definition at line 36 of file equilibrium2-mgmt.h.

Referenced by main_init().


Typedef Documentation

typedef struct client_s client_t

List item of client.

typedef enum config_ssrb_op_e config_ssrb_op_t

Config SSRB operation commands.

typedef struct ssrb_node_s ssrb_node_t

List item of SSRB.

typedef enum ssrb_state_e ssrb_state_t

Config SSRB state.

typedef struct svc_gate_s svc_gate_t

List item of service gate.

typedef struct svc_if_s svc_if_t

List item of service-set service interface.

typedef struct svc_rule_s svc_rule_t

List item of Equilibrium II service rule.

typedef struct svc_set_rule_s svc_set_rule_t

List item of service-set rule.

typedef struct svc_set_s svc_set_t

List itme of service-set.

typedef struct svc_term_s svc_term_t

List item of Equilibrium II service term.

typedef struct svc_type_s svc_type_t

List item of service type.


Enumeration Type Documentation

enum config_ssrb_op_e

Config SSRB operation commands.

Enumerator:
CONFIG_SSRB_ADD  add SSRB
CONFIG_SSRB_CHANGE  update SSRB
CONFIG_SSRB_DEL  delete SSRB

Definition at line 47 of file equilibrium2-mgmt.h.

enum ssrb_state_e

Config SSRB state.

Definition at line 54 of file equilibrium2-mgmt.h.


Function Documentation

client_t* client_get_next ( client_t client  ) 

Get the next client.

Parameters:
[in] client Client
Returns:
Pointer to the next client on success, NULL on failure

Definition at line 178 of file equilibrium2-mgmt_server.c.

References client_head.

Referenced by eq2_show_status().

int config_ssrb_op ( junos_kcom_pub_ssrb_t *  ssrb,
config_ssrb_op_t  op 
)

Add/delete/update SSRB in the configuration.

Parameters:
[in] ssrb The SSRB data
[in] op SSRB operation
Returns:
0 on success, -1 on failure

Definition at line 1505 of file equilibrium2-mgmt_config.c.

References add_svc_set_blob(), check_ssrb(), config_get_ssrb(), CONFIG_SSRB_ADD, CONFIG_SSRB_CHANGE, CONFIG_SSRB_DEL, EQ2_BALANCE_SVC, EQ2_CLASSIFY_SVC, EQ2_TRACE, get_svc_set_blob_node(), ssrb_node_s::ssrb, ssrb_head, and ssrb_node_s::ssrb_state.

Referenced by get_initial_ssrb(), and ssrb_async_hdlr().

void config_svc_set_blob_proc ( config_blob_key_t key,
void *  blob 
)

Process service-set config blob.

Parameters:
[in] key Pointer to the configuration blob key
[in] blob Pointer to the blob

Definition at line 1641 of file equilibrium2-mgmt_config.c.

References EQ2_TRACE, get_svc_set_blob_node(), kcom_del_config_blob(), config_blob_key_s::key_name, config_blob_key_s::key_plugin_id, blob_svc_set_node_s::ss, and blob_svc_set_s::ss_cksum.

Referenced by kcom_get_config_blob().

void config_svr_group_blob_proc ( config_blob_key_t key,
void *  blob 
)

Process server group blob.

Parameters:
[in] key Pointer to the configuration blob key
[in] blob Pointer to the blob

Definition at line 1605 of file equilibrium2-mgmt_config.c.

References blob_svr_group_set, EQ2_TRACE, blob_svr_group_set_s::gs_cksum, kcom_del_config_blob(), and config_blob_key_s::key_name.

Referenced by kcom_get_config_blob().

int eq2_config_read ( int  check  ) 

Read daemon configuration from the database. (nothing to do except traceoptions).

Parameters:
[in] check 1 if this function being invoked because of a commit check
Returns:
0 on success, -1 on failure
Note:
Do not use ERRMSG/EQ2_LOG during config check normally.

Definition at line 1692 of file equilibrium2-mgmt_config.c.

References balance_rule_head, classify_rule_head, clear_svc_set(), config_post_proc(), EQ2_TRACE, read_eq2_rule(), read_eq2_svc_gate(), read_eq2_svc_type(), read_eq2_svr_group(), and read_svc_set().

Referenced by main().

int kcom_add_config_blob ( config_blob_key_t key,
void *  blob 
)

Add a configuration blob.

Parameters:
[in] key Pointer to the blob key
[in] blob Pointer to the blob
Returns:
0 on success, -1 on failure

Definition at line 206 of file equilibrium2-mgmt_kcom.c.

References CONFIG_BLOB_SVC_SET, CONFIG_BLOB_SVR_GROUP, EQ2_LOG, eq2_provider_id, EQ2_TRACE, blob_svr_group_set_s::gs_cksum, blob_svr_group_set_s::gs_size, svc_if_s::if_name, config_blob_key_s::key_name, config_blob_key_s::key_plugin_id, config_blob_key_s::key_tag, blob_svc_set_s::ss_cksum, blob_svc_set_s::ss_if_name, blob_svc_set_s::ss_size, svc_if_count, and svc_if_head.

Referenced by add_svc_set_blob(), and config_post_proc().

int kcom_del_config_blob ( config_blob_key_t key  ) 

Delete a configuration blob.

Parameters:
[in] key Pointer to the blob key
Returns:
0 on success, -1 on failure

Definition at line 289 of file equilibrium2-mgmt_kcom.c.

References EQ2_LOG, eq2_provider_id, EQ2_TRACE, config_blob_key_s::key_name, config_blob_key_s::key_plugin_id, and config_blob_key_s::key_tag.

Referenced by config_svc_set_blob_proc(), and config_svr_group_blob_proc().

int kcom_get_config_blob ( void   ) 

Get all configuration blobs.

Returns:
0 on success, -1 on failure

Definition at line 320 of file equilibrium2-mgmt_kcom.c.

References CONFIG_BLOB_SVC_SET, CONFIG_BLOB_SVR_GROUP, config_svc_set_blob_proc(), config_svr_group_blob_proc(), EQ2_LOG, eq2_provider_id, EQ2_TRACE, config_blob_key_s::key_name, config_blob_key_s::key_plugin_id, and config_blob_key_s::key_tag.

Referenced by config_post_proc().

int kcom_init ( evContext  ctx  ) 

Init KCOM library and register handlers for asynchronous KCOM messages.

Parameters:
[in] ctx Event context
Returns:
KCOM_OK (0) on success, -1 on failure

Definition at line 401 of file equilibrium2-mgmt_kcom.c.

References EQ2_LOG, eq2_origin_id, EQ2_TRACE, gencfg_async_hdlr(), get_initial_ssrb(), ifd_async_hdlr(), and ssrb_async_hdlr().

Referenced by main_init().

typedef LIST_HEAD ( client_head_s  ,
client_s   
)

List head of client.

typedef LIST_HEAD ( ssrb_head_s  ,
ssrb_node_s   
)

List head of SSRB.

typedef LIST_HEAD ( svc_if_head_s  ,
svc_if_s   
)

List head of service-set service interface.

typedef LIST_HEAD ( svc_set_head_s  ,
svc_set_s   
)

List head of service-set.

typedef LIST_HEAD ( svc_set_rule_head_s  ,
svc_set_rule_s   
)

List head of service-set rule.

typedef LIST_HEAD ( svc_rule_head_s  ,
svc_rule_s   
)

List head of Equilibrium II service rule.

typedef LIST_HEAD ( svc_term_head_s  ,
svc_term_s   
)

List head of Equilibrium II service term.

typedef LIST_HEAD ( svc_type_head_s  ,
svc_type_s   
)

List head of service type.

typedef LIST_HEAD ( svc_gate_head_s  ,
svc_gate_s   
)

List head of service gate.

int server_open ( evContext  ctx  ) 

Open the manager server.

Parameters:
[in] ctx Event context
Returns:
0 on success; -1 on failure

Definition at line 192 of file equilibrium2-mgmt_server.c.

References client_head, EQ2_LOG, EQ2_MGMT_SERVER_PORT, EQ2_TRACE, server_event_hdlr(), server_hdl, and server_msg_hdlr().

Referenced by main_init().


Variable Documentation

provider_origin_id_t eq2_origin_id

original ID

Definition at line 158 of file equilibrium2-mgmt.h.

Referenced by kcom_init(), and main_init().

provider_id_t eq2_provider_id

provider ID

Definition at line 159 of file equilibrium2-mgmt.h.

Referenced by kcom_add_config_blob(), kcom_del_config_blob(), kcom_get_config_blob(), and main_init().

int svc_if_count

number of service interfaces

Definition at line 161 of file equilibrium2-mgmt.h.

Referenced by add_svc_if(), clear_svc_if(), config_init(), and kcom_add_config_blob().

svc_if_head_t svc_if_head

list head of service interface

Definition at line 160 of file equilibrium2-mgmt.h.

Referenced by add_svc_if(), clear_svc_if(), config_init(), and kcom_add_config_blob().


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:58 2010 for SDK Your Net Corporation Equilibrium II: equilibrium2-mgmt 1.0 by Doxygen 1.5.1