rename session_get0_readable_addr() to session_get_readable_addr()
This commit is contained in:
@@ -82,7 +82,7 @@ void session_set_id(struct session *sess, uint64_t id);
|
||||
|
||||
void session_set_tuple6(struct session *sess, const struct tuple6 *tuple);
|
||||
const struct tuple6 *session_get_tuple6(const struct session *sess);
|
||||
// const char *session_get0_readable_addr(const struct session *sess);
|
||||
// const char *session_get_readable_addr(const struct session *sess);
|
||||
|
||||
void session_set_direction(struct session *sess, enum session_direction dir);
|
||||
enum session_direction session_get_direction(const struct session *sess);
|
||||
|
||||
@@ -146,7 +146,7 @@ static int tcp_init(struct session_manager_rte *sess_mgr_rte, struct session *se
|
||||
return -1;
|
||||
}
|
||||
|
||||
SESSION_MANAGER_LOG_DEBUG("session %lu %s new c2s tcp tcp_reass %p, s2c tcp tcp_reass %p", session_get_id(sess), session_get0_readable_addr(sess),
|
||||
SESSION_MANAGER_LOG_DEBUG("session %lu %s new c2s tcp tcp_reass %p, s2c tcp tcp_reass %p", session_get_id(sess), session_get_readable_addr(sess),
|
||||
sess->tcp_halfs[FLOW_TYPE_C2S].tcp_reass, sess->tcp_halfs[FLOW_TYPE_S2C].tcp_reass);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -167,6 +167,6 @@ void session_transition_log(struct session *sess, enum session_state curr_state,
|
||||
session_inputs_to_str(inputs, reason, sizeof(reason));
|
||||
SESSION_TRANSITION_LOG_INFO("%s session %lu %s (%s) %s -> %s",
|
||||
session_type_to_str(session_get_type(sess)),
|
||||
session_get_id(sess), session_get0_readable_addr(sess), reason,
|
||||
session_get_id(sess), session_get_readable_addr(sess), reason,
|
||||
session_state_to_str(curr_state), session_state_to_str(next_state));
|
||||
}
|
||||
@@ -30,7 +30,7 @@ const struct tuple6 *session_get_tuple6(const struct session *sess)
|
||||
return &sess->tuple;
|
||||
}
|
||||
|
||||
const char *session_get0_readable_addr(const struct session *sess)
|
||||
const char *session_get_readable_addr(const struct session *sess)
|
||||
{
|
||||
return sess->tuple_str;
|
||||
}
|
||||
@@ -368,7 +368,7 @@ int session_to_str(const struct session *sess, int bref, char *buff, int size)
|
||||
{
|
||||
used += snprintf(buff + used, size - used, "session id: %lu, addr: %s, type: %s, state: %s, dir: %s, c2s_rx_pkts: %lu, s2c_rx_pkts: %lu",
|
||||
session_get_id(sess),
|
||||
session_get0_readable_addr(sess),
|
||||
session_get_readable_addr(sess),
|
||||
session_type_to_str(session_get_type(sess)),
|
||||
session_state_to_str(session_get_current_state(sess)),
|
||||
flow_direction_to_str(session_get_flow_type(sess)),
|
||||
@@ -381,7 +381,7 @@ int session_to_str(const struct session *sess, int bref, char *buff, int size)
|
||||
used += snprintf(buff + used, size - used, "\"id\":%" PRIu64 ",", session_get_id(sess));
|
||||
used += snprintf(buff + used, size - used, "\"start_timestamp_ms\":%" PRIu64 ",", session_get_timestamp(sess, SESSION_TIMESTAMP_START));
|
||||
used += snprintf(buff + used, size - used, "\"last_timestamp_ms\":%" PRIu64 ",", session_get_timestamp(sess, SESSION_TIMESTAMP_LAST));
|
||||
used += snprintf(buff + used, size - used, "\"tuple\":\"%s\",", session_get0_readable_addr(sess));
|
||||
used += snprintf(buff + used, size - used, "\"tuple\":\"%s\",", session_get_readable_addr(sess));
|
||||
used += snprintf(buff + used, size - used, "\"type\":\"%s\",", session_type_to_str(session_get_type(sess)));
|
||||
used += snprintf(buff + used, size - used, "\"state\":\"%s\",", session_state_to_str(session_get_current_state(sess)));
|
||||
used += snprintf(buff + used, size - used, "\"closing_reason\":\"%s\",", closing_reason_to_str(session_get_closing_reason(sess)));
|
||||
|
||||
@@ -7,7 +7,7 @@ static inline void mached_session_print(const char *title, struct session_manage
|
||||
{
|
||||
struct session *sess = session_manager_rte_lookup_session_by_id(sess_mgr_rte, mached_sess_id[i]);
|
||||
printf("session id: %lu, addr: %s, type: %s, state: %s, start: %lu, last: %lu\n",
|
||||
mached_sess_id[i], session_get0_readable_addr(sess),
|
||||
mached_sess_id[i], session_get_readable_addr(sess),
|
||||
session_type_to_str(session_get_type(sess)),
|
||||
session_state_to_str(session_get_current_state(sess)),
|
||||
session_get_timestamp(sess, SESSION_TIMESTAMP_START),
|
||||
|
||||
Reference in New Issue
Block a user