Lines Matching refs:hash_entry
397 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_init() local
408 db->soflow_db_debug = SOFLOW_ENABLE_DEBUG(so, hash_entry); in soflow_db_init()
416 soflow_entry_free(struct soflow_hash_entry *hash_entry) in soflow_entry_free() argument
418 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_entry_free()
420 if (hash_entry == NULL) { in soflow_entry_free()
424 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "Free entry"); in soflow_entry_free()
425 kfree_type(struct soflow_hash_entry, hash_entry); in soflow_entry_free()
429 soflow_db_remove_entry(struct soflow_db *db, struct soflow_hash_entry *hash_entry) in soflow_db_remove_entry() argument
431 if (hash_entry == NULL) { in soflow_db_remove_entry()
439 if (hash_entry->soflow_nstat_context != NULL) { in soflow_db_remove_entry()
440 …OW_LOG(LOG_INFO, db->soflow_db_so, hash_entry->soflow_debug, "<Close nstat> - context %lX", (unsig… in soflow_db_remove_entry()
441 nstat_provider_stats_close(hash_entry->soflow_nstat_context); in soflow_db_remove_entry()
442 hash_entry->soflow_nstat_context = NULL; in soflow_db_remove_entry()
443 SOFLOW_ENTRY_FREE(hash_entry); in soflow_db_remove_entry()
448 if (db->soflow_db_only_entry == hash_entry) { in soflow_db_remove_entry()
451 LIST_REMOVE(hash_entry, soflow_entry_link); in soflow_db_remove_entry()
454 if (hash_entry->soflow_feat_ctxt != NULL && soflow_feat_detach_entry_func_ptr != NULL) { in soflow_db_remove_entry()
455 soflow_feat_detach_entry_func_ptr(db->soflow_db_so, hash_entry); in soflow_db_remove_entry()
456 hash_entry->soflow_feat_ctxt = NULL; in soflow_db_remove_entry()
457 hash_entry->soflow_feat_ctxt_id = 0; in soflow_db_remove_entry()
460 hash_entry->soflow_db = NULL; in soflow_db_remove_entry()
464 TAILQ_REMOVE(&soflow_entry_head, hash_entry, soflow_entry_list_link); in soflow_db_remove_entry()
469 SOFLOW_ENTRY_FREE(hash_entry); in soflow_db_remove_entry()
649 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_get_feature_context() local
678 hash_entry = soflow_db_lookup_by_feature_context_id(db, feature_context_id); in soflow_db_get_feature_context()
679 context = hash_entry != NULL ? hash_entry->soflow_feat_ctxt : NULL; in soflow_db_get_feature_context()
689 struct soflow_hash_entry *hash_entry = NULL; in soflow_db_get_feature_context_id() local
704 hash_entry = soflow_db_lookup_entry(db, local, remote, false); in soflow_db_get_feature_context_id()
705 if (hash_entry == NULL) { in soflow_db_get_feature_context_id()
707 hash_entry = soflow_db_lookup_entry(db, local, remote, true); in soflow_db_get_feature_context_id()
709 if (hash_entry != NULL && hash_entry->soflow_feat_ctxt != NULL) { in soflow_db_get_feature_context_id()
710 context_id = hash_entry->soflow_feat_ctxt_id; in soflow_db_get_feature_context_id()
946 struct soflow_hash_entry *hash_entry = (struct soflow_hash_entry *) ctx; in soflow_nstat_provider_request_vals() local
947 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_nstat_provider_request_vals()
953 if (hash_entry == NULL || so == NULL || inp == NULL) { in soflow_nstat_provider_request_vals()
958 if (hash_entry->soflow_outifindex) { in soflow_nstat_provider_request_vals()
959 struct ifnet *ifp = ifindex2ifnet[hash_entry->soflow_outifindex]; in soflow_nstat_provider_request_vals()
963 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, "ifflagsp set to 0x%X", *ifflagsp); in soflow_nstat_provider_request_vals()
970 countsp->nstat_rxpackets = hash_entry->soflow_rxpackets; in soflow_nstat_provider_request_vals()
971 countsp->nstat_rxbytes = hash_entry->soflow_rxbytes; in soflow_nstat_provider_request_vals()
972 countsp->nstat_txpackets = hash_entry->soflow_txpackets; in soflow_nstat_provider_request_vals()
973 countsp->nstat_txbytes = hash_entry->soflow_txbytes; in soflow_nstat_provider_request_vals()
975 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, in soflow_nstat_provider_request_vals()
995 uuid_copy(desc->fuuid, hash_entry->soflow_uuid); in soflow_nstat_provider_request_vals()
997 if (hash_entry->soflow_family == AF_INET6) { in soflow_nstat_provider_request_vals()
998 …in6_ip6_to_sockaddr(&hash_entry->soflow_laddr.addr6, hash_entry->soflow_lport, hash_entry->soflow_… in soflow_nstat_provider_request_vals()
1000 …in6_ip6_to_sockaddr(&hash_entry->soflow_faddr.addr6, hash_entry->soflow_fport, hash_entry->soflow_… in soflow_nstat_provider_request_vals()
1002 } else if (hash_entry->soflow_family == AF_INET) { in soflow_nstat_provider_request_vals()
1005 desc->local.v4.sin_port = hash_entry->soflow_lport; in soflow_nstat_provider_request_vals()
1006 desc->local.v4.sin_addr = hash_entry->soflow_laddr.addr46.ia46_addr4; in soflow_nstat_provider_request_vals()
1010 desc->remote.v4.sin_port = hash_entry->soflow_fport; in soflow_nstat_provider_request_vals()
1011 desc->remote.v4.sin_addr = hash_entry->soflow_faddr.addr46.ia46_addr4; in soflow_nstat_provider_request_vals()
1014 desc->ifindex = hash_entry->soflow_outifindex; in soflow_nstat_provider_request_vals()
1015 if (hash_entry->soflow_outifindex) { in soflow_nstat_provider_request_vals()
1016 struct ifnet *ifp = ifindex2ifnet[hash_entry->soflow_outifindex]; in soflow_nstat_provider_request_vals()
1025 if (hash_entry->soflow_debug) { in soflow_nstat_provider_request_vals()
1026 switch (hash_entry->soflow_family) { in soflow_nstat_provider_request_vals()
1045 SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, in soflow_nstat_provider_request_vals()
1067 struct soflow_hash_entry *hash_entry = (struct soflow_hash_entry *) ctx; in soflow_nstat_provider_request_extensions() local
1068 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_nstat_provider_request_extensions()
1073 if (hash_entry == NULL || so == NULL || inp == NULL) { in soflow_nstat_provider_request_extensions()
1096 if (hash_entry->soflow_debug) { in soflow_nstat_provider_request_extensions()
1097 …SOFLOW_LOG(LOG_DEBUG, so, hash_entry->soflow_debug, "Collected NSTAT domain_info:pid %d domain <%s… in soflow_nstat_provider_request_extensions()
1119 soflow_update_flow_stats(struct soflow_hash_entry *hash_entry, size_t data_size, bool outgoing) in soflow_update_flow_stats() argument
1121 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_update_flow_stats()
1123 if (hash_entry != NULL) { in soflow_update_flow_stats()
1125 hash_entry->soflow_txbytes += data_size; in soflow_update_flow_stats()
1126 hash_entry->soflow_txpackets++; in soflow_update_flow_stats()
1127 SOFLOW_ENTRY_LOG(LOG_DEBUG, so, hash_entry, hash_entry->soflow_debug, "Stats update - Outgoing"); in soflow_update_flow_stats()
1129 hash_entry->soflow_rxbytes += data_size; in soflow_update_flow_stats()
1130 hash_entry->soflow_rxpackets++; in soflow_update_flow_stats()
1131 SOFLOW_ENTRY_LOG(LOG_DEBUG, so, hash_entry, hash_entry->soflow_debug, "Stats update - Incoming"); in soflow_update_flow_stats()
1140 struct soflow_hash_entry *hash_entry = NULL; in soflow_get_flow() local
1158 hash_entry = soflow_db_lookup_entry(so->so_flow_db, local, remote, false); in soflow_get_flow()
1159 if (hash_entry == NULL) { in soflow_get_flow()
1161 hash_entry = soflow_db_lookup_entry(so->so_flow_db, local, remote, true); in soflow_get_flow()
1163 if (hash_entry != NULL) { in soflow_get_flow()
1166 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1172 if (hash_entry->soflow_outifindex == 0 || in soflow_get_flow()
1173 …soflow_entry_local_address_needs_update(hash_entry) || soflow_entry_local_port_needs_update(so, ha… in soflow_get_flow()
1174 soflow_entry_update_local(so->so_flow_db, hash_entry, local, control, rcv_ifindex); in soflow_get_flow()
1176 hash_entry->soflow_lastused = net_uptime(); in soflow_get_flow()
1178 soflow_update_flow_stats(hash_entry, data_size, direction == SOFLOW_DIRECTION_OUTBOUND); in soflow_get_flow()
1182 return hash_entry; in soflow_get_flow()
1200 hash_entry = soflow_db_add_entry(so->so_flow_db, local, remote); in soflow_get_flow()
1201 if (hash_entry == NULL) { in soflow_get_flow()
1208 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1213 …hash_entry->soflow_outifindex = inp->inp_last_outifp ? inp->inp_last_outifp->if_index : rcv_ifinde… in soflow_get_flow()
1218 soflow_entry_update_local(so->so_flow_db, hash_entry, local, control, rcv_ifindex); in soflow_get_flow()
1220 hash_entry->soflow_outgoing = (direction == SOFLOW_DIRECTION_OUTBOUND); in soflow_get_flow()
1222 soflow_update_flow_stats(hash_entry, data_size, direction == SOFLOW_DIRECTION_OUTBOUND); in soflow_get_flow()
1229 if (os_ref_retain_try(&hash_entry->soflow_ref_count) == false) { in soflow_get_flow()
1232 uuid_generate_random(hash_entry->soflow_uuid); in soflow_get_flow()
1233 hash_entry->soflow_nstat_context = nstat_provider_stats_open((nstat_provider_context) hash_entry, in soflow_get_flow()
1237 …SOFLOW_LOG(LOG_INFO, so, hash_entry->soflow_debug, "<Open nstat> - context %lX", (unsigned long)ha… in soflow_get_flow()
1245 TAILQ_INSERT_TAIL(&soflow_entry_head, hash_entry, soflow_entry_list_link); in soflow_get_flow()
1255 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "Added entry"); in soflow_get_flow()
1256 return hash_entry; in soflow_get_flow()
1363 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
1365 …struct socket *so = (hash_entry && hash_entry->soflow_db) ? hash_entry->soflow_db->soflow_db_so : … in soflow_gc_idle_timed_out()
1367 if (hash_entry && (current_time - hash_entry->soflow_lastused >= (u_int64_t)timeout)) { in soflow_gc_idle_timed_out()
1368 SOFLOW_ENTRY_LOG(LOG_INFO, so, hash_entry, hash_entry->soflow_debug, "GC Idle Timeout detected"); in soflow_gc_idle_timed_out()
1432 struct soflow_hash_entry *hash_entry = NULL; in soflow_gc_expire() local
1449 TAILQ_FOREACH(hash_entry, &soflow_entry_head, soflow_entry_list_link) { in soflow_gc_expire()
1453 so = hash_entry->soflow_db ? hash_entry->soflow_db->soflow_db_so : NULL; in soflow_gc_expire()
1456 hash_entry->soflow_gc = soflow_gc_idle_timed_out(hash_entry, SOFLOW_GC_IDLE_TO, current_time); in soflow_gc_expire()
1457 …hash_entry->soflow_feat_gc = (soflow_feat_gc_needed_func_ptr != NULL && soflow_feat_gc_needed_func… in soflow_gc_expire()
1459 if (hash_entry->soflow_gc || hash_entry->soflow_feat_gc) { in soflow_gc_expire()