Lines Matching refs:hash_entry

396 	struct soflow_hash_entry *hash_entry = NULL;  in soflow_db_init()  local
407 db->soflow_db_debug = SOFLOW_ENABLE_DEBUG(so, hash_entry); in soflow_db_init()
415 soflow_entry_free(struct soflow_hash_entry *hash_entry) in soflow_entry_free() argument
417 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_entry_free()
419 if (hash_entry == NULL) { in soflow_entry_free()
423 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "Free entry"); in soflow_entry_free()
424 kfree_type(struct soflow_hash_entry, hash_entry); in soflow_entry_free()
428 soflow_db_remove_entry(struct soflow_db *db, struct soflow_hash_entry *hash_entry) in soflow_db_remove_entry() argument
430 if (hash_entry == NULL) { in soflow_db_remove_entry()
438 if (hash_entry->soflow_nstat_context != NULL) { in soflow_db_remove_entry()
439 …OW_LOG(LOG_INFO, db->soflow_db_so, hash_entry->soflow_debug, "<Close nstat> - context %lX", (unsig… in soflow_db_remove_entry()
440 nstat_provider_stats_close(hash_entry->soflow_nstat_context); in soflow_db_remove_entry()
441 hash_entry->soflow_nstat_context = NULL; in soflow_db_remove_entry()
442 SOFLOW_ENTRY_FREE(hash_entry); in soflow_db_remove_entry()
447 if (db->soflow_db_only_entry == hash_entry) { in soflow_db_remove_entry()
450 LIST_REMOVE(hash_entry, soflow_entry_link); in soflow_db_remove_entry()
453 if (hash_entry->soflow_feat_ctxt != NULL && soflow_feat_detach_entry_func_ptr != NULL) { in soflow_db_remove_entry()
454 soflow_feat_detach_entry_func_ptr(db->soflow_db_so, hash_entry); in soflow_db_remove_entry()
455 hash_entry->soflow_feat_ctxt = NULL; in soflow_db_remove_entry()
456 hash_entry->soflow_feat_ctxt_id = 0; in soflow_db_remove_entry()
459 hash_entry->soflow_db = NULL; in soflow_db_remove_entry()
463 TAILQ_REMOVE(&soflow_entry_head, hash_entry, soflow_entry_list_link); in soflow_db_remove_entry()
468 SOFLOW_ENTRY_FREE(hash_entry); in soflow_db_remove_entry()
648 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_get_feature_context() local
677 hash_entry = soflow_db_lookup_by_feature_context_id(db, feature_context_id); in soflow_db_get_feature_context()
678 context = hash_entry != NULL ? hash_entry->soflow_feat_ctxt : NULL; in soflow_db_get_feature_context()
688 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_get_feature_context_id() local
703 hash_entry = soflow_db_lookup_entry(db, local, remote, false); in soflow_db_get_feature_context_id()
704 if (hash_entry == NULL) { in soflow_db_get_feature_context_id()
706 hash_entry = soflow_db_lookup_entry(db, local, remote, true); in soflow_db_get_feature_context_id()
708 if (hash_entry != NULL && hash_entry->soflow_feat_ctxt != NULL) { in soflow_db_get_feature_context_id()
709 context_id = hash_entry->soflow_feat_ctxt_id; in soflow_db_get_feature_context_id()
944 struct soflow_hash_entry *hash_entry = (struct soflow_hash_entry *) ctx; in soflow_nstat_provider_request_vals() local
945 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_nstat_provider_request_vals()
951 if (hash_entry == NULL || so == NULL || inp == NULL) { in soflow_nstat_provider_request_vals()
956 if (hash_entry->soflow_outifindex) { in soflow_nstat_provider_request_vals()
957 struct ifnet *ifp = ifindex2ifnet[hash_entry->soflow_outifindex]; in soflow_nstat_provider_request_vals()
961 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, "ifflagsp set to 0x%X", *ifflagsp); in soflow_nstat_provider_request_vals()
968 countsp->nstat_rxpackets = hash_entry->soflow_rxpackets; in soflow_nstat_provider_request_vals()
969 countsp->nstat_rxbytes = hash_entry->soflow_rxbytes; in soflow_nstat_provider_request_vals()
970 countsp->nstat_txpackets = hash_entry->soflow_txpackets; in soflow_nstat_provider_request_vals()
971 countsp->nstat_txbytes = hash_entry->soflow_txbytes; in soflow_nstat_provider_request_vals()
973 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, in soflow_nstat_provider_request_vals()
993 uuid_copy(desc->fuuid, hash_entry->soflow_uuid); in soflow_nstat_provider_request_vals()
995 if (hash_entry->soflow_family == AF_INET6) { in soflow_nstat_provider_request_vals()
996 …in6_ip6_to_sockaddr(&hash_entry->soflow_laddr.addr6, hash_entry->soflow_lport, hash_entry->soflow_… in soflow_nstat_provider_request_vals()
998 …in6_ip6_to_sockaddr(&hash_entry->soflow_faddr.addr6, hash_entry->soflow_fport, hash_entry->soflow_… in soflow_nstat_provider_request_vals()
1000 } else if (hash_entry->soflow_family == AF_INET) { in soflow_nstat_provider_request_vals()
1003 desc->local.v4.sin_port = hash_entry->soflow_lport; in soflow_nstat_provider_request_vals()
1004 desc->local.v4.sin_addr = hash_entry->soflow_laddr.addr46.ia46_addr4; in soflow_nstat_provider_request_vals()
1008 desc->remote.v4.sin_port = hash_entry->soflow_fport; in soflow_nstat_provider_request_vals()
1009 desc->remote.v4.sin_addr = hash_entry->soflow_faddr.addr46.ia46_addr4; in soflow_nstat_provider_request_vals()
1012 desc->ifindex = hash_entry->soflow_outifindex; in soflow_nstat_provider_request_vals()
1013 if (hash_entry->soflow_outifindex) { in soflow_nstat_provider_request_vals()
1014 struct ifnet *ifp = ifindex2ifnet[hash_entry->soflow_outifindex]; in soflow_nstat_provider_request_vals()
1023 if (hash_entry->soflow_debug) { in soflow_nstat_provider_request_vals()
1024 switch (hash_entry->soflow_family) { in soflow_nstat_provider_request_vals()
1043 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, in soflow_nstat_provider_request_vals()
1065 struct soflow_hash_entry *hash_entry = (struct soflow_hash_entry *) ctx; in soflow_nstat_provider_request_extensions() local
1066 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_nstat_provider_request_extensions()
1071 if (hash_entry == NULL || so == NULL || inp == NULL) { in soflow_nstat_provider_request_extensions()
1094 if (hash_entry->soflow_debug) { in soflow_nstat_provider_request_extensions()
1095 …SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, "Collected NSTAT domain_info:pid %d domain <%s… in soflow_nstat_provider_request_extensions()
1117 soflow_update_flow_stats(struct soflow_hash_entry *hash_entry, size_t data_size, bool outgoing) in soflow_update_flow_stats() argument
1119 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_update_flow_stats()
1121 if (hash_entry != NULL) { in soflow_update_flow_stats()
1123 hash_entry->soflow_txbytes += data_size; in soflow_update_flow_stats()
1124 hash_entry->soflow_txpackets++; in soflow_update_flow_stats()
1125 SOFLOW_ENTRY_LOG(LOG_DEBUG, so, hash_entry, hash_entry->soflow_debug, "Stats update - Outgoing"); in soflow_update_flow_stats()
1127 hash_entry->soflow_rxbytes += data_size; in soflow_update_flow_stats()
1128 hash_entry->soflow_rxpackets++; in soflow_update_flow_stats()
1129 SOFLOW_ENTRY_LOG(LOG_DEBUG, so, hash_entry, hash_entry->soflow_debug, "Stats update - Incoming"); in soflow_update_flow_stats()
1138 struct soflow_hash_entry *hash_entry = NULL; in soflow_get_flow() local
1156 hash_entry = soflow_db_lookup_entry(so->so_flow_db, local, remote, false); in soflow_get_flow()
1157 if (hash_entry == NULL) { in soflow_get_flow()
1159 hash_entry = soflow_db_lookup_entry(so->so_flow_db, local, remote, true); in soflow_get_flow()
1161 if (hash_entry != NULL) { in soflow_get_flow()
1164 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1170 if (hash_entry->soflow_outifindex == 0 || in soflow_get_flow()
1171 …soflow_entry_local_address_needs_update(hash_entry) || soflow_entry_local_port_needs_update(so, ha… in soflow_get_flow()
1172 soflow_entry_update_local(so->so_flow_db, hash_entry, local, control, rcv_ifindex); in soflow_get_flow()
1174 hash_entry->soflow_lastused = net_uptime(); in soflow_get_flow()
1175 soflow_update_flow_stats(hash_entry, data_size, outgoing); in soflow_get_flow()
1178 return hash_entry; in soflow_get_flow()
1189 hash_entry = soflow_db_add_entry(so->so_flow_db, local, remote); in soflow_get_flow()
1190 if (hash_entry == NULL) { in soflow_get_flow()
1197 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1202hash_entry->soflow_outifindex = inp->inp_last_outifp ? inp->inp_last_outifp->if_index : rcv_ifinde… in soflow_get_flow()
1207 soflow_entry_update_local(so->so_flow_db, hash_entry, local, control, rcv_ifindex); in soflow_get_flow()
1209 hash_entry->soflow_outgoing = outgoing; in soflow_get_flow()
1210 soflow_update_flow_stats(hash_entry, data_size, outgoing); in soflow_get_flow()
1216 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1219 uuid_generate_random(hash_entry->soflow_uuid); in soflow_get_flow()
1220 hash_entry->soflow_nstat_context = nstat_provider_stats_open((nstat_provider_context) hash_entry, in soflow_get_flow()
1224 …SOFLOW_LOG(LOG_INFO, so, hash_entry->soflow_debug, "<Open nstat> - context %lX", (unsigned long)ha… in soflow_get_flow()
1232 TAILQ_INSERT_TAIL(&soflow_entry_head, hash_entry, soflow_entry_list_link); in soflow_get_flow()
1242 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "Added entry"); in soflow_get_flow()
1243 return hash_entry; in soflow_get_flow()
1350 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
1352 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_gc_idle_timed_out()
1354 if (hash_entry && (current_time - hash_entry->soflow_lastused >= (u_int64_t)timeout)) { in soflow_gc_idle_timed_out()
1355 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "GC Idle Timeout detected"); in soflow_gc_idle_timed_out()
1414 struct soflow_hash_entry *hash_entry = NULL; in soflow_gc_expire() local
1431 TAILQ_FOREACH(hash_entry, &soflow_entry_head, soflow_entry_list_link) { in soflow_gc_expire()
1435 so = hash_entry->soflow_db ? hash_entry->soflow_db->soflow_db_so : NULL; in soflow_gc_expire()
1438 hash_entry->soflow_gc = soflow_gc_idle_timed_out(hash_entry, SOFLOW_GC_IDLE_TO, current_time); in soflow_gc_expire()
1439hash_entry->soflow_feat_gc = (soflow_feat_gc_needed_func_ptr != NULL && soflow_feat_gc_needed_func… in soflow_gc_expire()
1441 if (hash_entry->soflow_gc || hash_entry->soflow_feat_gc) { in soflow_gc_expire()