"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/network_inspectors/appid/service_state.cc" between
snort3-3.1.28.0.tar.gz and snort3-3.1.29.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

service_state.cc  (snort3-3.1.28.0):service_state.cc  (snort3-3.1.29.0)
skipping to change at line 216 skipping to change at line 216
return false; return false;
} }
void AppIdServiceState::clean() void AppIdServiceState::clean()
{ {
delete service_state_cache; delete service_state_cache;
service_state_cache = nullptr; service_state_cache = nullptr;
} }
ServiceDiscoveryState* AppIdServiceState::add(const SfIp* ip, IpProtocol proto, uint16_t port, ServiceDiscoveryState* AppIdServiceState::add(const SfIp* ip, IpProtocol proto, uint16_t port,
int16_t group, uint16_t asid, bool decrypted, bool do_touch) int16_t group, uint32_t asid, bool decrypted, bool do_touch)
{ {
return service_state_cache->add( AppIdServiceStateKey(ip, proto, port, group , return service_state_cache->add( AppIdServiceStateKey(ip, proto, port, group ,
asid, decrypted), do_touch ); asid, decrypted), do_touch );
} }
ServiceDiscoveryState* AppIdServiceState::get(const SfIp* ip, IpProtocol proto, uint16_t port, ServiceDiscoveryState* AppIdServiceState::get(const SfIp* ip, IpProtocol proto, uint16_t port,
int16_t group, uint16_t asid, bool decrypted, bool do_touch) int16_t group, uint32_t asid, bool decrypted, bool do_touch)
{ {
return service_state_cache->get( AppIdServiceStateKey(ip, proto, port, group , return service_state_cache->get( AppIdServiceStateKey(ip, proto, port, group ,
asid, decrypted), do_touch); asid, decrypted), do_touch);
} }
void AppIdServiceState::remove(const SfIp* ip, IpProtocol proto, uint16_t port, void AppIdServiceState::remove(const SfIp* ip, IpProtocol proto, uint16_t port,
int16_t group, uint16_t asid, bool decrypted) int16_t group, uint32_t asid, bool decrypted)
{ {
AppIdServiceStateKey ssk(ip, proto, port, group, asid, decrypted); AppIdServiceStateKey ssk(ip, proto, port, group, asid, decrypted);
Map_t::iterator it = service_state_cache->find(ssk); Map_t::iterator it = service_state_cache->find(ssk);
if ( !service_state_cache->remove(it) ) if ( !service_state_cache->remove(it) )
{ {
char ipstr[INET6_ADDRSTRLEN]; char ipstr[INET6_ADDRSTRLEN];
ipstr[0] = 0; ipstr[0] = 0;
sfip_ntop(ip, ipstr, sizeof(ipstr)); sfip_ntop(ip, ipstr, sizeof(ipstr));
ErrorMessage("Failed to remove from hash: %s:%u:%hu\n", ipstr, (unsigned )proto, port); ErrorMessage("Failed to remove from hash: %s:%u:%hu\n", ipstr, (unsigned )proto, port);
} }
} }
void AppIdServiceState::check_reset(AppIdSession& asd, const SfIp* ip, uint16_t port, void AppIdServiceState::check_reset(AppIdSession& asd, const SfIp* ip, uint16_t port,
int16_t group, uint16_t asid) int16_t group, uint32_t asid)
{ {
ServiceDiscoveryState* sds = AppIdServiceState::get(ip, IpProtocol::TCP, por t, ServiceDiscoveryState* sds = AppIdServiceState::get(ip, IpProtocol::TCP, por t,
group, asid, asd.is_decrypted()); group, asid, asd.is_decrypted());
if ( sds ) if ( sds )
{ {
if ( !sds->get_reset_time() ) if ( !sds->get_reset_time() )
sds->set_reset_time(packet_time() ); sds->set_reset_time(packet_time() );
else if ( ( packet_time() - sds->get_reset_time() ) >= 60 ) else if ( ( packet_time() - sds->get_reset_time() ) >= 60 )
{ {
AppIdServiceState::remove(ip, IpProtocol::TCP, port, group, AppIdServiceState::remove(ip, IpProtocol::TCP, port, group,
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)