/******************************************************************** * FUNCTION agt_ses_get_session_outNotifications * * <get> operation handler for the outNotifications counter * * INPUTS: * see ncx/getcb.h getcb_fn_t for details * * RETURNS: * status *********************************************************************/ status_t agt_ses_get_session_outNotifications (ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval) { ses_cb_t *testscb; ses_id_t sid; status_t res; (void)scb; if (cbmode != GETCB_GET_VALUE) { return ERR_NCX_OPERATION_NOT_SUPPORTED; } sid = 0; res = get_session_key(virval, &sid); if (res != NO_ERR) { return res; } testscb = agtses[sid]; VAL_UINT(dstval) = testscb->stats.outNotifications; return NO_ERR; } /* agt_ses_get_session_outNotifications */
void cluster::cluster_stat_user(_nic_stat_session_tuple* tuple) { session_key sk; get_session_key(sk, tuple); process_session(sk, tuple); }
void cluster::process_session(session_key& sk, _nic_stat_session_tuple* tuple) { //对ip对流量进行统计 get_session_key(sk, tuple); session_key_map_it it; if((it = map_user_.find(sk)) == map_user_.end()) { map_user_.insert(std::pair<session_key, _nic_stat_user>(sk, _nic_stat_user(tuple->src_ip_, tuple->dst_ip_, time(NULL), tuple->flow_))); } else { it->second.current_flow_ += tuple->flow_; } }