TSG-14909 tsg-service-chaining-engine的service_function_status metrics适配vsys_id的变更

This commit is contained in:
luwenpeng
2023-04-26 15:04:04 +08:00
parent 989a118969
commit d1b04d50b8
18 changed files with 64 additions and 53 deletions

View File

@@ -39,6 +39,7 @@ struct session_iterm
int is_active; // value2
int profile_id; // value3
uint8_t mac[HC_MAC_LEN]; // value4
int vsys_id; // value5
UT_hash_handle hh1; /* handle for first hash table */
};
@@ -203,7 +204,7 @@ static uint64_t health_check_get_session_id()
// return >0 : session id
// return 0 : fail
// struct health_check *policy : need deep copy
uint64_t health_check_session_add(int profile_id, const struct health_check *policy)
uint64_t health_check_session_add(int profile_id, int vsys_id, const struct health_check *policy)
{
int ret = 0;
uint64_t session_id = 0;
@@ -224,6 +225,7 @@ uint64_t health_check_session_add(int profile_id, const struct health_check *pol
tmp = (struct session_iterm *)calloc(1, sizeof(struct session_iterm));
assert(tmp);
tmp->vsys_id = vsys_id;
tmp->session_id = session_id;
tmp->profile_id = profile_id;
memcpy(&tmp->policy, policy, sizeof(struct health_check));
@@ -352,7 +354,7 @@ int health_check_session_set_status(uint64_t session_id, int is_active)
static int get_mac_by_addr(char *addr, uint8_t *buf)
{
int sfd, saved_errno, ret;
int sfd, ret;
struct arpreq arp_req;
struct sockaddr_in *sin;
@@ -418,7 +420,7 @@ static void *_health_check_session_foreach(void *arg)
is_active = 0;
}
sf_status_update(g_sf_status, node->profile_id, is_active, 0);
sf_status_update(g_sf_status, node->profile_id, node->vsys_id, is_active, 0);
if (node->is_active != is_active) {
node->is_active = is_active;
if (node->is_active == 1) {