Lines Matching refs:hash_entry
399 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_init() local
409 db->soflow_db_debug = SOFLOW_ENABLE_DEBUG(so, hash_entry); in soflow_db_init()
417 soflow_entry_free(struct soflow_hash_entry *hash_entry) in soflow_entry_free() argument
419 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_entry_free()
421 if (hash_entry == NULL) { in soflow_entry_free()
425 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "Free entry"); in soflow_entry_free()
426 kfree_type(struct soflow_hash_entry, hash_entry); in soflow_entry_free()
430 soflow_db_remove_entry(struct soflow_db *db, struct soflow_hash_entry *hash_entry) in soflow_db_remove_entry() argument
432 if (hash_entry == NULL) { in soflow_db_remove_entry()
440 if (hash_entry->soflow_nstat_context != NULL) { in soflow_db_remove_entry()
441 …OW_LOG(LOG_INFO, db->soflow_db_so, hash_entry->soflow_debug, "<Close nstat> - context %lX", (unsig… in soflow_db_remove_entry()
442 nstat_provider_stats_close(hash_entry->soflow_nstat_context); in soflow_db_remove_entry()
443 hash_entry->soflow_nstat_context = NULL; in soflow_db_remove_entry()
444 SOFLOW_ENTRY_FREE(hash_entry); in soflow_db_remove_entry()
449 if (db->soflow_db_only_entry == hash_entry) { in soflow_db_remove_entry()
452 LIST_REMOVE(hash_entry, soflow_entry_link); in soflow_db_remove_entry()
455 if (hash_entry->soflow_feat_ctxt != NULL && soflow_feat_detach_entry_func_ptr != NULL) { in soflow_db_remove_entry()
456 soflow_feat_detach_entry_func_ptr(db->soflow_db_so, hash_entry); in soflow_db_remove_entry()
457 hash_entry->soflow_feat_ctxt = NULL; in soflow_db_remove_entry()
458 hash_entry->soflow_feat_ctxt_id = 0; in soflow_db_remove_entry()
461 hash_entry->soflow_db = NULL; in soflow_db_remove_entry()
465 TAILQ_REMOVE(&soflow_entry_head, hash_entry, soflow_entry_list_link); in soflow_db_remove_entry()
470 SOFLOW_ENTRY_FREE(hash_entry); in soflow_db_remove_entry()
650 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_get_feature_context() local
679 hash_entry = soflow_db_lookup_by_feature_context_id(db, feature_context_id); in soflow_db_get_feature_context()
680 context = hash_entry != NULL ? hash_entry->soflow_feat_ctxt : NULL; in soflow_db_get_feature_context()
690 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_get_feature_context_id() local
705 hash_entry = soflow_db_lookup_entry(db, local, remote, false); in soflow_db_get_feature_context_id()
706 if (hash_entry == NULL) { in soflow_db_get_feature_context_id()
708 hash_entry = soflow_db_lookup_entry(db, local, remote, true); in soflow_db_get_feature_context_id()
710 if (hash_entry != NULL && hash_entry->soflow_feat_ctxt != NULL) { in soflow_db_get_feature_context_id()
711 context_id = hash_entry->soflow_feat_ctxt_id; in soflow_db_get_feature_context_id()
943 struct soflow_hash_entry *hash_entry = (struct soflow_hash_entry *) ctx; in soflow_nstat_provider_request_vals() local
944 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_nstat_provider_request_vals()
950 if (hash_entry == NULL || so == NULL || inp == NULL) { in soflow_nstat_provider_request_vals()
955 if (hash_entry->soflow_outifindex) { in soflow_nstat_provider_request_vals()
956 struct ifnet *ifp = ifindex2ifnet[hash_entry->soflow_outifindex]; in soflow_nstat_provider_request_vals()
960 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, "ifflagsp set to 0x%X", *ifflagsp); in soflow_nstat_provider_request_vals()
967 countsp->nstat_rxpackets = hash_entry->soflow_rxpackets; in soflow_nstat_provider_request_vals()
968 countsp->nstat_rxbytes = hash_entry->soflow_rxbytes; in soflow_nstat_provider_request_vals()
969 countsp->nstat_txpackets = hash_entry->soflow_txpackets; in soflow_nstat_provider_request_vals()
970 countsp->nstat_txbytes = hash_entry->soflow_txbytes; in soflow_nstat_provider_request_vals()
972 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, in soflow_nstat_provider_request_vals()
992 uuid_copy(desc->fuuid, hash_entry->soflow_uuid); in soflow_nstat_provider_request_vals()
994 if (hash_entry->soflow_family == AF_INET6) { in soflow_nstat_provider_request_vals()
995 …in6_ip6_to_sockaddr(&hash_entry->soflow_laddr.addr6, hash_entry->soflow_lport, hash_entry->soflow_… in soflow_nstat_provider_request_vals()
997 …in6_ip6_to_sockaddr(&hash_entry->soflow_faddr.addr6, hash_entry->soflow_fport, hash_entry->soflow_… in soflow_nstat_provider_request_vals()
999 } else if (hash_entry->soflow_family == AF_INET) { in soflow_nstat_provider_request_vals()
1002 desc->local.v4.sin_port = hash_entry->soflow_lport; in soflow_nstat_provider_request_vals()
1003 desc->local.v4.sin_addr = hash_entry->soflow_laddr.addr46.ia46_addr4; in soflow_nstat_provider_request_vals()
1007 desc->remote.v4.sin_port = hash_entry->soflow_fport; in soflow_nstat_provider_request_vals()
1008 desc->remote.v4.sin_addr = hash_entry->soflow_faddr.addr46.ia46_addr4; in soflow_nstat_provider_request_vals()
1011 desc->ifindex = hash_entry->soflow_outifindex; in soflow_nstat_provider_request_vals()
1012 if (hash_entry->soflow_outifindex) { in soflow_nstat_provider_request_vals()
1013 struct ifnet *ifp = ifindex2ifnet[hash_entry->soflow_outifindex]; in soflow_nstat_provider_request_vals()
1022 if (hash_entry->soflow_debug) { in soflow_nstat_provider_request_vals()
1023 switch (hash_entry->soflow_family) { in soflow_nstat_provider_request_vals()
1042 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, in soflow_nstat_provider_request_vals()
1064 struct soflow_hash_entry *hash_entry = (struct soflow_hash_entry *) ctx; in soflow_nstat_provider_request_extensions() local
1065 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_nstat_provider_request_extensions()
1070 if (hash_entry == NULL || so == NULL || inp == NULL) { in soflow_nstat_provider_request_extensions()
1093 if (hash_entry->soflow_debug) { in soflow_nstat_provider_request_extensions()
1094 …SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, "Collected NSTAT domain_info:pid %d domain <%s… in soflow_nstat_provider_request_extensions()
1116 soflow_update_flow_stats(struct soflow_hash_entry *hash_entry, size_t data_size, bool outgoing) in soflow_update_flow_stats() argument
1118 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_update_flow_stats()
1120 if (hash_entry != NULL) { in soflow_update_flow_stats()
1122 hash_entry->soflow_txbytes += data_size; in soflow_update_flow_stats()
1123 hash_entry->soflow_txpackets++; in soflow_update_flow_stats()
1124 SOFLOW_ENTRY_LOG(LOG_DEBUG, so, hash_entry, hash_entry->soflow_debug, "Stats update - Outgoing"); in soflow_update_flow_stats()
1126 hash_entry->soflow_rxbytes += data_size; in soflow_update_flow_stats()
1127 hash_entry->soflow_rxpackets++; in soflow_update_flow_stats()
1128 SOFLOW_ENTRY_LOG(LOG_DEBUG, so, hash_entry, hash_entry->soflow_debug, "Stats update - Incoming"); in soflow_update_flow_stats()
1137 struct soflow_hash_entry *hash_entry = NULL; in soflow_get_flow() local
1155 hash_entry = soflow_db_lookup_entry(so->so_flow_db, local, remote, false); in soflow_get_flow()
1156 if (hash_entry == NULL) { in soflow_get_flow()
1158 hash_entry = soflow_db_lookup_entry(so->so_flow_db, local, remote, true); in soflow_get_flow()
1160 if (hash_entry != NULL) { in soflow_get_flow()
1163 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1169 if (hash_entry->soflow_outifindex == 0 || in soflow_get_flow()
1170 …soflow_entry_local_address_needs_update(hash_entry) || soflow_entry_local_port_needs_update(so, ha… in soflow_get_flow()
1171 soflow_entry_update_local(so->so_flow_db, hash_entry, local, control, rcv_ifindex); in soflow_get_flow()
1173 hash_entry->soflow_lastused = net_uptime(); in soflow_get_flow()
1174 soflow_update_flow_stats(hash_entry, data_size, outgoing); in soflow_get_flow()
1177 return hash_entry; in soflow_get_flow()
1188 hash_entry = soflow_db_add_entry(so->so_flow_db, local, remote); in soflow_get_flow()
1189 if (hash_entry == NULL) { in soflow_get_flow()
1196 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1201 …hash_entry->soflow_outifindex = inp->inp_last_outifp ? inp->inp_last_outifp->if_index : rcv_ifinde… in soflow_get_flow()
1206 soflow_entry_update_local(so->so_flow_db, hash_entry, local, control, rcv_ifindex); in soflow_get_flow()
1208 hash_entry->soflow_outgoing = outgoing; in soflow_get_flow()
1209 soflow_update_flow_stats(hash_entry, data_size, outgoing); in soflow_get_flow()
1215 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1218 uuid_generate_random(hash_entry->soflow_uuid); in soflow_get_flow()
1219 hash_entry->soflow_nstat_context = nstat_provider_stats_open((nstat_provider_context) hash_entry, in soflow_get_flow()
1223 …SOFLOW_LOG(LOG_INFO, so, hash_entry->soflow_debug, "<Open nstat> - context %lX", (unsigned long)ha… in soflow_get_flow()
1231 TAILQ_INSERT_TAIL(&soflow_entry_head, hash_entry, soflow_entry_list_link); in soflow_get_flow()
1241 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "Added entry"); in soflow_get_flow()
1242 return hash_entry; in soflow_get_flow()
1349 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
1351 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_gc_idle_timed_out()
1353 if (hash_entry && (current_time - hash_entry->soflow_lastused >= (u_int64_t)timeout)) { in soflow_gc_idle_timed_out()
1354 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "GC Idle Timeout detected"); in soflow_gc_idle_timed_out()
1413 struct soflow_hash_entry *hash_entry = NULL; in soflow_gc_expire() local
1430 TAILQ_FOREACH(hash_entry, &soflow_entry_head, soflow_entry_list_link) { in soflow_gc_expire()
1434 so = hash_entry->soflow_db ? hash_entry->soflow_db->soflow_db_so : NULL; in soflow_gc_expire()
1437 hash_entry->soflow_gc = soflow_gc_idle_timed_out(hash_entry, SOFLOW_GC_IDLE_TO, current_time); in soflow_gc_expire()
1438 …hash_entry->soflow_feat_gc = (soflow_feat_gc_needed_func_ptr != NULL && soflow_feat_gc_needed_func… in soflow_gc_expire()
1440 if (hash_entry->soflow_gc || hash_entry->soflow_feat_gc) { in soflow_gc_expire()