equilibrium2-balance.h File Reference

Related to the Equilibrium II balance service plugin. More...

#include <stdlib.h>
#include <stdbool.h>
#include <strings.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <isc/eventlib.h>
#include <jnx/aux_types.h>
#include <jnx/atomic.h>
#include <jnx/msp_locks.h>
#include <jnx/msp_policy_db.h>
#include <jnx/multi-svcs/msvcs_events.h>

Go to the source code of this file.

Data Structures

struct  ssn_f_action_s
struct  ssn_r_action_s

Typedefs

typedef ssn_f_action_s ssn_f_action_t
typedef ssn_r_action_s ssn_r_action_t

Functions

int equilibrium2_balance_data_hdlr (msvcs_data_context_t *ctx, msvcs_data_event_t ev)
 Data event handler for the plugins.
int equilibrium2_balance_ctrl_hdlr (msvcs_control_context_t *ctx, msvcs_control_event_t ev)
 Control event handler.
sp_svc_set_tget_svc_set (uint16_t id, bool active)
 Get service-set by service-set ID.
void del_svc_set (sp_svc_set_t *ss)
 Delete a service-set by pointer.

Variables

int balance_pid
msvcs_control_context_t * ctrl_ctx
sp_svc_set_head_t svc_set_head
msp_spinlock_t svc_set_lock
svr_group_head_t * svr_group_head
msp_spinlock_t svr_group_lock
uint16_t svr_group_count
msvcs_event_class_t classify_ev_class


Detailed Description

Related to the Equilibrium II balance service plugin.

Definition in file equilibrium2-balance.h.


Typedef Documentation

typedef struct ssn_f_action_s ssn_f_action_t

List item of session action for forward path.

typedef struct ssn_r_action_s ssn_r_action_t

List item of session action for reverse path.


Function Documentation

void del_svc_set ( sp_svc_set_t ss  ) 

Delete a service-set by pointer.

Parameters:
[in] ss Pointer to the service-set

Definition at line 594 of file equilibrium2-balance_ctrl.c.

References ctrl_ctx, and sp_svc_set_s::ss_policy.

Referenced by proc_svc_set_blob(), and session_close().

int equilibrium2_balance_ctrl_hdlr ( msvcs_control_context_t *  ctx,
msvcs_control_event_t  ev 
)

Control event handler.

Parameters:
[in] ctx Pointer to control context.
[in] ev Control event.
Returns:
Control handler status code

Definition at line 618 of file equilibrium2-balance_ctrl.c.

References balance_pid, classify_ev_class, CONNECT_NA, connect_state, ctrl_ctx, EQ2_CLASSIFY_SVC_NAME, EV_CLASS_CLASSIFY, EV_CLASSIFY_FIRST_PACKET, ev_timer_id, read_gencfg_blob(), STATUS_UPDATE_INTERVAL, svc_set_lock, svr_group_count, svr_group_head, svr_group_lock, and upload_status().

Referenced by equilibrium2_balance_entry().

int equilibrium2_balance_data_hdlr ( msvcs_data_context_t *  ctx,
msvcs_data_event_t  ev 
)

Data event handler for the plugins.

Parameters:
[in] ctx Pointer to data context.
[in] ev Data event.
Returns:
Data handler status code

Definition at line 427 of file equilibrium2-balance_data.c.

References classify_ev_class, data_ctx, EQ2_CLASSIFY_SVC_NAME, EQ2_LUCKY_NUM, EV_CLASSIFY_FIRST_PACKET, first_pkt_proc(), session_close(), and take_action().

Referenced by equilibrium2_balance_entry().

sp_svc_set_t* get_svc_set ( uint16_t  id,
bool  active 
)

Get service-set by service-set ID.

There could be maximumly two service-sets with the same ID, one is to be deleted, another is active.

Parameters:
[in] id Service-set ID
[in] active Activation flag, 'true' is active, 'false' is inactive
Returns:
Pointer to the service-set on success, NULL on failure

Definition at line 574 of file equilibrium2-balance_ctrl.c.

References sp_svc_set_s::ss_active, blob_svc_set_s::ss_id, sp_svc_set_s::ss_policy, and svc_set_head.

Referenced by first_pkt_proc(), proc_svc_set_blob(), and session_close().


Variable Documentation

int balance_pid

plugin ID

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

Referenced by equilibrium2_balance_ctrl_hdlr(), equilibrium2_balance_entry(), proc_svc_set_blob(), session_close(), and take_action().

msvcs_event_class_t classify_ev_class

event class of classify service

Definition at line 55 of file equilibrium2-balance.h.

Referenced by equilibrium2_balance_ctrl_hdlr(), and equilibrium2_balance_data_hdlr().

msvcs_control_context_t* ctrl_ctx

global copy of control context

Definition at line 48 of file equilibrium2-balance.h.

Referenced by del_svc_set(), equilibrium2_balance_ctrl_hdlr(), proc_svc_set_blob(), proc_svr_group_blob(), session_close(), and update_svr_group_addr().

sp_svc_set_head_t svc_set_head

head of service-set list

Definition at line 49 of file equilibrium2-balance.h.

Referenced by get_svc_set(), and proc_svc_set_blob().

msp_spinlock_t svc_set_lock

lock for service-set list

Definition at line 50 of file equilibrium2-balance.h.

Referenced by equilibrium2_balance_ctrl_hdlr(), first_pkt_proc(), proc_svc_set_blob(), and session_close().

uint16_t svr_group_count

number of server groups

Definition at line 53 of file equilibrium2-balance.h.

Referenced by equilibrium2_balance_ctrl_hdlr(), proc_svr_group_blob(), and send_svr_group().

svr_group_head_t* svr_group_head

head of server group list

Definition at line 51 of file equilibrium2-balance.h.

Referenced by equilibrium2_balance_ctrl_hdlr(), get_svr_addr(), get_svr_group(), proc_svr_group_blob(), and send_svr_group().

msp_spinlock_t svr_group_lock

lock for server group list

Definition at line 52 of file equilibrium2-balance.h.

Referenced by equilibrium2_balance_ctrl_hdlr(), first_pkt_proc(), proc_svr_group_blob(), send_svr_group(), and session_close().


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:27:08 2010 for SDK Your Net Corporation Equilibrium II: equilibrium2-balance 1.0 by Doxygen 1.5.1