From: Russ Combs Date: Thu, 2 Jul 2015 16:45:25 +0000 (-0400) Subject: rename user pkt to pdu X-Git-Tag: 3.0.0-233~927 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49bd47858536466eb401deaef2caf50b758129f8;p=thirdparty%2Fsnort3.git rename user pkt to pdu --- diff --git a/src/detection/detect.cc b/src/detection/detect.cc index 2baa25d31..d313775c6 100644 --- a/src/detection/detect.cc +++ b/src/detection/detect.cc @@ -335,7 +335,7 @@ bool snort_detect(Packet* p) case PktType::TCP: case PktType::UDP: case PktType::ICMP: - case PktType::USER: + case PktType::PDU: case PktType::FILE: { PROFILE_VARS; diff --git a/src/detection/fp_detect.cc b/src/detection/fp_detect.cc index 235c3998a..79fefd4c3 100644 --- a/src/detection/fp_detect.cc +++ b/src/detection/fp_detect.cc @@ -1289,7 +1289,7 @@ int fpEvalPacket(Packet* p) fpEvalHeaderSvc(p, omd, SNORT_PROTO_UDP); break; - case PktType::USER: + case PktType::PDU: if ( snort_conf->sopgTable->user_mode ) fpEvalHeaderSvc(p, omd, SNORT_PROTO_USER); diff --git a/src/flow/flow_control.cc b/src/flow/flow_control.cc index 796aeecb0..226e12fba 100644 --- a/src/flow/flow_control.cc +++ b/src/flow/flow_control.cc @@ -113,7 +113,7 @@ PegCount FlowControl::get_flows(PktType proto) case PktType::ICMP: return icmp_count; case PktType::TCP: return tcp_count; case PktType::UDP: return udp_count; - case PktType::USER: return user_count; + case PktType::PDU: return user_count; case PktType::FILE: return file_count; default: return 0; } @@ -139,7 +139,7 @@ void FlowControl::clear_counts() if ( (cache = get_cache(PktType::UDP)) ) cache->reset_prunes(); - if ( (cache = get_cache(PktType::USER)) ) + if ( (cache = get_cache(PktType::PDU)) ) cache->reset_prunes(); if ( (cache = get_cache(PktType::FILE)) ) @@ -166,7 +166,7 @@ inline FlowCache* FlowControl::get_cache (PktType proto) case PktType::ICMP: return icmp_cache; case PktType::TCP: return tcp_cache; case PktType::UDP: return udp_cache; - case PktType::USER: return user_cache; + case PktType::PDU: return user_cache; case PktType::FILE: return file_cache; default: return nullptr; } @@ -405,7 +405,7 @@ static void init_roles(Packet* p, Flow* flow) init_roles_udp(p, flow); break; - case PktType::USER: + case PktType::PDU: case PktType::FILE: init_roles_user(p, flow); break; @@ -715,7 +715,7 @@ void FlowControl::process_user(Packet* p) if ( !flow->session ) { - flow->init(PktType::USER); + flow->init(PktType::PDU); flow->session = get_user(flow); } diff --git a/src/managers/inspector_manager.cc b/src/managers/inspector_manager.cc index f0bf0ade8..7ff5e0a2c 100644 --- a/src/managers/inspector_manager.cc +++ b/src/managers/inspector_manager.cc @@ -614,7 +614,7 @@ static void instantiate_binder(SnortConfig* sc, FrameworkPolicy* fp) m->add((unsigned)PktType::UDP, wiz_id); if ( tcp or udp ) - m->add((unsigned)PktType::USER, wiz_id); + m->add((unsigned)PktType::PDU, wiz_id); const InspectApi* api = get_plugin(bind_id); InspectorManager::instantiate(api, m, sc); diff --git a/src/network_inspectors/binder/bind_module.cc b/src/network_inspectors/binder/bind_module.cc index 29e5cab25..21b6b9f2a 100644 --- a/src/network_inspectors/binder/bind_module.cc +++ b/src/network_inspectors/binder/bind_module.cc @@ -154,7 +154,7 @@ bool BinderModule::set(const char* fqn, Value& v, SnortConfig*) const PktType mask[] = { PktType::ANY, PktType::IP, PktType::ICMP, PktType::TCP, PktType::UDP, - PktType::USER, PktType::FILE + PktType::PDU, PktType::FILE }; work->when.protos = (unsigned)mask[v.get_long()]; } diff --git a/src/network_inspectors/binder/binder.cc b/src/network_inspectors/binder/binder.cc index 0ad2366c7..ad0b2892d 100644 --- a/src/network_inspectors/binder/binder.cc +++ b/src/network_inspectors/binder/binder.cc @@ -339,7 +339,7 @@ void Stuff::apply_session(Flow* flow, const HostAttributeEntry* host) set_session(flow, INS_UDP); break; - case PktType::USER: + case PktType::PDU: set_session(flow, INS_USER); break; diff --git a/src/protocols/packet.cc b/src/protocols/packet.cc index 9aa74349d..d173b19f0 100644 --- a/src/protocols/packet.cc +++ b/src/protocols/packet.cc @@ -110,7 +110,7 @@ const char* Packet::get_type() const case PktType::UDP: return "UDP"; - case PktType::USER: + case PktType::PDU: case PktType::FILE: if ( proto_bits & PROTO_BIT__TCP ) return "TCP"; diff --git a/src/protocols/packet.h b/src/protocols/packet.h index b4f2e5b95..a019acea3 100644 --- a/src/protocols/packet.h +++ b/src/protocols/packet.h @@ -195,7 +195,7 @@ struct SO_PUBLIC Packet { return ptrs.get_pkt_type() == PktType::ICMP; } inline bool is_data() const - { return (ptrs.get_pkt_type() == PktType::USER) or (ptrs.get_pkt_type() == PktType::FILE); } + { return (ptrs.get_pkt_type() == PktType::PDU) or (ptrs.get_pkt_type() == PktType::FILE); } inline bool is_cooked() const { return packet_flags & PKT_PSEUDO; } diff --git a/src/service_inspectors/ftp_telnet/ftp.cc b/src/service_inspectors/ftp_telnet/ftp.cc index cccd300b5..ec9a05e83 100644 --- a/src/service_inspectors/ftp_telnet/ftp.cc +++ b/src/service_inspectors/ftp_telnet/ftp.cc @@ -530,7 +530,7 @@ static const InspectApi fs_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "ftp", fs_init, diff --git a/src/service_inspectors/ftp_telnet/ftp_data.cc b/src/service_inspectors/ftp_telnet/ftp_data.cc index 858a03996..6e870c1b0 100644 --- a/src/service_inspectors/ftp_telnet/ftp_data.cc +++ b/src/service_inspectors/ftp_telnet/ftp_data.cc @@ -302,7 +302,7 @@ const InspectApi fd_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "ftp-data", fd_init, diff --git a/src/service_inspectors/ftp_telnet/telnet.cc b/src/service_inspectors/ftp_telnet/telnet.cc index f58195674..8d1d8c755 100644 --- a/src/service_inspectors/ftp_telnet/telnet.cc +++ b/src/service_inspectors/ftp_telnet/telnet.cc @@ -331,7 +331,7 @@ const InspectApi tn_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "telnet", tn_init, diff --git a/src/service_inspectors/http_inspect/http_inspect.cc b/src/service_inspectors/http_inspect/http_inspect.cc index c15673872..ad9c1b8f3 100644 --- a/src/service_inspectors/http_inspect/http_inspect.cc +++ b/src/service_inspectors/http_inspect/http_inspect.cc @@ -477,7 +477,7 @@ static const InspectApi hi_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, buffers, "http", hs_init, diff --git a/src/service_inspectors/imap/imap.cc b/src/service_inspectors/imap/imap.cc index 3997304d8..c2d6f54fa 100644 --- a/src/service_inspectors/imap/imap.cc +++ b/src/service_inspectors/imap/imap.cc @@ -895,7 +895,7 @@ const InspectApi imap_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "imap", imap_init, diff --git a/src/service_inspectors/nhttp_inspect/nhttp_api.cc b/src/service_inspectors/nhttp_inspect/nhttp_api.cc index ea9b6cffc..d38aa853f 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_api.cc +++ b/src/service_inspectors/nhttp_inspect/nhttp_api.cc @@ -63,7 +63,7 @@ const InspectApi NHttpApi::nhttp_api = NHttpApi::nhttp_mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, legacy_buffers, "http", NHttpApi::nhttp_init, diff --git a/src/service_inspectors/pop/pop.cc b/src/service_inspectors/pop/pop.cc index f5a2ccf4a..c9fce192c 100644 --- a/src/service_inspectors/pop/pop.cc +++ b/src/service_inspectors/pop/pop.cc @@ -827,7 +827,7 @@ const InspectApi pop_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "pop", pop_init, diff --git a/src/service_inspectors/rpc_decode/rpc_decode.cc b/src/service_inspectors/rpc_decode/rpc_decode.cc index 5c81caaa5..6412a6374 100644 --- a/src/service_inspectors/rpc_decode/rpc_decode.cc +++ b/src/service_inspectors/rpc_decode/rpc_decode.cc @@ -1120,7 +1120,7 @@ static const InspectApi rd_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "sunrpc", rd_init, diff --git a/src/service_inspectors/sip/sip.cc b/src/service_inspectors/sip/sip.cc index be6470279..49a5bdfa5 100644 --- a/src/service_inspectors/sip/sip.cc +++ b/src/service_inspectors/sip/sip.cc @@ -432,7 +432,7 @@ const InspectApi sip_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER | (uint16_t)PktType::UDP, + (uint16_t)PktType::PDU | (uint16_t)PktType::UDP, nullptr, // buffers "sip", sip_init, diff --git a/src/service_inspectors/smtp/smtp.cc b/src/service_inspectors/smtp/smtp.cc index 19886330a..822607be7 100644 --- a/src/service_inspectors/smtp/smtp.cc +++ b/src/service_inspectors/smtp/smtp.cc @@ -1753,7 +1753,7 @@ const InspectApi smtp_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "smtp", smtp_init, diff --git a/src/service_inspectors/ssh/ssh.cc b/src/service_inspectors/ssh/ssh.cc index aaeb62f7d..f83b11525 100644 --- a/src/service_inspectors/ssh/ssh.cc +++ b/src/service_inspectors/ssh/ssh.cc @@ -863,7 +863,7 @@ const InspectApi ssh_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "ssh", ssh_init, diff --git a/src/service_inspectors/ssl/ssl_inspector.cc b/src/service_inspectors/ssl/ssl_inspector.cc index 735895ffb..38c4b02fe 100644 --- a/src/service_inspectors/ssl/ssl_inspector.cc +++ b/src/service_inspectors/ssl/ssl_inspector.cc @@ -492,7 +492,7 @@ const InspectApi ssl_api = mod_dtor }, IT_SERVICE, - (uint16_t)PktType::USER, + (uint16_t)PktType::PDU, nullptr, // buffers "ssl", ssl_init, diff --git a/src/service_inspectors/wizard/wizard.cc b/src/service_inspectors/wizard/wizard.cc index bb74ed6e2..afcc614b4 100644 --- a/src/service_inspectors/wizard/wizard.cc +++ b/src/service_inspectors/wizard/wizard.cc @@ -256,7 +256,7 @@ static const InspectApi wiz_api = mod_dtor }, IT_WIZARD, - (uint16_t)PktType::TCP | (uint16_t)PktType::UDP | (uint16_t)PktType::USER, + (uint16_t)PktType::TCP | (uint16_t)PktType::UDP | (uint16_t)PktType::PDU, nullptr, // buffers nullptr, // service nullptr, // init diff --git a/src/stream/base/stream_base.cc b/src/stream/base/stream_base.cc index 767ebecde..62451db61 100644 --- a/src/stream/base/stream_base.cc +++ b/src/stream/base/stream_base.cc @@ -97,8 +97,8 @@ void base_sum() t_stats.udp_flows = flow_con->get_flows(PktType::UDP); t_stats.udp_prunes = flow_con->get_prunes(PktType::UDP); - t_stats.user_flows = flow_con->get_flows(PktType::USER); - t_stats.user_prunes = flow_con->get_prunes(PktType::USER); + t_stats.user_flows = flow_con->get_flows(PktType::PDU); + t_stats.user_prunes = flow_con->get_prunes(PktType::PDU); t_stats.file_flows = flow_con->get_flows(PktType::FILE); t_stats.file_prunes = flow_con->get_prunes(PktType::FILE); @@ -206,11 +206,11 @@ void StreamBase::tinit() } if ( config->user_cfg.max_sessions ) { - if ( (f = InspectorManager::get_session((uint16_t)PktType::USER)) ) + if ( (f = InspectorManager::get_session((uint16_t)PktType::PDU)) ) { flow_con->init_user(config->user_cfg, f); // FIXIT-L update stream_ip to use standard memcap - //UserSession::set_memcap(flow_con->get_memcap(PktType::USER)); + //UserSession::set_memcap(flow_con->get_memcap(PktType::PDU)); } } if ( config->file_cfg.max_sessions ) @@ -231,7 +231,7 @@ void StreamBase::tterm() flow_con->purge_flows(PktType::ICMP); flow_con->purge_flows(PktType::TCP); flow_con->purge_flows(PktType::UDP); - flow_con->purge_flows(PktType::USER); + flow_con->purge_flows(PktType::PDU); flow_con->purge_flows(PktType::FILE); } @@ -275,7 +275,7 @@ void StreamBase::eval(Packet* p) flow_con->process_udp(p); break; - case PktType::USER: + case PktType::PDU: flow_con->process_user(p); break; diff --git a/src/stream/tcp/tcp_session.cc b/src/stream/tcp/tcp_session.cc index b9ac60d28..e58689567 100644 --- a/src/stream/tcp/tcp_session.cc +++ b/src/stream/tcp/tcp_session.cc @@ -2010,7 +2010,7 @@ static int FlushStream( // FIXIT-L consolidate encode format, update, and this into new function? static void prep_s5_pkt(Flow* flow, Packet* p, uint32_t pkt_flags) { - s5_pkt->ptrs.set_pkt_type(PktType::USER); + s5_pkt->ptrs.set_pkt_type(PktType::PDU); s5_pkt->proto_bits |= PROTO_BIT__TCP; s5_pkt->packet_flags |= (pkt_flags & PKT_PDU_FULL); s5_pkt->flow = flow; diff --git a/src/stream/user/stream_user.cc b/src/stream/user/stream_user.cc index 5d63ae58c..ed3063393 100644 --- a/src/stream/user/stream_user.cc +++ b/src/stream/user/stream_user.cc @@ -131,7 +131,7 @@ static const InspectApi user_api = mod_dtor }, IT_STREAM, - (unsigned)PktType::USER, + (unsigned)PktType::PDU, nullptr, // buffers nullptr, // service nullptr, // pinit