Lines Matching refs:hash_entry

407 	struct soflow_hash_entry *hash_entry = NULL;  in soflow_db_init()  local
418 db->soflow_db_debug = SOFLOW_ENABLE_DEBUG(so, hash_entry); in soflow_db_init()
426 soflow_entry_free(struct soflow_hash_entry *hash_entry) in soflow_entry_free() argument
428 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_entry_free()
430 if (hash_entry == NULL) { in soflow_entry_free()
434 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "Free entry"); in soflow_entry_free()
435 kfree_type(struct soflow_hash_entry, hash_entry); in soflow_entry_free()
439 soflow_db_remove_entry(struct soflow_db *db, struct soflow_hash_entry *hash_entry) in soflow_db_remove_entry() argument
441 if (hash_entry == NULL) { in soflow_db_remove_entry()
449 if (hash_entry->soflow_nstat_context != NULL) { in soflow_db_remove_entry()
450 …OW_LOG(LOG_INFO, db->soflow_db_so, hash_entry->soflow_debug, "<Close nstat> - context %lX", (unsig… in soflow_db_remove_entry()
451 nstat_provider_stats_close(hash_entry->soflow_nstat_context); in soflow_db_remove_entry()
452 hash_entry->soflow_nstat_context = NULL; in soflow_db_remove_entry()
453 SOFLOW_ENTRY_FREE(hash_entry); in soflow_db_remove_entry()
458 if (db->soflow_db_only_entry == hash_entry) { in soflow_db_remove_entry()
461 LIST_REMOVE(hash_entry, soflow_entry_link); in soflow_db_remove_entry()
464 if (hash_entry->soflow_feat_ctxt != NULL && soflow_feat_detach_entry_func_ptr != NULL) { in soflow_db_remove_entry()
465 soflow_feat_detach_entry_func_ptr(db->soflow_db_so, hash_entry); in soflow_db_remove_entry()
466 hash_entry->soflow_feat_ctxt = NULL; in soflow_db_remove_entry()
467 hash_entry->soflow_feat_ctxt_id = 0; in soflow_db_remove_entry()
470 hash_entry->soflow_db = NULL; in soflow_db_remove_entry()
474 TAILQ_REMOVE(&soflow_entry_head, hash_entry, soflow_entry_list_link); in soflow_db_remove_entry()
479 SOFLOW_ENTRY_FREE(hash_entry); in soflow_db_remove_entry()
659 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_get_feature_context() local
688 hash_entry = soflow_db_lookup_by_feature_context_id(db, feature_context_id); in soflow_db_get_feature_context()
689 context = hash_entry != NULL ? hash_entry->soflow_feat_ctxt : NULL; in soflow_db_get_feature_context()
699 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_get_feature_context_id() local
714 hash_entry = soflow_db_lookup_entry(db, local, remote, false); in soflow_db_get_feature_context_id()
715 if (hash_entry == NULL) { in soflow_db_get_feature_context_id()
717 hash_entry = soflow_db_lookup_entry(db, local, remote, true); in soflow_db_get_feature_context_id()
719 if (hash_entry != NULL && hash_entry->soflow_feat_ctxt != NULL) { in soflow_db_get_feature_context_id()
720 context_id = hash_entry->soflow_feat_ctxt_id; in soflow_db_get_feature_context_id()
954 struct soflow_hash_entry *hash_entry = (struct soflow_hash_entry *) ctx; in soflow_nstat_provider_request_vals() local
955 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_nstat_provider_request_vals()
961 if (hash_entry == NULL || so == NULL || inp == NULL) { in soflow_nstat_provider_request_vals()
966 if (hash_entry->soflow_outifindex) { in soflow_nstat_provider_request_vals()
967 struct ifnet *ifp = ifindex2ifnet[hash_entry->soflow_outifindex]; in soflow_nstat_provider_request_vals()
971 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, "ifflagsp set to 0x%X", *ifflagsp); in soflow_nstat_provider_request_vals()
978 countsp->nstat_rxpackets = hash_entry->soflow_rxpackets; in soflow_nstat_provider_request_vals()
979 countsp->nstat_rxbytes = hash_entry->soflow_rxbytes; in soflow_nstat_provider_request_vals()
980 countsp->nstat_txpackets = hash_entry->soflow_txpackets; in soflow_nstat_provider_request_vals()
981 countsp->nstat_txbytes = hash_entry->soflow_txbytes; in soflow_nstat_provider_request_vals()
983 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, in soflow_nstat_provider_request_vals()
1003 uuid_copy(desc->fuuid, hash_entry->soflow_uuid); in soflow_nstat_provider_request_vals()
1005 if (hash_entry->soflow_family == AF_INET6) { in soflow_nstat_provider_request_vals()
1006 …in6_ip6_to_sockaddr(&hash_entry->soflow_laddr.addr6, hash_entry->soflow_lport, hash_entry->soflow_… in soflow_nstat_provider_request_vals()
1008 …in6_ip6_to_sockaddr(&hash_entry->soflow_faddr.addr6, hash_entry->soflow_fport, hash_entry->soflow_… in soflow_nstat_provider_request_vals()
1010 } else if (hash_entry->soflow_family == AF_INET) { in soflow_nstat_provider_request_vals()
1013 desc->local.v4.sin_port = hash_entry->soflow_lport; in soflow_nstat_provider_request_vals()
1014 desc->local.v4.sin_addr = hash_entry->soflow_laddr.addr46.ia46_addr4; in soflow_nstat_provider_request_vals()
1018 desc->remote.v4.sin_port = hash_entry->soflow_fport; in soflow_nstat_provider_request_vals()
1019 desc->remote.v4.sin_addr = hash_entry->soflow_faddr.addr46.ia46_addr4; in soflow_nstat_provider_request_vals()
1022 desc->ifindex = hash_entry->soflow_outifindex; in soflow_nstat_provider_request_vals()
1023 if (hash_entry->soflow_outifindex) { in soflow_nstat_provider_request_vals()
1024 struct ifnet *ifp = ifindex2ifnet[hash_entry->soflow_outifindex]; in soflow_nstat_provider_request_vals()
1033 if (hash_entry->soflow_debug) { in soflow_nstat_provider_request_vals()
1034 switch (hash_entry->soflow_family) { in soflow_nstat_provider_request_vals()
1053 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, in soflow_nstat_provider_request_vals()
1075 struct soflow_hash_entry *hash_entry = (struct soflow_hash_entry *) ctx; in soflow_nstat_provider_request_extensions() local
1076 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_nstat_provider_request_extensions()
1081 if (hash_entry == NULL || so == NULL || inp == NULL) { in soflow_nstat_provider_request_extensions()
1104 if (hash_entry->soflow_debug) { in soflow_nstat_provider_request_extensions()
1105 …SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, "Collected NSTAT domain_info:pid %d domain <%s… in soflow_nstat_provider_request_extensions()
1127 soflow_update_flow_stats(struct soflow_hash_entry *hash_entry, size_t data_size, bool outgoing) in soflow_update_flow_stats() argument
1129 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_update_flow_stats()
1131 if (hash_entry != NULL) { in soflow_update_flow_stats()
1133 hash_entry->soflow_txbytes += data_size; in soflow_update_flow_stats()
1134 hash_entry->soflow_txpackets++; in soflow_update_flow_stats()
1135 SOFLOW_ENTRY_LOG(LOG_DEBUG, so, hash_entry, hash_entry->soflow_debug, "Stats update - Outgoing"); in soflow_update_flow_stats()
1137 hash_entry->soflow_rxbytes += data_size; in soflow_update_flow_stats()
1138 hash_entry->soflow_rxpackets++; in soflow_update_flow_stats()
1139 SOFLOW_ENTRY_LOG(LOG_DEBUG, so, hash_entry, hash_entry->soflow_debug, "Stats update - Incoming"); in soflow_update_flow_stats()
1148 struct soflow_hash_entry *hash_entry = NULL; in soflow_get_flow() local
1166 hash_entry = soflow_db_lookup_entry(so->so_flow_db, local, remote, false); in soflow_get_flow()
1167 if (hash_entry == NULL) { in soflow_get_flow()
1169 hash_entry = soflow_db_lookup_entry(so->so_flow_db, local, remote, true); in soflow_get_flow()
1171 if (hash_entry != NULL) { in soflow_get_flow()
1174 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1180 if (hash_entry->soflow_outifindex == 0 || in soflow_get_flow()
1181 …soflow_entry_local_address_needs_update(hash_entry) || soflow_entry_local_port_needs_update(so, ha… in soflow_get_flow()
1182 soflow_entry_update_local(so->so_flow_db, hash_entry, local, control, rcv_ifindex); in soflow_get_flow()
1184 hash_entry->soflow_lastused = net_uptime(); in soflow_get_flow()
1186 soflow_update_flow_stats(hash_entry, data_size, direction == SOFLOW_DIRECTION_OUTBOUND); in soflow_get_flow()
1190 return hash_entry; in soflow_get_flow()
1208 hash_entry = soflow_db_add_entry(so->so_flow_db, local, remote); in soflow_get_flow()
1209 if (hash_entry == NULL) { in soflow_get_flow()
1216 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1221hash_entry->soflow_outifindex = inp->inp_last_outifp ? inp->inp_last_outifp->if_index : rcv_ifinde… in soflow_get_flow()
1226 soflow_entry_update_local(so->so_flow_db, hash_entry, local, control, rcv_ifindex); in soflow_get_flow()
1228 hash_entry->soflow_outgoing = (direction == SOFLOW_DIRECTION_OUTBOUND); in soflow_get_flow()
1230 soflow_update_flow_stats(hash_entry, data_size, direction == SOFLOW_DIRECTION_OUTBOUND); in soflow_get_flow()
1237 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1240 uuid_generate_random(hash_entry->soflow_uuid); in soflow_get_flow()
1241 hash_entry->soflow_nstat_context = nstat_provider_stats_open((nstat_provider_context) hash_entry, in soflow_get_flow()
1245 …SOFLOW_LOG(LOG_INFO, so, hash_entry->soflow_debug, "<Open nstat> - context %lX", (unsigned long)ha… in soflow_get_flow()
1253 TAILQ_INSERT_TAIL(&soflow_entry_head, hash_entry, soflow_entry_list_link); in soflow_get_flow()
1263 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "Added entry"); in soflow_get_flow()
1264 return hash_entry; in soflow_get_flow()
1371 soflow_gc_idle_timed_out(struct soflow_hash_entry *hash_entry, int timeout, u_int64_t current_time) in soflow_gc_idle_timed_out() argument
1373 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_gc_idle_timed_out()
1375 if (hash_entry && (current_time - hash_entry->soflow_lastused >= (u_int64_t)timeout)) { in soflow_gc_idle_timed_out()
1376 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "GC Idle Timeout detected"); in soflow_gc_idle_timed_out()
1440 struct soflow_hash_entry *hash_entry = NULL; in soflow_gc_expire() local
1457 TAILQ_FOREACH(hash_entry, &soflow_entry_head, soflow_entry_list_link) { in soflow_gc_expire()
1461 so = hash_entry->soflow_db ? hash_entry->soflow_db->soflow_db_so : NULL; in soflow_gc_expire()
1464 hash_entry->soflow_gc = soflow_gc_idle_timed_out(hash_entry, SOFLOW_GC_IDLE_TO, current_time); in soflow_gc_expire()
1465hash_entry->soflow_feat_gc = (soflow_feat_gc_needed_func_ptr != NULL && soflow_feat_gc_needed_func… in soflow_gc_expire()
1467 if (hash_entry->soflow_gc || hash_entry->soflow_feat_gc) { in soflow_gc_expire()