From 02d63397ed6ebf8d8a200a10d292c163335f6c66 Mon Sep 17 00:00:00 2001 From: "Michael Altizer (mialtize)" Date: Thu, 5 Jan 2017 16:24:54 -0500 Subject: [PATCH] Merge pull request #764 in SNORT/snort3 from header_cleanup to master Squashed commit of the following: commit d2b780ecee5d8c14a52df5f443594ef88c2d0d2b Author: Michael Altizer Date: Thu Jan 5 12:57:47 2017 -0500 doc: Update style guide with header inclusion instructions commit 3c1979ca35f3cd3ddae7de83beab8dfb6d0508ac Author: Michael Altizer Date: Thu Dec 22 15:50:14 2016 -0500 install: Prune the set of installed headers commit fc995ce4218462561a9e86ae8288a458e2d95add Author: Michael Altizer Date: Thu Dec 22 15:56:38 2016 -0500 build: The big header cleanup --- daqs/daq_file.c | 4 +- daqs/daq_hext.c | 4 +- doc/style.txt | 42 ++++++--- extra/src/codecs/cd_eapol/cd_eapol.cc | 3 +- extra/src/codecs/cd_linux_sll/cd_linux_sll.cc | 2 - extra/src/codecs/cd_null/cd_null.cc | 3 - extra/src/codecs/cd_pflog/cd_pflog.cc | 3 +- extra/src/codecs/cd_pim/cd_pim.cc | 1 - extra/src/codecs/cd_ppp/cd_ppp.cc | 4 - extra/src/codecs/cd_raw4/cd_raw4.cc | 3 - extra/src/codecs/cd_raw6/cd_raw6.cc | 3 - extra/src/codecs/cd_slip/cd_slip.cc | 5 - .../src/codecs/cd_token_ring/cd_token_ring.cc | 6 +- extra/src/codecs/cd_wlan/cd_wlan.cc | 7 +- extra/src/inspectors/data_log/data_log.cc | 14 +-- extra/src/inspectors/dpx/dpx.cc | 11 +-- extra/src/inspectors/http_server/hi_ad.cc | 11 ++- extra/src/inspectors/http_server/hi_ad.h | 6 +- extra/src/inspectors/http_server/hi_client.cc | 26 ++---- extra/src/inspectors/http_server/hi_client.h | 92 +++++++++---------- .../inspectors/http_server/hi_client_init.cc | 6 +- .../inspectors/http_server/hi_client_norm.cc | 12 +-- .../inspectors/http_server/hi_client_norm.h | 1 - .../inspectors/http_server/hi_cmd_lookup.cc | 9 +- extra/src/inspectors/http_server/hi_events.cc | 5 + extra/src/inspectors/http_server/hi_events.h | 2 - extra/src/inspectors/http_server/hi_include.h | 2 - extra/src/inspectors/http_server/hi_main.cc | 24 +---- extra/src/inspectors/http_server/hi_main.h | 9 +- extra/src/inspectors/http_server/hi_mi.cc | 9 +- extra/src/inspectors/http_server/hi_mi.h | 3 - extra/src/inspectors/http_server/hi_module.cc | 9 +- extra/src/inspectors/http_server/hi_module.h | 5 +- extra/src/inspectors/http_server/hi_norm.cc | 19 ++-- extra/src/inspectors/http_server/hi_norm.h | 4 - .../inspectors/http_server/hi_return_codes.h | 2 - extra/src/inspectors/http_server/hi_server.cc | 28 +++--- extra/src/inspectors/http_server/hi_server.h | 4 +- .../inspectors/http_server/hi_server_norm.cc | 17 ++-- .../inspectors/http_server/hi_server_norm.h | 1 - extra/src/inspectors/http_server/hi_si.cc | 12 +-- extra/src/inspectors/http_server/hi_si.h | 4 - .../http_server/hi_stream_splitter.cc | 14 +-- .../http_server/hi_stream_splitter.h | 1 - .../inspectors/http_server/hi_ui_config.cc | 13 +-- .../src/inspectors/http_server/hi_ui_config.h | 8 +- .../http_server/hi_ui_iis_unicode_map.cc | 12 +-- .../http_server/hi_ui_iis_unicode_map.h | 3 +- extra/src/inspectors/http_server/hi_util.h | 3 - .../inspectors/http_server/http_inspect.cc | 23 ++--- extra/src/inspectors/http_server/ips_http.cc | 10 +- .../inspectors/http_server/ips_http_header.cc | 4 +- .../ips_options/ips_pkt_num/ips_pkt_num.cc | 12 +-- extra/src/ips_options/ips_urg/ips_urg.cc | 10 +- extra/src/loggers/alert_ex/alert_ex.cc | 9 +- .../loggers/alert_unixsock/alert_unixsock.cc | 14 +-- extra/src/loggers/log_null/log_null.cc | 2 - extra/src/search_engines/lowmem/lowmem.cc | 6 +- extra/src/search_engines/lowmem/sfksearch.cc | 15 +-- extra/src/search_engines/lowmem/trie_api.cc | 7 +- extra/src/so_rules/sid_18758/sid_18758.cc | 7 +- extra/src/so_rules/sid_18758/sid_18758.h | 7 ++ src/actions/act_react.cc | 17 +--- src/actions/act_reject.cc | 9 +- src/actions/act_replace.cc | 8 +- src/actions/actions.cc | 4 +- src/actions/actions.h | 2 +- src/actions/ips_actions.cc | 7 +- src/catch/unit_test.cc | 10 +- src/catch/unit_test_main.h | 2 + src/codecs/codec_api.cc | 4 +- src/codecs/codec_module.cc | 4 + src/codecs/ip/cd_auth.cc | 5 +- src/codecs/ip/cd_dst_opts.cc | 5 +- src/codecs/ip/cd_esp.cc | 3 +- src/codecs/ip/cd_frag.cc | 4 - src/codecs/ip/cd_gre.cc | 5 +- src/codecs/ip/cd_hop_opts.cc | 2 - src/codecs/ip/cd_icmp4.cc | 3 +- src/codecs/ip/cd_icmp6.cc | 12 +-- src/codecs/ip/cd_igmp.cc | 2 - src/codecs/ip/cd_ipv4.cc | 26 ++---- src/codecs/ip/cd_ipv6.cc | 9 +- src/codecs/ip/cd_mobility.cc | 2 +- src/codecs/ip/cd_no_next.cc | 3 +- src/codecs/ip/cd_pgm.cc | 6 +- src/codecs/ip/cd_routing.cc | 4 +- src/codecs/ip/cd_sun_nd.cc | 2 +- src/codecs/ip/cd_swipe.cc | 2 +- src/codecs/ip/cd_tcp.cc | 18 ++-- src/codecs/ip/cd_udp.cc | 18 +--- src/codecs/ip/checksum.h | 2 - src/codecs/link/cd_arp.cc | 9 +- src/codecs/link/cd_ciscometadata.cc | 8 +- src/codecs/link/cd_erspan2.cc | 8 +- src/codecs/link/cd_erspan3.cc | 9 +- src/codecs/link/cd_fabricpath.cc | 8 +- src/codecs/link/cd_mpls.cc | 12 +-- src/codecs/link/cd_ppp_encap.cc | 2 - src/codecs/link/cd_pppoe.cc | 9 +- src/codecs/link/cd_trans_bridge.cc | 5 +- src/codecs/link/cd_vlan.cc | 8 +- src/codecs/misc/cd_default.cc | 5 +- src/codecs/misc/cd_gtp.cc | 6 +- src/codecs/misc/cd_icmp4_ip.cc | 9 +- src/codecs/misc/cd_icmp6_ip.cc | 5 +- src/codecs/misc/cd_llc.cc | 6 +- src/codecs/misc/cd_teredo.cc | 4 +- src/codecs/misc/cd_user.cc | 6 +- src/codecs/root/cd_eth.cc | 5 +- src/connectors/connectors.cc | 4 + .../file_connector/file_connector.cc | 22 ++--- .../file_connector/file_connector.h | 5 +- .../file_connector/file_connector_module.cc | 4 + .../file_connector/file_connector_module.h | 4 +- .../test/file_connector_module_test.cc | 4 + .../test/file_connector_test.cc | 4 + src/connectors/tcp_connector/tcp_connector.cc | 26 ++---- src/connectors/tcp_connector/tcp_connector.h | 6 +- .../tcp_connector/tcp_connector_module.cc | 4 + .../tcp_connector/tcp_connector_module.h | 4 +- .../test/tcp_connector_module_test.cc | 4 + .../tcp_connector/test/tcp_connector_test.cc | 9 +- src/control/idle_processing.cc | 4 +- src/decompress/file_decomp.cc | 11 +-- src/decompress/file_decomp.h | 3 +- src/decompress/file_decomp_pdf.cc | 7 +- src/decompress/file_decomp_pdf.h | 1 - src/decompress/file_decomp_swf.cc | 9 +- src/decompress/file_decomp_swf.h | 8 +- src/detection/CMakeLists.txt | 2 +- src/detection/Makefile.am | 4 +- src/detection/detect.cc | 19 ++-- src/detection/detect.h | 15 +-- src/detection/detection_options.cc | 30 +++--- src/detection/detection_options.h | 8 +- src/detection/detection_util.cc | 13 ++- src/detection/detection_util.h | 6 -- src/detection/fp_config.cc | 13 +-- src/detection/fp_create.cc | 37 +++----- src/detection/fp_create.h | 2 - src/detection/fp_detect.cc | 50 ++++------ src/detection/fp_detect.h | 11 +-- src/detection/fp_utils.cc | 15 +-- src/detection/pattern_match_data.h | 6 -- src/detection/pcrm.cc | 13 ++- src/detection/pcrm.h | 2 +- src/detection/rules.h | 1 - src/detection/service_map.cc | 9 +- src/detection/service_map.h | 2 +- src/detection/sfrim.cc | 7 +- src/detection/signature.cc | 16 ++-- src/detection/signature.h | 6 +- src/detection/tag.cc | 26 +++--- src/detection/treenodes.cc | 8 +- src/detection/treenodes.h | 8 +- src/events/event.cc | 8 +- src/events/event.h | 3 - src/events/event_queue.cc | 13 ++- src/events/event_queue.h | 2 +- src/events/event_wrapper.cc | 12 +-- src/events/event_wrapper.h | 3 +- src/events/sfeventq.cc | 5 +- src/file_api/circular_buffer.cc | 4 + src/file_api/file_cache.cc | 5 + src/file_api/file_cache.h | 3 +- src/file_api/file_capture.cc | 16 +--- src/file_api/file_capture.h | 2 +- src/file_api/file_config.cc | 4 +- src/file_api/file_enforcer.cc | 4 + src/file_api/file_flows.cc | 4 +- src/file_api/file_identifier.cc | 5 +- src/file_api/file_lib.cc | 6 +- src/file_api/file_mempool.cc | 4 + src/file_api/file_module.cc | 4 + src/file_api/file_policy.cc | 4 + src/file_api/file_segment.cc | 4 + src/file_api/file_service.cc | 4 +- src/file_api/file_stats.cc | 4 +- src/filters/CMakeLists.txt | 10 +- src/filters/Makefile.am | 6 +- src/filters/detection_filter.cc | 4 + src/filters/rate_filter.cc | 5 +- src/filters/sfrf.cc | 4 +- src/filters/sfthd.cc | 6 +- src/filters/sfthd.h | 4 - src/filters/sfthd_test.cc | 4 + src/filters/sfthreshold.cc | 5 + src/flow/CMakeLists.txt | 2 +- src/flow/Makefile.am | 6 +- src/flow/expect_cache.cc | 6 +- src/flow/expect_cache.h | 4 +- src/flow/flow.cc | 4 +- src/flow/flow.h | 7 +- src/flow/flow_cache.cc | 6 +- src/flow/flow_control.cc | 9 +- src/flow/flow_key.cc | 4 +- src/flow/flow_key.h | 2 +- src/flow/ha.cc | 17 ++-- src/flow/ha.h | 6 +- src/flow/ha_module.cc | 9 +- src/flow/ha_module.h | 4 +- src/flow/test/ha_module_test.cc | 4 + src/flow/test/ha_test.cc | 5 + src/framework/base_api.h | 6 +- src/framework/codec.cc | 10 +- src/framework/codec.h | 10 +- src/framework/connector.h | 4 +- src/framework/cursor.cc | 7 +- src/framework/cursor.h | 5 +- src/framework/data_bus.cc | 7 +- src/framework/data_bus.h | 4 +- src/framework/decode_data.h | 5 +- src/framework/inspector.cc | 7 +- src/framework/inspector.h | 3 +- src/framework/ips_action.h | 4 +- src/framework/ips_option.cc | 13 +-- src/framework/ips_option.h | 4 +- src/framework/logger.h | 4 +- src/framework/lua_api.h | 2 +- src/framework/module.cc | 7 +- src/framework/module.h | 7 +- src/framework/mpse.cc | 8 +- src/framework/mpse.h | 6 +- src/framework/parameter.cc | 12 ++- src/framework/range.cc | 9 +- src/framework/so_rule.h | 3 +- src/framework/value.cc | 11 ++- src/framework/value.h | 8 +- src/hash/CMakeLists.txt | 1 - src/hash/Makefile.am | 2 +- src/hash/hashes.cc | 7 ++ src/hash/hashes.h | 8 -- src/hash/lru_cache_shared.cc | 4 + src/hash/sfghash.cc | 10 +- src/hash/sfghash.h | 4 - src/hash/sfhashfcn.cc | 5 +- src/hash/sfhashfcn.h | 5 - src/hash/sfprimetable.cc | 5 + src/hash/sfxhash.cc | 8 +- src/hash/sfxhash.h | 4 - src/hash/test/lru_cache_shared_test.cc | 4 + src/hash/zhash.cc | 8 +- src/helpers/chunk.cc | 10 +- src/helpers/directory.cc | 13 ++- src/helpers/markup.cc | 7 +- src/helpers/process.cc | 23 ++--- src/helpers/process.h | 3 - src/host_tracker/host_cache.cc | 8 +- src/host_tracker/host_cache.h | 7 +- src/host_tracker/host_cache_module.cc | 4 + src/host_tracker/host_cache_module.h | 1 - src/host_tracker/host_tracker.cc | 6 +- src/host_tracker/host_tracker.h | 7 +- src/host_tracker/host_tracker_module.cc | 5 + src/host_tracker/host_tracker_module.h | 3 +- .../test/host_cache_module_test.cc | 4 + src/host_tracker/test/host_cache_test.cc | 4 + .../test/host_tracker_module_test.cc | 4 + src/host_tracker/test/host_tracker_test.cc | 4 + src/ips_options/asn1_detect.cc | 10 +- src/ips_options/asn1_detect.h | 2 +- src/ips_options/asn1_util.cc | 10 +- src/ips_options/extract.cc | 9 +- src/ips_options/ips_ack.cc | 16 +--- src/ips_options/ips_asn1.cc | 24 ++--- src/ips_options/ips_base64.cc | 22 ++--- src/ips_options/ips_bufferlen.cc | 14 +-- src/ips_options/ips_byte_extract.cc | 22 ++--- src/ips_options/ips_byte_extract.h | 2 - src/ips_options/ips_byte_jump.cc | 28 ++---- src/ips_options/ips_byte_test.cc | 28 ++---- src/ips_options/ips_classtype.cc | 11 +-- src/ips_options/ips_content.cc | 26 ++---- src/ips_options/ips_cvs.cc | 18 +--- src/ips_options/ips_dsize.cc | 16 +--- src/ips_options/ips_file_data.cc | 9 +- src/ips_options/ips_file_type.cc | 6 +- src/ips_options/ips_flags.cc | 21 +---- src/ips_options/ips_flow.cc | 24 ++--- src/ips_options/ips_flowbits.cc | 32 ++----- src/ips_options/ips_fragbits.cc | 20 +--- src/ips_options/ips_fragoffset.cc | 14 +-- src/ips_options/ips_gid.cc | 9 +- src/ips_options/ips_hash.cc | 22 ++--- src/ips_options/ips_icmp_id.cc | 11 +-- src/ips_options/ips_icmp_seq.cc | 11 +-- src/ips_options/ips_icode.cc | 13 +-- src/ips_options/ips_id.cc | 11 +-- src/ips_options/ips_ip_proto.cc | 18 +--- src/ips_options/ips_ipopts.cc | 20 +--- src/ips_options/ips_isdataat.cc | 28 ++---- src/ips_options/ips_itype.cc | 9 +- src/ips_options/ips_luajit.cc | 23 ++--- src/ips_options/ips_msg.cc | 11 +-- src/ips_options/ips_options.cc | 5 +- src/ips_options/ips_pcre.cc | 24 ++--- src/ips_options/ips_pkt_data.cc | 8 +- src/ips_options/ips_priority.cc | 9 +- src/ips_options/ips_raw_data.cc | 7 +- src/ips_options/ips_regex.cc | 16 ++-- src/ips_options/ips_rem.cc | 7 +- src/ips_options/ips_replace.cc | 24 ++--- src/ips_options/ips_rev.cc | 7 +- src/ips_options/ips_rpc.cc | 15 +-- src/ips_options/ips_sd_pattern.cc | 14 ++- src/ips_options/ips_seq.cc | 7 +- src/ips_options/ips_session.cc | 21 +---- src/ips_options/ips_sid.cc | 7 +- src/ips_options/ips_so.cc | 12 +-- src/ips_options/ips_soid.cc | 11 +-- src/ips_options/ips_tag.cc | 9 +- src/ips_options/ips_tos.cc | 8 +- src/ips_options/ips_ttl.cc | 9 +- src/ips_options/ips_window.cc | 9 +- src/ips_options/sd_credit_card.cc | 11 ++- src/ips_options/sd_credit_card.h | 2 +- src/ips_options/test/ips_regex_test.cc | 4 + src/latency/CMakeLists.txt | 19 ++-- src/latency/Makefile.am | 7 +- src/latency/latency_module.cc | 7 +- src/latency/packet_latency.cc | 19 ++-- src/latency/packet_latency.h | 2 - src/latency/rule_latency.cc | 11 +-- src/latency/rule_latency_config.h | 1 - src/log/CMakeLists.txt | 4 +- src/log/Makefile.am | 4 +- src/log/log.cc | 11 +-- src/log/log.h | 4 +- src/log/log_text.cc | 11 +-- src/log/messages.cc | 26 +----- src/log/messages.h | 7 +- src/log/obfuscator.cc | 4 + src/log/obfuscator.h | 4 +- src/log/test/obfuscator_test.cc | 4 + src/log/text_log.cc | 14 +-- src/log/text_log.h | 4 +- src/log/unified2.h | 8 -- src/loggers/alert_csv.cc | 27 ++---- src/loggers/alert_fast.cc | 20 +--- src/loggers/alert_full.cc | 20 ++-- src/loggers/alert_luajit.cc | 22 ++--- src/loggers/alert_sf_socket.cc | 17 +--- src/loggers/alert_syslog.cc | 20 ++-- src/loggers/log_codecs.cc | 18 +--- src/loggers/log_hext.cc | 11 +-- src/loggers/log_pcap.cc | 21 +---- src/loggers/loggers.cc | 5 +- src/loggers/unified2.cc | 30 ++---- src/lua/lua.cc | 12 +-- src/lua/lua.h | 1 - src/lua/lua_arg.h | 2 - src/lua/lua_iface.h | 1 - src/lua/lua_ref.cc | 6 +- src/lua/lua_stack.h | 4 +- src/lua/lua_stack_test.cc | 9 +- src/lua/lua_table.h | 1 - src/lua/lua_test_common.h | 3 +- src/lua/lua_util.cc | 6 +- src/lua/lua_util.h | 1 - src/main.cc | 37 ++------ src/main.h | 4 - src/main/analyzer.cc | 13 ++- src/main/analyzer.h | 1 - src/main/help.cc | 22 ++--- src/main/modules.cc | 16 ++-- src/main/policy.cc | 17 ++-- src/main/policy.h | 4 - src/main/shell.cc | 14 +-- src/main/shell.h | 1 + src/main/snort.cc | 23 ++--- src/main/snort.h | 9 +- src/main/snort_config.cc | 9 +- src/main/snort_config.h | 4 - src/main/snort_debug.cc | 12 ++- src/main/snort_debug.h | 7 -- src/main/snort_module.cc | 25 ++--- src/main/snort_types.h | 60 +----------- src/main/thread.cc | 4 + src/main/thread.h | 1 + src/main/thread_config.cc | 4 + src/managers/CMakeLists.txt | 2 +- src/managers/Makefile.am | 1 + src/managers/action_manager.cc | 15 +-- src/managers/action_manager.h | 9 +- src/managers/codec_manager.cc | 12 +-- src/managers/codec_manager.h | 7 -- src/managers/connector_manager.cc | 12 +-- src/managers/connector_manager.h | 2 +- src/managers/event_manager.cc | 26 ++---- src/managers/event_manager.h | 8 +- src/managers/inspector_manager.cc | 22 +++-- src/managers/inspector_manager.h | 7 -- src/managers/ips_manager.cc | 32 ++----- src/managers/ips_manager.h | 13 --- src/managers/module_manager.cc | 25 ++--- src/managers/module_manager.h | 1 - src/managers/mpse_manager.cc | 13 ++- src/managers/mpse_manager.h | 8 +- src/managers/plugin_manager.cc | 31 +++---- src/managers/plugin_manager.h | 2 - src/managers/script_manager.cc | 17 ++-- src/managers/script_manager.h | 1 - src/managers/so_manager.cc | 24 ++--- src/managers/so_manager.h | 2 - src/memory/memory_allocator.cc | 4 + src/memory/memory_cap.cc | 6 +- src/memory/memory_manager.cc | 3 +- src/memory/memory_module.cc | 5 + src/memory/prune_handler.cc | 5 + src/mime/CMakeLists.txt | 9 +- src/mime/Makefile.am | 8 +- src/mime/decode_b64.cc | 6 +- src/mime/decode_b64.h | 2 - src/mime/decode_base.cc | 5 +- src/mime/decode_base.h | 3 +- src/mime/decode_bit.cc | 5 +- src/mime/decode_bit.h | 1 - src/mime/decode_buffer.cc | 5 + src/mime/decode_buffer.h | 1 - src/mime/decode_qp.cc | 8 +- src/mime/decode_qp.h | 1 - src/mime/decode_uu.cc | 5 +- src/mime/file_mime_config.cc | 7 +- src/mime/file_mime_decode.cc | 5 +- src/mime/file_mime_decode.h | 3 - src/mime/file_mime_log.cc | 7 +- src/mime/file_mime_log.h | 3 +- src/mime/file_mime_paf.cc | 10 +- src/mime/file_mime_paf.h | 4 +- src/mime/file_mime_process.cc | 12 +-- src/mime/file_mime_process.h | 5 +- src/network_inspectors/appid/app_forecast.cc | 10 +- src/network_inspectors/appid/app_forecast.h | 9 +- .../appid/app_info_table.cc | 10 +- src/network_inspectors/appid/app_info_table.h | 9 +- src/network_inspectors/appid/appid_api.cc | 7 +- src/network_inspectors/appid/appid_api.h | 2 - src/network_inspectors/appid/appid_config.cc | 20 ++-- .../appid/appid_http_event_handler.cc | 9 +- .../appid/appid_http_event_handler.h | 2 - .../appid/appid_inspector.cc | 25 +++-- .../appid/appid_inspector.h | 6 +- src/network_inspectors/appid/appid_module.cc | 8 +- src/network_inspectors/appid/appid_module.h | 1 - src/network_inspectors/appid/appid_session.cc | 21 +++-- src/network_inspectors/appid/appid_session.h | 6 +- src/network_inspectors/appid/appid_stats.cc | 15 +-- .../appid/appid_stats_counter.cc | 5 +- .../appid/appid_utils/appid_utils.cc | 8 +- .../appid/appid_utils/fw_avltree.cc | 6 +- .../appid/appid_utils/fw_avltree.h | 4 +- .../appid/appid_utils/ip_funcs.cc | 9 +- .../appid/appid_utils/ip_funcs.h | 6 +- .../appid/appid_utils/network_set.cc | 6 ++ .../appid/appid_utils/network_set.h | 9 +- .../appid/appid_utils/sf_mlmp.cc | 6 +- .../appid/appid_utils/sf_mlmp.h | 4 +- .../appid/appid_utils/sf_multi_mpse.cc | 8 +- .../appid/appid_utils/sf_multi_mpse.h | 4 +- .../appid/client_plugins/client_app_aim.cc | 6 +- .../appid/client_plugins/client_app_api.h | 1 - .../appid/client_plugins/client_app_base.cc | 32 ++----- .../appid/client_plugins/client_app_bit.cc | 11 ++- .../client_plugins/client_app_bit_tracker.cc | 12 +-- .../appid/client_plugins/client_app_config.h | 2 +- .../appid/client_plugins/client_app_msn.cc | 9 +- .../appid/client_plugins/client_app_rtp.cc | 11 ++- .../appid/client_plugins/client_app_ssh.cc | 11 ++- .../client_plugins/client_app_timbuktu.cc | 9 +- .../appid/client_plugins/client_app_tns.cc | 11 ++- .../appid/client_plugins/client_app_vnc.cc | 16 +++- .../appid/client_plugins/client_app_ym.cc | 8 +- .../appid/detector_plugins/detector_base.cc | 11 ++- .../appid/detector_plugins/detector_dns.cc | 10 +- .../appid/detector_plugins/detector_http.cc | 18 ++-- .../appid/detector_plugins/detector_imap.cc | 20 ++-- .../detector_plugins/detector_kerberos.cc | 13 ++- .../detector_plugins/detector_pattern.cc | 14 ++- .../appid/detector_plugins/detector_pop3.cc | 17 ++-- .../appid/detector_plugins/detector_sip.cc | 19 ++-- .../appid/detector_plugins/detector_smtp.cc | 14 ++- .../detector_plugins/http_url_patterns.cc | 12 +-- .../test/detector_smtp_test.cc | 4 + src/network_inspectors/appid/errors.sh | 29 ------ .../appid/host_port_app_cache.cc | 7 +- .../appid/host_port_app_cache.h | 1 - src/network_inspectors/appid/http_common.h | 7 +- .../appid/ips_appid_option.cc | 16 +--- .../appid/length_app_cache.cc | 5 +- .../appid/length_app_cache.h | 2 +- .../appid/lua_detector_api.cc | 24 +++-- .../appid/lua_detector_api.h | 3 - .../appid/lua_detector_flow_api.cc | 11 +-- .../appid/lua_detector_module.cc | 19 ++-- .../appid/lua_detector_module.h | 4 +- .../appid/lua_detector_util.h | 4 +- .../appid/service_plugins/dcerpc.cc | 6 +- .../appid/service_plugins/dcerpc.h | 2 +- .../appid/service_plugins/service_base.cc | 32 +++---- .../appid/service_plugins/service_base.h | 3 - .../service_plugins/service_battle_field.cc | 11 ++- .../appid/service_plugins/service_bgp.cc | 9 +- .../appid/service_plugins/service_bit.cc | 10 +- .../appid/service_plugins/service_bootp.cc | 8 +- .../appid/service_plugins/service_config.h | 2 - .../appid/service_plugins/service_dcerpc.cc | 12 ++- .../service_plugins/service_direct_connect.cc | 6 +- .../appid/service_plugins/service_flap.cc | 6 +- .../appid/service_plugins/service_ftp.cc | 13 +-- .../appid/service_plugins/service_irc.cc | 7 +- .../appid/service_plugins/service_lpr.cc | 9 +- .../appid/service_plugins/service_mdns.cc | 23 ++--- .../appid/service_plugins/service_mysql.cc | 8 +- .../appid/service_plugins/service_netbios.cc | 16 ++-- .../appid/service_plugins/service_nntp.cc | 8 +- .../appid/service_plugins/service_ntp.cc | 7 +- .../appid/service_plugins/service_radius.cc | 8 +- .../appid/service_plugins/service_rexec.cc | 19 ++-- .../appid/service_plugins/service_rfb.cc | 10 +- .../appid/service_plugins/service_rlogin.cc | 14 ++- .../appid/service_plugins/service_rpc.cc | 17 ++-- .../appid/service_plugins/service_rshell.cc | 17 ++-- .../appid/service_plugins/service_rsync.cc | 11 ++- .../appid/service_plugins/service_rtmp.cc | 12 ++- .../appid/service_plugins/service_snmp.cc | 12 ++- .../appid/service_plugins/service_ssh.cc | 13 ++- .../appid/service_plugins/service_ssl.cc | 25 +++-- .../appid/service_plugins/service_telnet.cc | 15 +-- .../appid/service_plugins/service_tftp.cc | 19 ++-- .../appid/service_plugins/service_timbuktu.cc | 12 ++- .../appid/service_plugins/service_tns.cc | 12 ++- .../appid/service_plugins/service_util.h | 2 - .../test/service_rsync_test.cc | 4 + src/network_inspectors/appid/service_state.cc | 10 +- .../appid/test/appid_http_event_test.cc | 4 + .../appid/thirdparty_appid_api.h | 5 +- .../appid/thirdparty_appid_types.h | 1 - .../appid/thirdparty_appid_utils.cc | 7 +- .../arp_spoof/arp_module.cc | 4 + src/network_inspectors/arp_spoof/arp_module.h | 3 - src/network_inspectors/arp_spoof/arp_spoof.cc | 21 +---- src/network_inspectors/binder/bind_module.cc | 19 ++-- src/network_inspectors/binder/bind_module.h | 4 - src/network_inspectors/binder/binder.cc | 31 +++---- .../binder/test/binder_test.cc | 4 + src/network_inspectors/network_inspectors.cc | 1 - src/network_inspectors/normalize/norm.cc | 10 +- src/network_inspectors/normalize/norm.h | 2 +- .../normalize/norm_module.cc | 10 +- .../normalize/norm_module.h | 3 - src/network_inspectors/normalize/normalize.cc | 16 ++-- src/network_inspectors/normalize/normalize.h | 4 - .../packet_capture/capture_module.cc | 8 +- .../packet_capture/packet_capture.cc | 6 +- .../packet_capture/packet_capture.h | 2 +- .../perf_monitor/base_tracker.cc | 7 +- .../perf_monitor/cpu_tracker.cc | 12 ++- .../perf_monitor/cpu_tracker.h | 3 - .../perf_monitor/csv_formatter.cc | 4 + .../perf_monitor/flow_ip_tracker.cc | 10 +- .../perf_monitor/flow_tracker.cc | 7 +- .../perf_monitor/perf_formatter.cc | 4 + .../perf_monitor/perf_formatter.h | 4 +- .../perf_monitor/perf_module.cc | 6 +- .../perf_monitor/perf_monitor.cc | 19 +--- .../perf_monitor/perf_monitor.h | 7 +- .../perf_monitor/perf_tracker.cc | 14 +-- .../perf_monitor/text_formatter.cc | 4 + src/network_inspectors/port_scan/ipobj.cc | 9 +- src/network_inspectors/port_scan/ipobj.h | 6 +- src/network_inspectors/port_scan/port_scan.cc | 30 ++---- src/network_inspectors/port_scan/ps_detect.cc | 22 ++--- src/network_inspectors/port_scan/ps_detect.h | 4 +- src/network_inspectors/port_scan/ps_inspect.h | 3 - src/network_inspectors/port_scan/ps_module.cc | 6 ++ src/network_inspectors/port_scan/ps_module.h | 1 - .../reputation/reputation_config.h | 6 +- .../reputation/reputation_inspect.cc | 25 +---- .../reputation/reputation_inspect.h | 2 +- .../reputation/reputation_module.cc | 7 +- .../reputation/reputation_module.h | 2 - .../reputation/reputation_parse.cc | 9 +- src/packet_io/active.cc | 4 +- src/packet_io/active.h | 2 +- src/packet_io/intf.cc | 8 +- src/packet_io/sfdaq.cc | 11 +-- src/packet_io/sfdaq.h | 2 - src/packet_io/sfdaq_config.cc | 4 + src/packet_io/sfdaq_module.cc | 2 +- src/packet_io/test/sfdaq_module_test.cc | 4 + src/packet_io/trough.cc | 4 + src/parser/arg_list.cc | 6 +- src/parser/cmd_line.cc | 14 +-- src/parser/config_file.cc | 25 +---- src/parser/config_file.h | 3 - src/parser/mstring.cc | 11 +-- src/parser/parse_conf.cc | 49 +++------- src/parser/parse_ip.cc | 14 +-- src/parser/parse_ip.h | 3 - src/parser/parse_ports.cc | 9 +- src/parser/parse_ports.h | 1 - src/parser/parse_rule.cc | 59 +++--------- src/parser/parse_stream.cc | 16 ++-- src/parser/parse_utils.cc | 10 +- src/parser/parser.cc | 67 ++++---------- src/parser/parser.h | 7 -- src/parser/vars.cc | 46 +--------- src/parser/vars.h | 3 +- src/piglet/piglet.cc | 7 +- src/piglet/piglet_api.h | 1 - src/piglet/piglet_manager.cc | 12 ++- src/piglet/piglet_output.cc | 10 +- src/piglet/piglet_runner.cc | 10 +- src/piglet/piglet_utils.cc | 4 + src/piglet_plugins/piglet_plugins.cc | 4 + src/piglet_plugins/pp_buffer_iface.cc | 8 +- src/piglet_plugins/pp_codec.cc | 12 +-- src/piglet_plugins/pp_codec_data_iface.cc | 8 +- src/piglet_plugins/pp_codec_iface.cc | 13 +-- src/piglet_plugins/pp_cursor_iface.cc | 8 +- src/piglet_plugins/pp_daq_pkthdr_iface.cc | 11 +-- src/piglet_plugins/pp_decode_data_iface.cc | 9 +- src/piglet_plugins/pp_enc_state_iface.cc | 7 +- src/piglet_plugins/pp_event_iface.cc | 10 +- src/piglet_plugins/pp_flow_iface.cc | 7 +- src/piglet_plugins/pp_inspector.cc | 12 +-- src/piglet_plugins/pp_inspector_iface.cc | 10 +- src/piglet_plugins/pp_ip_api_iface.cc | 9 +- src/piglet_plugins/pp_ips_action.cc | 6 +- src/piglet_plugins/pp_ips_action_iface.cc | 7 +- src/piglet_plugins/pp_ips_option.cc | 8 +- src/piglet_plugins/pp_ips_option_iface.cc | 7 +- src/piglet_plugins/pp_logger.cc | 6 +- src/piglet_plugins/pp_logger_iface.cc | 8 +- src/piglet_plugins/pp_packet_iface.cc | 11 ++- src/piglet_plugins/pp_raw_buffer_iface.cc | 5 +- src/piglet_plugins/pp_search_engine.cc | 5 - src/piglet_plugins/pp_search_engine_iface.cc | 4 + src/piglet_plugins/pp_so_rule.cc | 5 +- src/piglet_plugins/pp_so_rule_iface.cc | 4 + .../pp_stream_splitter_iface.cc | 9 +- src/piglet_plugins/pp_test.cc | 5 - src/ports/port_group.cc | 5 +- src/ports/port_item.cc | 5 +- src/ports/port_item.h | 3 +- src/ports/port_object.cc | 21 ++--- src/ports/port_object.h | 1 - src/ports/port_object2.cc | 23 ++--- src/ports/port_table.cc | 20 +--- src/ports/port_table.h | 2 +- src/ports/port_utils.cc | 20 +--- src/ports/port_utils.h | 1 - src/ports/port_var_table.cc | 4 + src/ports/port_var_table.h | 1 - src/ports/rule_port_tables.cc | 9 +- src/profiler/Makefile.am | 2 +- src/profiler/memory_context.cc | 6 +- src/profiler/memory_context.h | 2 - src/profiler/memory_defs.h | 3 +- src/profiler/memory_profiler.cc | 6 +- src/profiler/profiler.cc | 9 +- src/profiler/profiler_nodes.cc | 5 +- src/profiler/profiler_printer.h | 2 +- src/profiler/profiler_stats_table.cc | 4 +- src/profiler/rule_profiler.cc | 15 ++- src/profiler/rule_profiler_defs.h | 4 +- src/profiler/time_profiler.cc | 6 +- src/protocols/ip.cc | 11 ++- src/protocols/ip.h | 7 -- src/protocols/ipv4.h | 8 -- src/protocols/ipv4_options.cc | 11 ++- src/protocols/ipv4_options.h | 1 - src/protocols/ipv6.h | 8 -- src/protocols/layer.cc | 13 +-- src/protocols/layer.h | 3 +- src/protocols/packet.cc | 13 +-- src/protocols/packet.h | 18 +--- src/protocols/packet_manager.cc | 35 +++---- src/protocols/packet_manager.h | 9 +- src/protocols/protocol_ids.h | 4 +- src/protocols/ssl.cc | 9 +- src/protocols/ssl.h | 8 -- src/protocols/tcp.h | 3 +- src/protocols/tcp_options.cc | 12 ++- src/protocols/tcp_options.h | 1 - src/protocols/token_ring.h | 2 +- src/protocols/udp.h | 1 - src/pub_sub/http_events.cc | 5 + src/pub_sub/sip_events.cc | 5 +- src/pub_sub/sip_events.h | 3 +- src/search_engines/CMakeLists.txt | 2 +- src/search_engines/Makefile.am | 2 +- src/search_engines/ac_banded.cc | 10 +- src/search_engines/ac_bnfa.cc | 9 +- src/search_engines/ac_full.cc | 10 +- src/search_engines/ac_sparse.cc | 10 +- src/search_engines/ac_sparse_bands.cc | 10 +- src/search_engines/ac_std.cc | 6 -- src/search_engines/acsmx.cc | 8 +- src/search_engines/acsmx.h | 9 +- src/search_engines/acsmx2.cc | 15 +-- src/search_engines/acsmx2.h | 5 +- src/search_engines/acsmx2_api.cc | 3 +- src/search_engines/bnfa_search.cc | 10 +- src/search_engines/bnfa_search.h | 5 +- src/search_engines/hyperscan.cc | 14 +-- src/search_engines/intel_cpm.cc | 7 +- src/search_engines/intel_soft_cpm.cc | 4 + src/search_engines/search_engines.cc | 4 +- src/search_engines/search_tool.cc | 10 +- src/search_engines/test/hyperscan_test.cc | 4 + src/search_engines/test/search_tool_test.cc | 8 +- .../back_orifice/back_orifice.cc | 18 +--- src/service_inspectors/dce_rpc/dce_co.cc | 6 +- src/service_inspectors/dce_rpc/dce_common.cc | 4 + src/service_inspectors/dce_rpc/dce_common.h | 1 + src/service_inspectors/dce_rpc/dce_list.cc | 4 + src/service_inspectors/dce_rpc/dce_smb.cc | 8 +- src/service_inspectors/dce_rpc/dce_smb2.cc | 4 + .../dce_rpc/dce_smb_commands.cc | 4 + .../dce_rpc/dce_smb_module.cc | 4 + src/service_inspectors/dce_rpc/dce_smb_paf.cc | 4 + .../dce_rpc/dce_smb_transaction.cc | 4 + .../dce_rpc/dce_smb_transaction_utils.cc | 4 + .../dce_rpc/dce_smb_utils.cc | 11 ++- src/service_inspectors/dce_rpc/dce_tcp.cc | 4 + .../dce_rpc/dce_tcp_module.cc | 4 + src/service_inspectors/dce_rpc/dce_tcp_paf.cc | 4 + src/service_inspectors/dce_rpc/dce_udp.cc | 4 + .../dce_rpc/dce_udp_module.cc | 4 + .../dce_rpc/dce_udp_processing.cc | 4 + src/service_inspectors/dce_rpc/dce_utils.cc | 6 +- .../dce_rpc/ips_dce_iface.cc | 4 + .../dce_rpc/ips_dce_opnum.cc | 4 + .../dce_rpc/ips_dce_stub_data.cc | 4 + src/service_inspectors/dce_rpc/smb_message.cc | 10 +- src/service_inspectors/dnp3/dnp3.cc | 10 +- src/service_inspectors/dnp3/dnp3.h | 4 +- src/service_inspectors/dnp3/dnp3_map.cc | 9 +- src/service_inspectors/dnp3/dnp3_map.h | 2 +- src/service_inspectors/dnp3/dnp3_module.cc | 9 +- src/service_inspectors/dnp3/dnp3_paf.cc | 5 + src/service_inspectors/dnp3/dnp3_paf.h | 1 - .../dnp3/dnp3_reassembly.cc | 11 ++- src/service_inspectors/dnp3/ips_dnp3_data.cc | 4 + src/service_inspectors/dnp3/ips_dnp3_func.cc | 8 +- src/service_inspectors/dnp3/ips_dnp3_ind.cc | 8 +- src/service_inspectors/dnp3/ips_dnp3_obj.cc | 9 +- src/service_inspectors/dns/dns.cc | 13 +-- src/service_inspectors/dns/dns.h | 2 +- src/service_inspectors/dns/dns_module.cc | 6 +- src/service_inspectors/dns/dns_module.h | 2 +- src/service_inspectors/ftp_telnet/ft_main.cc | 10 +- src/service_inspectors/ftp_telnet/ft_main.h | 7 +- src/service_inspectors/ftp_telnet/ftp.cc | 25 ++--- .../ftp_telnet/ftp_bounce_lookup.cc | 6 +- .../ftp_telnet/ftp_cmd_lookup.cc | 6 +- src/service_inspectors/ftp_telnet/ftp_data.cc | 13 +-- .../ftp_telnet/ftp_module.cc | 6 +- .../ftp_telnet/ftp_module.h | 6 +- .../ftp_telnet/ftp_parse.cc | 13 ++- src/service_inspectors/ftp_telnet/ftp_parse.h | 2 - .../ftp_telnet/ftp_print.cc | 14 +-- .../ftp_telnet/ftp_splitter.cc | 6 +- src/service_inspectors/ftp_telnet/ftpp_si.cc | 13 ++- src/service_inspectors/ftp_telnet/ftpp_si.h | 10 +- .../ftp_telnet/ftpp_ui_config.cc | 9 +- .../ftp_telnet/ftpp_ui_config.h | 2 - src/service_inspectors/ftp_telnet/pp_ftp.cc | 7 +- src/service_inspectors/ftp_telnet/pp_ftp.h | 3 - .../ftp_telnet/pp_telnet.cc | 10 +- src/service_inspectors/ftp_telnet/pp_telnet.h | 7 -- src/service_inspectors/ftp_telnet/telnet.cc | 11 ++- .../ftp_telnet/telnet_module.cc | 6 ++ .../ftp_telnet/telnet_module.h | 3 +- src/service_inspectors/gtp/gtp.cc | 13 --- src/service_inspectors/gtp/gtp.h | 3 +- src/service_inspectors/gtp/gtp_inspect.cc | 6 +- src/service_inspectors/gtp/gtp_inspect.h | 1 + src/service_inspectors/gtp/gtp_module.cc | 7 +- src/service_inspectors/gtp/gtp_module.h | 4 - src/service_inspectors/gtp/gtp_parser.cc | 7 +- src/service_inspectors/gtp/gtp_parser.h | 2 +- src/service_inspectors/gtp/ips_gtp_info.cc | 6 +- src/service_inspectors/gtp/ips_gtp_type.cc | 3 - src/service_inspectors/gtp/ips_gtp_version.cc | 2 - .../http_inspect/http_api.cc | 9 +- .../http_inspect/http_api.h | 5 +- .../http_inspect/http_cutter.cc | 4 + .../http_inspect/http_cutter.h | 2 +- .../http_inspect/http_enum.h | 2 +- .../http_inspect/http_event_gen.h | 4 +- .../http_inspect/http_field.cc | 9 +- .../http_inspect/http_flow_data.cc | 9 +- .../http_inspect/http_head_norm.cc | 10 +- .../http_inspect/http_inspect.cc | 18 ++-- .../http_inspect/http_js_norm.cc | 7 +- .../http_inspect/http_module.cc | 10 +- .../http_inspect/http_msg_body.cc | 15 ++- .../http_inspect/http_msg_body_chunk.cc | 9 +- .../http_inspect/http_msg_body_cl.cc | 13 +-- .../http_inspect/http_msg_body_old.cc | 13 +-- .../http_inspect/http_msg_head_shared.cc | 9 +- .../http_inspect/http_msg_head_shared_util.cc | 5 +- .../http_inspect/http_msg_header.cc | 17 ++-- .../http_inspect/http_msg_request.cc | 11 +-- .../http_inspect/http_msg_section.cc | 17 ++-- .../http_inspect/http_msg_start.cc | 7 +- .../http_inspect/http_msg_status.cc | 11 +-- .../http_inspect/http_msg_trailer.cc | 10 +- .../http_inspect/http_normalizers.cc | 7 +- .../http_inspect/http_str_to_code.cc | 9 +- .../http_inspect/http_str_to_code.h | 2 + .../http_stream_splitter_reassemble.cc | 13 ++- .../http_inspect/http_stream_splitter_scan.cc | 14 ++- .../http_inspect/http_tables.cc | 17 +--- .../http_inspect/http_test_input.cc | 8 +- .../http_inspect/http_test_manager.cc | 7 +- .../http_inspect/http_transaction.cc | 10 +- .../http_inspect/http_uri.cc | 9 +- .../http_inspect/http_uri_norm.cc | 13 ++- .../http_inspect/ips_http.cc | 10 +- .../http_inspect/ips_http.h | 6 -- .../http_inspect/test/http_module_test.cc | 4 + .../test/http_msg_head_shared_util_test.cc | 4 + .../test/http_normalizers_test.cc | 4 + .../test/http_transaction_test.cc | 4 + .../http_inspect/test/http_uri_norm_test.cc | 4 + src/service_inspectors/imap/imap.cc | 21 +---- src/service_inspectors/imap/imap.h | 5 +- src/service_inspectors/imap/imap_module.cc | 8 +- src/service_inspectors/imap/imap_module.h | 2 - src/service_inspectors/imap/imap_paf.cc | 10 +- src/service_inspectors/imap/imap_paf.h | 3 +- .../modbus/ips_modbus_data.cc | 9 +- .../modbus/ips_modbus_func.cc | 6 +- .../modbus/ips_modbus_unit.cc | 6 +- src/service_inspectors/modbus/modbus.cc | 6 +- src/service_inspectors/modbus/modbus.h | 1 - .../modbus/modbus_decode.cc | 9 +- .../modbus/modbus_module.cc | 7 +- src/service_inspectors/modbus/modbus_module.h | 1 - src/service_inspectors/modbus/modbus_paf.cc | 9 +- src/service_inspectors/modbus/modbus_paf.h | 2 - src/service_inspectors/pop/pop.cc | 18 +--- src/service_inspectors/pop/pop.h | 5 +- src/service_inspectors/pop/pop_module.cc | 8 +- src/service_inspectors/pop/pop_module.h | 5 +- src/service_inspectors/pop/pop_paf.cc | 9 +- src/service_inspectors/pop/pop_paf.h | 3 +- .../rpc_decode/rpc_decode.cc | 20 +--- .../rpc_decode/rpc_module.cc | 5 +- .../rpc_decode/rpc_module.h | 2 - src/service_inspectors/service_inspectors.cc | 5 +- src/service_inspectors/sip/ips_sip.cc | 10 +- src/service_inspectors/sip/ips_sip_method.cc | 8 +- .../sip/ips_sip_stat_code.cc | 7 +- src/service_inspectors/sip/sip.cc | 21 +---- src/service_inspectors/sip/sip.h | 3 +- src/service_inspectors/sip/sip_common.h | 2 +- src/service_inspectors/sip/sip_config.cc | 5 +- src/service_inspectors/sip/sip_config.h | 1 - src/service_inspectors/sip/sip_dialog.cc | 13 +-- src/service_inspectors/sip/sip_dialog.h | 3 +- src/service_inspectors/sip/sip_module.cc | 9 +- src/service_inspectors/sip/sip_module.h | 2 - src/service_inspectors/sip/sip_parser.cc | 10 +- src/service_inspectors/sip/sip_utils.cc | 10 +- src/service_inspectors/sip/sip_utils.h | 1 - src/service_inspectors/smtp/smtp.cc | 22 ++--- src/service_inspectors/smtp/smtp.h | 4 +- src/service_inspectors/smtp/smtp_config.h | 1 + src/service_inspectors/smtp/smtp_module.cc | 8 +- src/service_inspectors/smtp/smtp_module.h | 2 - src/service_inspectors/smtp/smtp_normalize.cc | 7 +- src/service_inspectors/smtp/smtp_normalize.h | 4 +- src/service_inspectors/smtp/smtp_paf.cc | 12 ++- src/service_inspectors/smtp/smtp_paf.h | 3 +- src/service_inspectors/smtp/smtp_util.cc | 14 ++- src/service_inspectors/smtp/smtp_util.h | 7 +- .../smtp/smtp_xlink2state.cc | 12 +-- .../smtp/smtp_xlink2state.h | 2 - src/service_inspectors/ssh/ssh.cc | 16 +--- src/service_inspectors/ssh/ssh.h | 4 +- src/service_inspectors/ssh/ssh_module.cc | 8 +- src/service_inspectors/ssh/ssh_module.h | 2 - src/service_inspectors/ssl/ips_ssl_state.cc | 7 +- src/service_inspectors/ssl/ips_ssl_version.cc | 7 +- src/service_inspectors/ssl/ssl_config.h | 4 +- src/service_inspectors/ssl/ssl_inspector.cc | 20 +--- src/service_inspectors/ssl/ssl_inspector.h | 3 +- src/service_inspectors/ssl/ssl_module.cc | 10 +- src/service_inspectors/ssl/ssl_module.h | 2 - src/service_inspectors/wizard/curses.cc | 4 + src/service_inspectors/wizard/curses.h | 3 +- src/service_inspectors/wizard/hexes.cc | 8 +- src/service_inspectors/wizard/magic.cc | 4 + src/service_inspectors/wizard/magic.h | 6 +- src/service_inspectors/wizard/spells.cc | 5 +- src/service_inspectors/wizard/wiz_module.cc | 9 +- src/service_inspectors/wizard/wiz_module.h | 4 - src/service_inspectors/wizard/wizard.cc | 13 ++- src/sfip/CMakeLists.txt | 2 +- src/sfip/Makefile.am | 4 +- src/sfip/sf_cidr.cc | 4 + src/sfip/sf_ip.cc | 7 +- src/sfip/sf_ip.h | 2 - src/sfip/sf_ipvar.cc | 10 +- src/sfip/sf_ipvar.h | 3 +- src/sfip/sf_vartable.cc | 7 +- src/sfrt/CMakeLists.txt | 18 +--- src/sfrt/Makefile.am | 15 +-- src/sfrt/sfrt.cc | 4 +- src/sfrt/sfrt.h | 2 +- src/sfrt/sfrt_dir.cc | 8 +- src/sfrt/sfrt_dir.h | 2 +- src/sfrt/sfrt_flat.cc | 4 +- src/sfrt/sfrt_flat_dir.cc | 6 +- src/sfrt/sfrt_test.cc | 4 + src/side_channel/side_channel.cc | 19 ++-- src/side_channel/side_channel.h | 5 - src/side_channel/side_channel_module.cc | 9 +- src/side_channel/side_channel_module.h | 6 +- .../test/side_channel_module_test.cc | 4 + src/side_channel/test/side_channel_test.cc | 4 + src/stream/base/stream_base.cc | 9 +- src/stream/base/stream_ha.cc | 7 +- src/stream/base/stream_ha.h | 1 - src/stream/base/stream_module.cc | 6 +- src/stream/base/stream_module.h | 3 +- src/stream/file/file_module.cc | 9 +- src/stream/file/file_module.h | 2 - src/stream/file/file_session.cc | 12 +-- src/stream/file/file_session.h | 8 +- src/stream/file/stream_file.cc | 7 +- src/stream/flush_bucket.cc | 9 +- src/stream/flush_bucket.h | 3 +- src/stream/icmp/icmp_ha.cc | 6 +- src/stream/icmp/icmp_ha.h | 1 - src/stream/icmp/icmp_module.cc | 6 +- src/stream/icmp/icmp_module.h | 2 - src/stream/icmp/icmp_session.cc | 27 ++---- src/stream/icmp/stream_icmp.cc | 9 +- src/stream/icmp/stream_icmp.h | 2 +- src/stream/ip/ip_defrag.cc | 30 ++---- src/stream/ip/ip_defrag.h | 8 +- src/stream/ip/ip_ha.cc | 6 +- src/stream/ip/ip_ha.h | 1 - src/stream/ip/ip_module.cc | 8 +- src/stream/ip/ip_module.h | 4 +- src/stream/ip/ip_session.cc | 13 ++- src/stream/ip/ip_session.h | 6 +- src/stream/ip/stream_ip.cc | 10 +- src/stream/ip/stream_ip.h | 2 +- src/stream/libtcp/stream_tcp_unit_test.cc | 9 +- src/stream/libtcp/stream_tcp_unit_test.h | 5 +- src/stream/libtcp/tcp_segment_descriptor.cc | 12 ++- src/stream/libtcp/tcp_segment_descriptor.h | 3 +- src/stream/libtcp/tcp_state_handler.cc | 8 +- src/stream/libtcp/tcp_state_handler.h | 4 +- src/stream/libtcp/tcp_state_machine.cc | 6 +- src/stream/libtcp/tcp_state_machine.h | 8 +- src/stream/libtcp/tcp_stream_session.cc | 9 +- src/stream/libtcp/tcp_stream_session.h | 7 +- src/stream/libtcp/tcp_stream_tracker.cc | 7 +- src/stream/libtcp/tcp_stream_tracker.h | 4 +- src/stream/paf.cc | 10 +- src/stream/paf.h | 3 - src/stream/stream.cc | 34 ++----- src/stream/stream.h | 4 - src/stream/stream_inspectors.cc | 5 +- src/stream/stream_splitter.cc | 7 +- src/stream/stream_splitter.h | 1 - src/stream/tcp/ips_stream_reassemble.cc | 11 +-- src/stream/tcp/ips_stream_size.cc | 10 +- src/stream/tcp/segment_overlap_editor.cc | 10 +- src/stream/tcp/segment_overlap_editor.h | 6 +- src/stream/tcp/stream_tcp.cc | 4 +- src/stream/tcp/stream_tcp.h | 9 +- src/stream/tcp/tcp_debug_trace.h | 3 +- src/stream/tcp/tcp_defs.h | 5 +- src/stream/tcp/tcp_event_logger.cc | 14 +-- src/stream/tcp/tcp_event_logger.h | 2 + src/stream/tcp/tcp_ha.cc | 5 + src/stream/tcp/tcp_ha.h | 1 - src/stream/tcp/tcp_module.cc | 10 +- src/stream/tcp/tcp_module.h | 7 +- src/stream/tcp/tcp_normalizer.cc | 8 +- src/stream/tcp/tcp_normalizer.h | 8 +- src/stream/tcp/tcp_normalizers.cc | 8 +- src/stream/tcp/tcp_normalizers.h | 3 +- src/stream/tcp/tcp_reassembler.cc | 13 +-- src/stream/tcp/tcp_reassembler.h | 9 +- src/stream/tcp/tcp_reassemblers.cc | 7 +- src/stream/tcp/tcp_reassemblers.h | 3 +- src/stream/tcp/tcp_segment_node.cc | 7 +- src/stream/tcp/tcp_segment_node.h | 4 +- src/stream/tcp/tcp_session.cc | 35 +------ src/stream/tcp/tcp_session.h | 11 +-- src/stream/tcp/tcp_state_close_wait.cc | 13 ++- src/stream/tcp/tcp_state_closed.cc | 8 +- src/stream/tcp/tcp_state_closing.cc | 13 ++- src/stream/tcp/tcp_state_established.cc | 11 ++- src/stream/tcp/tcp_state_fin_wait1.cc | 16 ++-- src/stream/tcp/tcp_state_fin_wait2.cc | 13 +-- src/stream/tcp/tcp_state_last_ack.cc | 13 +-- src/stream/tcp/tcp_state_listen.cc | 11 ++- src/stream/tcp/tcp_state_none.cc | 13 +-- src/stream/tcp/tcp_state_syn_recv.cc | 10 +- src/stream/tcp/tcp_state_syn_sent.cc | 12 +-- src/stream/tcp/tcp_state_time_wait.cc | 15 ++- src/stream/tcp/tcp_stream_config.cc | 8 +- src/stream/tcp/tcp_stream_config.h | 3 +- src/stream/tcp/tcp_stream_state_machine.cc | 8 +- src/stream/tcp/tcp_tracker.cc | 10 +- src/stream/tcp/tcp_tracker.h | 1 - src/stream/tcp/test/tcp_normalizer_test.cc | 4 + src/stream/udp/stream_udp.cc | 11 +-- src/stream/udp/stream_udp.h | 4 +- src/stream/udp/udp_ha.cc | 6 +- src/stream/udp/udp_ha.h | 1 - src/stream/udp/udp_module.cc | 6 +- src/stream/udp/udp_module.h | 5 - src/stream/udp/udp_session.cc | 23 ++--- src/stream/udp/udp_session.h | 1 - src/stream/user/stream_user.cc | 8 +- src/stream/user/stream_user.h | 4 +- src/stream/user/user_module.cc | 7 +- src/stream/user/user_module.h | 4 - src/stream/user/user_session.cc | 13 +-- src/stream/user/user_session.h | 1 - src/target_based/sftarget_hostentry.cc | 4 + src/target_based/sftarget_hostentry.h | 1 - src/target_based/sftarget_reader.cc | 21 +---- src/target_based/snort_protocols.cc | 11 +-- src/target_based/snort_protocols.h | 1 - src/time/clock_defs.h | 4 - src/time/packet_time.cc | 7 +- src/time/packet_time.h | 1 - src/time/periodic.cc | 4 + src/time/periodic.h | 2 +- src/time/stopwatch_test.cc | 4 + src/time/tsc_clock.cc | 6 +- src/utils/CMakeLists.txt | 4 +- src/utils/Makefile.am | 3 +- src/utils/bitop_test.cc | 4 + src/utils/boyer_moore.cc | 11 +-- src/utils/dnet_header.h | 4 - src/utils/dyn_array.cc | 12 +-- src/utils/kmap.cc | 12 +-- src/utils/safec.h | 4 - src/utils/segment_mem.cc | 10 +- src/utils/segment_mem.h | 4 +- src/utils/sflsq.cc | 11 +-- src/utils/sfmemcap.cc | 11 +-- src/utils/sfsnprintfappend.cc | 11 ++- src/utils/stats.cc | 22 ++--- src/utils/stats.h | 11 +-- src/utils/util.cc | 6 +- src/utils/util.h | 13 +-- src/utils/util_jsnorm.cc | 9 +- src/utils/util_jsnorm.h | 1 - src/utils/util_net.cc | 8 +- src/utils/util_net.h | 3 +- src/utils/util_unfold.cc | 4 + src/utils/util_utf.cc | 7 +- 1067 files changed, 3919 insertions(+), 5371 deletions(-) delete mode 100755 src/network_inspectors/appid/errors.sh diff --git a/daqs/daq_file.c b/daqs/daq_file.c index 92161638a..8da956f8b 100644 --- a/daqs/daq_file.c +++ b/daqs/daq_file.c @@ -18,12 +18,12 @@ */ /* daq_file.c author Russ Combs */ -#include "daq_user.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "daq_user.h" + #include #include #include diff --git a/daqs/daq_hext.c b/daqs/daq_hext.c index 5e08338f3..d1da390ac 100644 --- a/daqs/daq_hext.c +++ b/daqs/daq_hext.c @@ -18,12 +18,12 @@ */ /* daq_hext.c author Russ Combs */ -#include "daq_user.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "daq_user.h" + #include #include #include diff --git a/doc/style.txt b/doc/style.txt index 96ee6aba8..1b087f590 100644 --- a/doc/style.txt +++ b/doc/style.txt @@ -269,25 +269,39 @@ yet firm so feedback is welcome to get something we can live with. implementation declarations should go in a separate header from the interface. And so on. -* A .cc should include its own .h before any others (including - system headers). This ensures that the header stands on its own and can - be used by clients without include prerequisites and the developer will - be the first to find a dependency problem. - -* Include required headers, all required headers, and nothing but required - headers. Don't just clone a bunch of headers because it is convenient. - -* Try to keep includes in alpha order. This makes it easier to maintain, - avoid duplicates, etc. - -* Any file depending on #ifdefs should include config.h as shown below. A - .h should include it before any other includes, and a .cc should include - it immediately after the include of its own .h. +* All .cc files should include config.h with the standard block shown below + immediately following the initial comment blocks and before anything else. + This presents a consistent view of all included header files as well as + access to any other configure-time definitions. No .h files should include + config.h unless they are guaranteed to be local header files (never + installed). #ifdef HAVE_CONFIG_H #include "config.h" #endif +* A .cc should include its own .h before any others aside from the + aforementioned config.h (including system headers). This ensures that the + header stands on its own and can be used by clients without include + prerequisites and the developer will be the first to find a dependency issue. + +* Split headers included from the local directory into a final block of + headers. For a .cc file, the final order of sets of header includes should + look like this: + + 1. config.h + 2. its own .h file + 3. system headers (.h/.hpp/.hxx) + 4. C++ standard library headers (no file extension) + 5. Snort headers external to the local directory (path-prefixed) + 6. Snort headers in the local directory + +* Include required headers, all required headers, and nothing but required + headers. Don't just clone a bunch of headers because it is convenient. + +* Keep includes in alphabetical order. This makes it easier to maintain, avoid + duplicates, etc. + * Do not put using statements in headers unless they are tightly scoped. === Warnings diff --git a/extra/src/codecs/cd_eapol/cd_eapol.cc b/extra/src/codecs/cd_eapol/cd_eapol.cc index b8c7886bd..e3e65f502 100644 --- a/extra/src/codecs/cd_eapol/cd_eapol.cc +++ b/extra/src/codecs/cd_eapol/cd_eapol.cc @@ -21,9 +21,8 @@ #include "config.h" #endif -#include "framework/codec.h" #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" +#include "framework/codec.h" #include "protocols/eapol.h" #define CD_EAPOL_NAME "eapol" diff --git a/extra/src/codecs/cd_linux_sll/cd_linux_sll.cc b/extra/src/codecs/cd_linux_sll/cd_linux_sll.cc index 5b823885d..3d2400c8d 100644 --- a/extra/src/codecs/cd_linux_sll/cd_linux_sll.cc +++ b/extra/src/codecs/cd_linux_sll/cd_linux_sll.cc @@ -21,9 +21,7 @@ #include "config.h" #endif -extern "C" { #include -} #include "framework/codec.h" #include "protocols/linux_sll.h" diff --git a/extra/src/codecs/cd_null/cd_null.cc b/extra/src/codecs/cd_null/cd_null.cc index 71d65a0f9..e8133015f 100644 --- a/extra/src/codecs/cd_null/cd_null.cc +++ b/extra/src/codecs/cd_null/cd_null.cc @@ -21,12 +21,9 @@ #include "config.h" #endif -extern "C" { #include -} #include "framework/codec.h" -#include "protocols/protocol_ids.h" #define CD_NULL_NAME "null" #define CD_NULL_HELP_STR "support for null encapsulation" diff --git a/extra/src/codecs/cd_pflog/cd_pflog.cc b/extra/src/codecs/cd_pflog/cd_pflog.cc index 9cdbc2291..e86fc1fd6 100644 --- a/extra/src/codecs/cd_pflog/cd_pflog.cc +++ b/extra/src/codecs/cd_pflog/cd_pflog.cc @@ -21,9 +21,8 @@ #include "config.h" #endif -extern "C" { +#include #include -} #include "framework/codec.h" diff --git a/extra/src/codecs/cd_pim/cd_pim.cc b/extra/src/codecs/cd_pim/cd_pim.cc index 8849f1ca2..a9d06b87c 100644 --- a/extra/src/codecs/cd_pim/cd_pim.cc +++ b/extra/src/codecs/cd_pim/cd_pim.cc @@ -25,7 +25,6 @@ #endif #include "framework/codec.h" -#include "framework/decode_data.h" #include "codecs/codec_module.h" namespace diff --git a/extra/src/codecs/cd_ppp/cd_ppp.cc b/extra/src/codecs/cd_ppp/cd_ppp.cc index 2812a0bb2..746ad3edc 100644 --- a/extra/src/codecs/cd_ppp/cd_ppp.cc +++ b/extra/src/codecs/cd_ppp/cd_ppp.cc @@ -21,11 +21,7 @@ #include "config.h" #endif -#include - -extern "C" { #include -} #include "framework/codec.h" diff --git a/extra/src/codecs/cd_raw4/cd_raw4.cc b/extra/src/codecs/cd_raw4/cd_raw4.cc index b906fc551..3ef27e932 100644 --- a/extra/src/codecs/cd_raw4/cd_raw4.cc +++ b/extra/src/codecs/cd_raw4/cd_raw4.cc @@ -21,12 +21,9 @@ #include "config.h" #endif -extern "C" { #include -} #include "framework/codec.h" -#include "protocols/protocol_ids.h" #define CD_RAW4_NAME "raw4" #define CD_RAW4_HELP_STR "support for unencapsulated IPv4" diff --git a/extra/src/codecs/cd_raw6/cd_raw6.cc b/extra/src/codecs/cd_raw6/cd_raw6.cc index 9cbc5fe0e..73aea4490 100644 --- a/extra/src/codecs/cd_raw6/cd_raw6.cc +++ b/extra/src/codecs/cd_raw6/cd_raw6.cc @@ -21,12 +21,9 @@ #include "config.h" #endif -extern "C" { #include -} #include "framework/codec.h" -#include "protocols/protocol_ids.h" #define CD_RAW6_NAME "raw6" #define CD_RAW6_HELP_STR "support for unencapsulated IPv6" diff --git a/extra/src/codecs/cd_slip/cd_slip.cc b/extra/src/codecs/cd_slip/cd_slip.cc index 4701f4ec4..e95e63882 100644 --- a/extra/src/codecs/cd_slip/cd_slip.cc +++ b/extra/src/codecs/cd_slip/cd_slip.cc @@ -17,14 +17,9 @@ //-------------------------------------------------------------------------- // cd_sip.cc author Josh Rosenbaum -#include - -extern "C" { #include -} #include "framework/codec.h" -#include "protocols/protocol_ids.h" #define CD_SLIP_NAME "slip" #define CD_SLIP_HELP_STR "support for slip protocol" diff --git a/extra/src/codecs/cd_token_ring/cd_token_ring.cc b/extra/src/codecs/cd_token_ring/cd_token_ring.cc index 618c8184c..cfac50fc0 100644 --- a/extra/src/codecs/cd_token_ring/cd_token_ring.cc +++ b/extra/src/codecs/cd_token_ring/cd_token_ring.cc @@ -23,13 +23,11 @@ #include "config.h" #endif -extern "C" { #include -} -#include "protocols/token_ring.h" -#include "framework/codec.h" #include "codecs/codec_module.h" +#include "framework/codec.h" +#include "protocols/token_ring.h" namespace { diff --git a/extra/src/codecs/cd_wlan/cd_wlan.cc b/extra/src/codecs/cd_wlan/cd_wlan.cc index 561778bee..adc3d4240 100644 --- a/extra/src/codecs/cd_wlan/cd_wlan.cc +++ b/extra/src/codecs/cd_wlan/cd_wlan.cc @@ -22,15 +22,12 @@ #include "config.h" #endif -extern "C" { #include -} -#include "protocols/wlan.h" -#include "framework/codec.h" #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" +#include "framework/codec.h" #include "log/text_log.h" +#include "protocols/wlan.h" #define CD_WLAN_NAME "wlan" #define CD_WLAN_HELP_STR "support for wireless local area network protocol" diff --git a/extra/src/inspectors/data_log/data_log.cc b/extra/src/inspectors/data_log/data_log.cc index c2c605f5a..837d849c0 100644 --- a/extra/src/inspectors/data_log/data_log.cc +++ b/extra/src/inspectors/data_log/data_log.cc @@ -21,24 +21,12 @@ #include "config.h" #endif -#include -#include - -#include -#include - -#include "main/snort_debug.h" -#include "main/snort_types.h" +#include "flow/flow.h" #include "framework/data_bus.h" #include "framework/inspector.h" #include "framework/module.h" #include "log/messages.h" #include "log/text_log.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "utils/stats.h" -#include "flow/flow.h" -#include "sfip/sf_ip.h" static const char* s_name = "data_log"; static const char* f_name = "data.log"; diff --git a/extra/src/inspectors/dpx/dpx.cc b/extra/src/inspectors/dpx/dpx.cc index ab0f4342e..bfa863dbe 100644 --- a/extra/src/inspectors/dpx/dpx.cc +++ b/extra/src/inspectors/dpx/dpx.cc @@ -21,21 +21,12 @@ #include "config.h" #endif -#include -#include -#include -#include -#include - -#include "main/snort_debug.h" -#include "main/snort_types.h" #include "events/event_queue.h" #include "framework/inspector.h" #include "framework/module.h" #include "log/messages.h" -#include "protocols/packet.h" #include "profiler/profiler.h" -#include "utils/stats.h" +#include "protocols/packet.h" #define DPX_GID 256 #define DPX_SID 1 diff --git a/extra/src/inspectors/http_server/hi_ad.cc b/extra/src/inspectors/http_server/hi_ad.cc index f6686a39c..0ec9c262f 100644 --- a/extra/src/inspectors/http_server/hi_ad.cc +++ b/extra/src/inspectors/http_server/hi_ad.cc @@ -28,12 +28,17 @@ ** NOTES: ** - 3.2.03: Initial development. DJR */ -#include -#include -#include "hi_ui_config.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "hi_ad.h" + +#include "hi_events.h" #include "hi_return_codes.h" #include "hi_si.h" +#include "hi_ui_config.h" /* ** NAME diff --git a/extra/src/inspectors/http_server/hi_ad.h b/extra/src/inspectors/http_server/hi_ad.h index 602ef3540..37d9335e3 100644 --- a/extra/src/inspectors/http_server/hi_ad.h +++ b/extra/src/inspectors/http_server/hi_ad.h @@ -20,11 +20,9 @@ #ifndef HI_AD_H #define HI_AD_H -#include +#include -#include "hi_include.h" - -int hi_server_anomaly_detection(void* S, const u_char* data, int dsize); +int hi_server_anomaly_detection(void* S, const uint8_t* data, int dsize); #endif diff --git a/extra/src/inspectors/http_server/hi_client.cc b/extra/src/inspectors/http_server/hi_client.cc index 184e933ae..2e99c18bb 100644 --- a/extra/src/inspectors/http_server/hi_client.cc +++ b/extra/src/inspectors/http_server/hi_client.cc @@ -41,29 +41,21 @@ ** - 2.4.05: Added tab_uri_delimiter config option. AJM. */ -#include "hi_client.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include - -#include "hi_ui_config.h" -#include "hi_si.h" -#include "hi_mi.h" -#include "hi_util.h" -#include "hi_return_codes.h" -#include "hi_cmd_lookup.h" +#include "hi_client.h" -#include "utils/util.h" -#include "utils/util_unfold.h" -#include "detection/detection_util.h" +#include "protocols/packet.h" #include "utils/safec.h" +#include "utils/util_unfold.h" + +#include "hi_cmd_lookup.h" +#include "hi_events.h" +#include "hi_include.h" +#include "hi_return_codes.h" +#include "hi_si.h" #define HEADER_NAME__COOKIE "Cookie" #define HEADER_LENGTH__COOKIE 6 diff --git a/extra/src/inspectors/http_server/hi_client.h b/extra/src/inspectors/http_server/hi_client.h index 0e685b901..3092ce637 100644 --- a/extra/src/inspectors/http_server/hi_client.h +++ b/extra/src/inspectors/http_server/hi_client.h @@ -20,11 +20,9 @@ #ifndef HI_CLIENT_H #define HI_CLIENT_H -#include +#include "flow/flow.h" #include "hi_main.h" -#include "hi_include.h" -#include "hi_events.h" #define URI_END 99 #define POST_END 100 @@ -46,22 +44,22 @@ typedef struct s_COOKIE_PTR { - const u_char* cookie; - const u_char* cookie_end; + const uint8_t* cookie; + const uint8_t* cookie_end; struct s_COOKIE_PTR* next; } COOKIE_PTR; typedef struct s_CONTLEN_PTR { - const u_char* cont_len_start; - const u_char* cont_len_end; + const uint8_t* cont_len_start; + const uint8_t* cont_len_end; uint32_t len; } CONTLEN_PTR; typedef struct s_CONT_ENCODING_PTR { - const u_char* cont_encoding_start; - const u_char* cont_encoding_end; + const uint8_t* cont_encoding_start; + const uint8_t* cont_encoding_end; uint16_t compress_fmt; } CONT_ENCODING_PTR; @@ -92,18 +90,18 @@ typedef struct s_HEADER_FIELD_PTR typedef struct s_URI_PTR { - const u_char* uri; /* the beginning of the URI */ - const u_char* uri_end; /* the end of the URI */ - const u_char* norm; /* ptr to first normalization occurence */ - const u_char* ident; /* ptr to beginning of the HTTP identifier */ - const u_char* first_sp_start; /* beginning of first space delimiter */ - const u_char* first_sp_end; /* end of first space delimiter */ - const u_char* second_sp_start; /* beginning of second space delimiter */ - const u_char* second_sp_end; /* end of second space delimiter */ - const u_char* param; /* '?' (beginning of parameter field) */ - const u_char* delimiter; /* HTTP URI delimiter (\r\n\) */ - const u_char* last_dir; /* ptr to last dir, so we catch long dirs */ - const u_char* proxy; /* ptr to the absolute URI */ + const uint8_t* uri; /* the beginning of the URI */ + const uint8_t* uri_end; /* the end of the URI */ + const uint8_t* norm; /* ptr to first normalization occurence */ + const uint8_t* ident; /* ptr to beginning of the HTTP identifier */ + const uint8_t* first_sp_start; /* beginning of first space delimiter */ + const uint8_t* first_sp_end; /* end of first space delimiter */ + const uint8_t* second_sp_start; /* beginning of second space delimiter */ + const uint8_t* second_sp_end; /* end of second space delimiter */ + const uint8_t* param; /* '?' (beginning of parameter field) */ + const uint8_t* delimiter; /* HTTP URI delimiter (\r\n\) */ + const uint8_t* last_dir; /* ptr to last dir, so we catch long dirs */ + const uint8_t* proxy; /* ptr to the absolute URI */ } URI_PTR; typedef struct s_HEADER_PTR @@ -117,32 +115,32 @@ typedef struct s_HEADER_PTR typedef struct s_HI_CLIENT_REQ { - const u_char* uri; - const u_char* uri_norm; - const u_char* post_raw; - const u_char* post_norm; - const u_char* header_raw; - const u_char* header_norm; + const uint8_t* uri; + const uint8_t* uri_norm; + const uint8_t* post_raw; + const uint8_t* post_norm; + const uint8_t* header_raw; + const uint8_t* header_norm; COOKIE_PTR cookie; - const u_char* cookie_norm; - const u_char* method_raw; - - u_int uri_size; - u_int uri_norm_size; - u_int post_raw_size; - u_int post_norm_size; - u_int header_raw_size; - u_int header_norm_size; - u_int cookie_norm_size; - u_int method_size; - - const u_char* pipeline_req; - u_char method; + const uint8_t* cookie_norm; + const uint8_t* method_raw; + + unsigned int uri_size; + unsigned int uri_norm_size; + unsigned int post_raw_size; + unsigned int post_norm_size; + unsigned int header_raw_size; + unsigned int header_norm_size; + unsigned int cookie_norm_size; + unsigned int method_size; + + const uint8_t* pipeline_req; + uint8_t method; uint16_t uri_encode_type; uint16_t header_encode_type; uint16_t cookie_encode_type; uint16_t post_encode_type; - const u_char* content_type; + const uint8_t* content_type; } HI_CLIENT_REQ; typedef struct s_HI_CLIENT @@ -168,20 +166,20 @@ int hi_client_init(); char** hi_client_get_field_names(); -extern const u_char* proxy_start; -extern const u_char* proxy_end; +extern const uint8_t* proxy_start; +extern const uint8_t* proxy_end; struct HI_SESSION; -int CheckLongDir(HI_SESSION* session, URI_PTR* uri_ptr, const u_char* ptr); +int CheckLongDir(HI_SESSION* session, URI_PTR* uri_ptr, const uint8_t* ptr); /** This makes passing function arguments much more readable and easier ** to follow. */ typedef int (* LOOKUP_FCN)( - HI_SESSION*, const u_char* start, const u_char* end, const u_char**, URI_PTR*); + HI_SESSION*, const uint8_t* start, const uint8_t* end, const uint8_t**, URI_PTR*); -int NextNonWhiteSpace(HI_SESSION*, const u_char*, const u_char*, const u_char**, URI_PTR*); +int NextNonWhiteSpace(HI_SESSION*, const uint8_t*, const uint8_t*, const uint8_t**, URI_PTR*); /* ** The lookup table contains functions for different HTTP delimiters diff --git a/extra/src/inspectors/http_server/hi_client_init.cc b/extra/src/inspectors/http_server/hi_client_init.cc index 53398ed68..9312d4d79 100644 --- a/extra/src/inspectors/http_server/hi_client_init.cc +++ b/extra/src/inspectors/http_server/hi_client_init.cc @@ -22,7 +22,11 @@ // this file was split from hi_client.cc; look there for the real // culprits ;) -#include "hi_client.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "hi_events.h" #include "hi_return_codes.h" #include "hi_si.h" #include "hi_util.h" diff --git a/extra/src/inspectors/http_server/hi_client_norm.cc b/extra/src/inspectors/http_server/hi_client_norm.cc index 80f1831af..97926fe03 100644 --- a/extra/src/inspectors/http_server/hi_client_norm.cc +++ b/extra/src/inspectors/http_server/hi_client_norm.cc @@ -45,17 +45,17 @@ ** - Initial development. DJR */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hi_client_norm.h" -#include -#include -#include -#include +#include "main/snort_debug.h" +#include "utils/safec.h" #include "hi_norm.h" -#include "hi_util.h" #include "hi_return_codes.h" -#include "utils/safec.h" int hi_split_header_cookie( HI_SESSION*, u_char* header, int* i_header_len, diff --git a/extra/src/inspectors/http_server/hi_client_norm.h b/extra/src/inspectors/http_server/hi_client_norm.h index b383a8acb..3b4e3c55f 100644 --- a/extra/src/inspectors/http_server/hi_client_norm.h +++ b/extra/src/inspectors/http_server/hi_client_norm.h @@ -32,7 +32,6 @@ #ifndef HI_CLIENT_NORM_H #define HI_CLIENT_NORM_H -#include "hi_include.h" #include "hi_si.h" int hi_client_norm(HI_SESSION* session); diff --git a/extra/src/inspectors/http_server/hi_cmd_lookup.cc b/extra/src/inspectors/http_server/hi_cmd_lookup.cc index eeb773fa5..950fa1c5e 100644 --- a/extra/src/inspectors/http_server/hi_cmd_lookup.cc +++ b/extra/src/inspectors/http_server/hi_cmd_lookup.cc @@ -16,13 +16,12 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "hi_cmd_lookup.h" -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "utils/kmap.h" +#include "hi_cmd_lookup.h" /* * Function: http_cmd_lookup_init(CMD_LOOKUP **CmdLookup) diff --git a/extra/src/inspectors/http_server/hi_events.cc b/extra/src/inspectors/http_server/hi_events.cc index 5fdd536ee..e6f245787 100644 --- a/extra/src/inspectors/http_server/hi_events.cc +++ b/extra/src/inspectors/http_server/hi_events.cc @@ -18,12 +18,17 @@ //-------------------------------------------------------------------------- // hi_events.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hi_events.h" #include #include #include "events/event_queue.h" +#include "main/thread.h" static THREAD_LOCAL uint64_t gid_client = 0; static THREAD_LOCAL uint64_t gid_server = 0; diff --git a/extra/src/inspectors/http_server/hi_events.h b/extra/src/inspectors/http_server/hi_events.h index ee6a3819c..7aa691a77 100644 --- a/extra/src/inspectors/http_server/hi_events.h +++ b/extra/src/inspectors/http_server/hi_events.h @@ -20,8 +20,6 @@ #ifndef HI_EVENTS_H #define HI_EVENTS_H -#include "hi_include.h" - // changed gids from 119-120 to avoid overlap with nhi #define GID_HTTP_CLIENT 319 #define GID_HTTP_SERVER 320 diff --git a/extra/src/inspectors/http_server/hi_include.h b/extra/src/inspectors/http_server/hi_include.h index ec4ed1b2f..dec8a8048 100644 --- a/extra/src/inspectors/http_server/hi_include.h +++ b/extra/src/inspectors/http_server/hi_include.h @@ -21,8 +21,6 @@ #define HI_INCLUDE_H #include "framework/counts.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "main/thread.h" #define HI_UNKNOWN_METHOD 1 diff --git a/extra/src/inspectors/http_server/hi_main.cc b/extra/src/inspectors/http_server/hi_main.cc index 5f4c17b85..57c0ffe64 100644 --- a/extra/src/inspectors/http_server/hi_main.cc +++ b/extra/src/inspectors/http_server/hi_main.cc @@ -46,44 +46,30 @@ ** - 2.11.03: Initial Development. DJR ** - 2.4.05: Added tab_uri_delimiter config option. AJM. */ -#include "hi_main.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include +#include "hi_main.h" #include "detection/detect.h" -#include "detection/detection_util.h" -#include "events/event.h" -#include "file_api/file_api.h" #include "file_api/file_flows.h" -#include "framework/data_bus.h" #include "log/messages.h" #include "log/unified2.h" -#include "main/snort_debug.h" -#include "mime/decode_base.h" #include "profiler/profiler.h" #include "protocols/packet.h" #include "protocols/tcp.h" #include "search_engines/search_tool.h" #include "stream/stream.h" -#include "utils/util.h" -#include "utils/util_utf.h" #include "utils/sfsnprintfappend.h" -#include "hi_return_codes.h" -#include "hi_ui_config.h" -#include "hi_ui_iis_unicode_map.h" -#include "hi_si.h" +#include "hi_ad.h" +#include "hi_include.h" #include "hi_mi.h" #include "hi_norm.h" -#include "hi_cmd_lookup.h" +#include "hi_return_codes.h" +#include "hi_si.h" const HiSearchToken hi_patterns[] = { diff --git a/extra/src/inspectors/http_server/hi_main.h b/extra/src/inspectors/http_server/hi_main.h index 60be51e8d..81c408825 100644 --- a/extra/src/inspectors/http_server/hi_main.h +++ b/extra/src/inspectors/http_server/hi_main.h @@ -20,16 +20,15 @@ #ifndef HI_MAIN_H #define HI_MAIN_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include +#include "decompress/file_decomp.h" #include "detection/detection_util.h" -#include "protocols/packet.h" +#include "flow/flow.h" +#include "utils/util.h" #include "utils/util_jsnorm.h" #include "utils/util_utf.h" + #include "hi_ui_config.h" #define MAX_METHOD_LEN 256 diff --git a/extra/src/inspectors/http_server/hi_mi.cc b/extra/src/inspectors/http_server/hi_mi.cc index 84fe1eea7..9027e155e 100644 --- a/extra/src/inspectors/http_server/hi_mi.cc +++ b/extra/src/inspectors/http_server/hi_mi.cc @@ -33,11 +33,14 @@ ** - 3.2.03: Initial development. DJR */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hi_mi.h" -#include "hi_si.h" -#include "hi_client.h" -#include "hi_server.h" +#include "protocols/packet.h" + #include "hi_return_codes.h" /* diff --git a/extra/src/inspectors/http_server/hi_mi.h b/extra/src/inspectors/http_server/hi_mi.h index d7220478a..e0f48e6c8 100644 --- a/extra/src/inspectors/http_server/hi_mi.h +++ b/extra/src/inspectors/http_server/hi_mi.h @@ -30,10 +30,7 @@ #ifndef HI_MI_H #define HI_MI_H -#include - #include "hi_si.h" -#include "hi_main.h" int hi_mi_mode_inspection(HI_SESSION* session, int iInspectMode, Packet* p, HttpSessionData*); diff --git a/extra/src/inspectors/http_server/hi_module.cc b/extra/src/inspectors/http_server/hi_module.cc index e9a0ffc44..69bb969ab 100644 --- a/extra/src/inspectors/http_server/hi_module.cc +++ b/extra/src/inspectors/http_server/hi_module.cc @@ -18,16 +18,17 @@ // hi_module.cc author Russ Combs -#include "hi_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "hi_module.h" #include "decompress/file_decomp.h" #include "utils/util.h" -#include "hi_ui_config.h" -#include "hi_events.h" #include "hi_cmd_lookup.h" +#include "hi_include.h" #include "hi_ui_iis_unicode_map.h" //------------------------------------------------------------------------- diff --git a/extra/src/inspectors/http_server/hi_module.h b/extra/src/inspectors/http_server/hi_module.h index f774ad4c2..a058a9d36 100644 --- a/extra/src/inspectors/http_server/hi_module.h +++ b/extra/src/inspectors/http_server/hi_module.h @@ -21,11 +21,10 @@ #ifndef HI_MODULE_H #define HI_MODULE_H -#include - #include "framework/module.h" -#include "hi_ui_config.h" + #include "hi_events.h" +#include "hi_ui_config.h" #define GLOBAL_KEYWORD "http_global" #define SERVER_KEYWORD "http_server" diff --git a/extra/src/inspectors/http_server/hi_norm.cc b/extra/src/inspectors/http_server/hi_norm.cc index 09fa2eda7..f01d6bc9e 100644 --- a/extra/src/inspectors/http_server/hi_norm.cc +++ b/extra/src/inspectors/http_server/hi_norm.cc @@ -33,23 +33,18 @@ ** - Initial development. DJR */ -#include "hi_norm.h" - -#include -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "detection/detection_util.h" +#include "hi_norm.h" #include "hi_client_norm.h" -#include "hi_server_norm.h" #include "hi_events.h" -#include "hi_ui_iis_unicode_map.h" +#include "hi_include.h" #include "hi_return_codes.h" -#include "hi_si.h" -#include "hi_util.h" +#include "hi_server_norm.h" +#include "hi_ui_iis_unicode_map.h" #define MAX_DIRS 2048 diff --git a/extra/src/inspectors/http_server/hi_norm.h b/extra/src/inspectors/http_server/hi_norm.h index fd3376cbd..878fb8c33 100644 --- a/extra/src/inspectors/http_server/hi_norm.h +++ b/extra/src/inspectors/http_server/hi_norm.h @@ -32,10 +32,6 @@ #ifndef HI_NORM_H #define HI_NORM_H -#include - -#include "hi_include.h" -#include "hi_ui_config.h" #include "hi_si.h" #define MAX_URI 8192 diff --git a/extra/src/inspectors/http_server/hi_return_codes.h b/extra/src/inspectors/http_server/hi_return_codes.h index 01483f0e4..5eead23b2 100644 --- a/extra/src/inspectors/http_server/hi_return_codes.h +++ b/extra/src/inspectors/http_server/hi_return_codes.h @@ -36,8 +36,6 @@ #ifndef HI_RETURN_CODES_H #define HI_RETURN_CODES_H -#include "hi_include.h" - #define HI_BOOL_FALSE 0 #define HI_SUCCESS 0 diff --git a/extra/src/inspectors/http_server/hi_server.cc b/extra/src/inspectors/http_server/hi_server.cc index ecbe6a91a..6c616b099 100644 --- a/extra/src/inspectors/http_server/hi_server.cc +++ b/extra/src/inspectors/http_server/hi_server.cc @@ -34,28 +34,28 @@ ** NOTES: ** - Initial development. DJR */ -#include -#include -#include "hi_stream_splitter.h" -#include "main/thread.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "hi_server.h" + +#include "protocols/packet.h" #include "utils/safec.h" -#include "utils/util_utf.h" +#include "utils/util_unfold.h" + +#include "hi_events.h" +#include "hi_include.h" +#include "hi_return_codes.h" +#include "hi_si.h" +#include "hi_stream_splitter.h" static THREAD_LOCAL bool headers = false; static THREAD_LOCAL bool simple_response = false; static THREAD_LOCAL uint8_t decompression_buffer[65535]; static THREAD_LOCAL uint8_t dechunk_buffer[65535]; -#include "hi_server.h" -#include "hi_ui_config.h" -#include "hi_return_codes.h" -#include "hi_si.h" - -#include "detection/detection_util.h" -#include "utils/util_unfold.h" -#include "protocols/tcp.h" - #define STAT_END 100 #define HTTPRESP_HEADER_NAME__COOKIE "Set-Cookie" #define HTTPRESP_HEADER_LENGTH__COOKIE 10 diff --git a/extra/src/inspectors/http_server/hi_server.h b/extra/src/inspectors/http_server/hi_server.h index 473c4dbca..0dabc9cc5 100644 --- a/extra/src/inspectors/http_server/hi_server.h +++ b/extra/src/inspectors/http_server/hi_server.h @@ -25,10 +25,8 @@ // This file declares the server structure and functions to access server // inspection. -#include "hi_include.h" -#include "hi_util.h" -#include "hi_main.h" #include "hi_client.h" +#include "hi_util.h" typedef struct s_HI_SERVER_RESP { diff --git a/extra/src/inspectors/http_server/hi_server_norm.cc b/extra/src/inspectors/http_server/hi_server_norm.cc index ba4696f35..17ba8a1a7 100644 --- a/extra/src/inspectors/http_server/hi_server_norm.cc +++ b/extra/src/inspectors/http_server/hi_server_norm.cc @@ -45,22 +45,19 @@ ** - Initial development. DJR */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hi_server_norm.h" -#include -#include -#include -#include +#include "search_engines/search_tool.h" +#include "utils/safec.h" +#include "hi_events.h" #include "hi_norm.h" -#include "hi_util.h" #include "hi_return_codes.h" -#include "detection/detection_util.h" -#include "search_engines/search_tool.h" -#include "utils/safec.h" -#include "utils/util_utf.h" - int hi_server_norm(HI_SESSION* session, HttpSessionData* hsd) { static THREAD_LOCAL u_char HeaderBuf[MAX_URI]; diff --git a/extra/src/inspectors/http_server/hi_server_norm.h b/extra/src/inspectors/http_server/hi_server_norm.h index c7e8a5589..5b1a5ab1f 100644 --- a/extra/src/inspectors/http_server/hi_server_norm.h +++ b/extra/src/inspectors/http_server/hi_server_norm.h @@ -32,7 +32,6 @@ #ifndef HI_SERVER_NORM_H #define HI_SERVER_NORM_H -#include "hi_include.h" #include "hi_si.h" int hi_server_norm(HI_SESSION* session, HttpSessionData* hsd); diff --git a/extra/src/inspectors/http_server/hi_si.cc b/extra/src/inspectors/http_server/hi_si.cc index bb1d934e0..11c761d2d 100644 --- a/extra/src/inspectors/http_server/hi_si.cc +++ b/extra/src/inspectors/http_server/hi_si.cc @@ -41,16 +41,16 @@ ** ** - 2.25.03: Initial Development. DJR */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hi_si.h" -#include -#include -#include +#include "protocols/packet.h" #include "hi_return_codes.h" -#include "hi_ui_config.h" -#include "hi_ad.h" -#include "hi_main.h" /* ** NAME diff --git a/extra/src/inspectors/http_server/hi_si.h b/extra/src/inspectors/http_server/hi_si.h index a958c5621..4e3ae6db9 100644 --- a/extra/src/inspectors/http_server/hi_si.h +++ b/extra/src/inspectors/http_server/hi_si.h @@ -35,12 +35,8 @@ #ifndef HI_SI_H #define HI_SI_H -#include "hi_include.h" -#include "hi_ui_config.h" #include "hi_client.h" #include "hi_server.h" -#include "hi_ad.h" -#include "sfip/sf_ip.h" struct Packet; diff --git a/extra/src/inspectors/http_server/hi_stream_splitter.cc b/extra/src/inspectors/http_server/hi_stream_splitter.cc index e6d9f406f..ef9ab821f 100644 --- a/extra/src/inspectors/http_server/hi_stream_splitter.cc +++ b/extra/src/inspectors/http_server/hi_stream_splitter.cc @@ -43,26 +43,20 @@ // * Range, Content-Range, and multipart //-------------------------------------------------------------------- -#include "hi_stream_splitter.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include +#include "hi_stream_splitter.h" -#include "hi_events.h" -#include "main/snort_debug.h" #include "events/event_queue.h" +#include "main/snort_debug.h" #include "protocols/packet.h" #include "stream/stream.h" #include "utils/util.h" +#include "hi_events.h" + #ifdef DEBUG_MSGS #define HI_TRACE // define for state trace #endif diff --git a/extra/src/inspectors/http_server/hi_stream_splitter.h b/extra/src/inspectors/http_server/hi_stream_splitter.h index b8199c945..d4f929a1c 100644 --- a/extra/src/inspectors/http_server/hi_stream_splitter.h +++ b/extra/src/inspectors/http_server/hi_stream_splitter.h @@ -27,7 +27,6 @@ #ifndef HI_STREAM_SPLITTER_H #define HI_STREAM_SPLITTER_H -#include "main/snort_types.h" #include "stream/stream_splitter.h" bool hi_paf_init(uint32_t cap); diff --git a/extra/src/inspectors/http_server/hi_ui_config.cc b/extra/src/inspectors/http_server/hi_ui_config.cc index 81c439438..340431018 100644 --- a/extra/src/inspectors/http_server/hi_ui_config.cc +++ b/extra/src/inspectors/http_server/hi_ui_config.cc @@ -33,16 +33,17 @@ ** - 2.10.03: Initial Developments. DJR ** - 2.4.05: Added tab_uri_delimiter config option. AJM. */ -#include "hi_ui_config.h" -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "hi_ui_config.h" #include "utils/util.h" -#include "hi_return_codes.h" + #include "hi_cmd_lookup.h" +#include "hi_return_codes.h" HTTPINSPECT_GLOBAL_CONF::HTTPINSPECT_GLOBAL_CONF() { diff --git a/extra/src/inspectors/http_server/hi_ui_config.h b/extra/src/inspectors/http_server/hi_ui_config.h index 77e005279..3abb3b698 100644 --- a/extra/src/inspectors/http_server/hi_ui_config.h +++ b/extra/src/inspectors/http_server/hi_ui_config.h @@ -33,14 +33,8 @@ #ifndef HI_UI_CONFIG_H #define HI_UI_CONFIG_H -#include "hi_include.h" -#include "sfrt/sfrt.h" -#include "sfip/sf_ip.h" -#include "mime/file_mime_process.h" -#include "file_api/file_api.h" -#include "decompress/file_decomp.h" #include "framework/bits.h" -#include "utils/util.h" +#include "mime/file_mime_process.h" #include "utils/kmap.h" #define HI_UI_CONFIG_MAX_HDR_DEFAULT 0 diff --git a/extra/src/inspectors/http_server/hi_ui_iis_unicode_map.cc b/extra/src/inspectors/http_server/hi_ui_iis_unicode_map.cc index 803a8aa74..932368227 100644 --- a/extra/src/inspectors/http_server/hi_ui_iis_unicode_map.cc +++ b/extra/src/inspectors/http_server/hi_ui_iis_unicode_map.cc @@ -33,18 +33,16 @@ ** - Initial development. DJR */ -#include "hi_ui_iis_unicode_map.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include +#include "hi_ui_iis_unicode_map.h" #include -#include #include "utils/util.h" -#include "hi_ui_config.h" + #include "hi_return_codes.h" #define MAX_BUFFER 50000 diff --git a/extra/src/inspectors/http_server/hi_ui_iis_unicode_map.h b/extra/src/inspectors/http_server/hi_ui_iis_unicode_map.h index f0a0792c3..cf5cdc00f 100644 --- a/extra/src/inspectors/http_server/hi_ui_iis_unicode_map.h +++ b/extra/src/inspectors/http_server/hi_ui_iis_unicode_map.h @@ -23,8 +23,7 @@ #ifndef HI_UI_IIS_UNICODE_MAP_H #define HI_UI_IIS_UNICODE_MAP_H -#include "hi_include.h" -#include "hi_ui_config.h" +#include /* ** This is the define for the iis_unicode_map array when there is no diff --git a/extra/src/inspectors/http_server/hi_util.h b/extra/src/inspectors/http_server/hi_util.h index e9ba0da11..a8618dfb7 100644 --- a/extra/src/inspectors/http_server/hi_util.h +++ b/extra/src/inspectors/http_server/hi_util.h @@ -33,9 +33,6 @@ #ifndef HI_UTIL_H #define HI_UTIL_H -#include -#include "hi_include.h" - /* ** This function checks for in bounds condition on buffers. ** diff --git a/extra/src/inspectors/http_server/http_inspect.cc b/extra/src/inspectors/http_server/http_inspect.cc index 59dffd126..6f5fa4ade 100644 --- a/extra/src/inspectors/http_server/http_inspect.cc +++ b/extra/src/inspectors/http_server/http_inspect.cc @@ -36,30 +36,19 @@ #include "config.h" #endif -#include -#include -#include - // FIXIT-L all snort includes should use
instead of "form" #include "log/messages.h" -#include "protocols/packet.h" -#include "main/snort_debug.h" -#include "decompress/file_decomp.h" -#include "profiler/profiler.h" -#include "file_api/file_api.h" #include "file_api/file_service.h" -#include "mime/decode_base.h" -#include "utils/util.h" -#include "framework/inspector.h" #include "managers/inspector_manager.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" -#include "hi_client.h" -#include "hi_ui_config.h" -#include "hi_module.h" -#include "hi_norm.h" +#include "hi_events.h" +#include "hi_include.h" #include "hi_main.h" -#include "hi_cmd_lookup.h" +#include "hi_module.h" #include "hi_stream_splitter.h" +#include "hi_ui_config.h" int hex_lookup[256]; int valid_lookup[256]; diff --git a/extra/src/inspectors/http_server/ips_http.cc b/extra/src/inspectors/http_server/ips_http.cc index fec0f7f53..fae8faa47 100644 --- a/extra/src/inspectors/http_server/ips_http.cc +++ b/extra/src/inspectors/http_server/ips_http.cc @@ -23,16 +23,12 @@ #include -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "flow/flow.h" +#include "framework/cursor.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/cursor.h" -#include "framework/inspector.h" #include "framework/module.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" enum PsIdx { diff --git a/extra/src/inspectors/http_server/ips_http_header.cc b/extra/src/inspectors/http_server/ips_http_header.cc index 4c93d4e83..e2345c7da 100644 --- a/extra/src/inspectors/http_server/ips_http_header.cc +++ b/extra/src/inspectors/http_server/ips_http_header.cc @@ -21,10 +21,8 @@ #include "config.h" #endif -#include - -#include "detection/detection_defines.h" #include "framework/cursor.h" +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" #include "hash/sfhashfcn.h" diff --git a/extra/src/ips_options/ips_pkt_num/ips_pkt_num.cc b/extra/src/ips_options/ips_pkt_num/ips_pkt_num.cc index f3a1f83d3..34145be4b 100644 --- a/extra/src/ips_options/ips_pkt_num/ips_pkt_num.cc +++ b/extra/src/ips_options/ips_pkt_num/ips_pkt_num.cc @@ -22,23 +22,13 @@ #include "config.h" #endif -#include -#include -#include - -#include "main/snort_types.h" -#include "main/thread.h" #include "detection/detection_defines.h" -#include "detection/treenodes.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" #include "framework/range.h" #include "hash/sfhashfcn.h" -#include "protocols/packet.h" -#include "protocols/tcp.h" #include "profiler/profiler.h" -#include "utils/stats.h" static const char* s_name = "pkt_num"; static const char* s_help = "alert on raw packet number"; diff --git a/extra/src/ips_options/ips_urg/ips_urg.cc b/extra/src/ips_options/ips_urg/ips_urg.cc index 2d0d66d58..fae90dc54 100644 --- a/extra/src/ips_options/ips_urg/ips_urg.cc +++ b/extra/src/ips_options/ips_urg/ips_urg.cc @@ -22,22 +22,14 @@ #include "config.h" #endif -#include -#include -#include - -#include "main/snort_types.h" -#include "main/thread.h" #include "detection/detection_defines.h" -#include "detection/treenodes.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" #include "framework/range.h" #include "hash/sfhashfcn.h" +#include "profiler/profiler.h" #include "protocols/packet.h" #include "protocols/tcp.h" -#include "profiler/profiler.h" static const char* s_name = "urg"; static const char* s_help = "detection for TCP urgent pointer"; diff --git a/extra/src/loggers/alert_ex/alert_ex.cc b/extra/src/loggers/alert_ex/alert_ex.cc index 8f6e6dfa3..b6b42c96a 100644 --- a/extra/src/loggers/alert_ex/alert_ex.cc +++ b/extra/src/loggers/alert_ex/alert_ex.cc @@ -23,17 +23,12 @@ #include "config.h" #endif -#include -#include - -#include #include -#include "main/snort_types.h" +#include "detection/signature.h" +#include "events/event.h" #include "framework/logger.h" #include "framework/module.h" -#include "protocols/packet.h" -#include "detection/signature.h" using namespace std; diff --git a/extra/src/loggers/alert_unixsock/alert_unixsock.cc b/extra/src/loggers/alert_unixsock/alert_unixsock.cc index 58517f143..376bd17bb 100644 --- a/extra/src/loggers/alert_unixsock/alert_unixsock.cc +++ b/extra/src/loggers/alert_unixsock/alert_unixsock.cc @@ -23,21 +23,13 @@ #include "config.h" #endif -#include -#include #include -#include -#include -#include - -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "framework/logger.h" -#include "framework/module.h" #include "detection/signature.h" #include "events/event.h" +#include "framework/logger.h" +#include "framework/module.h" +#include "log/messages.h" #include "protocols/packet.h" #include "utils/util.h" diff --git a/extra/src/loggers/log_null/log_null.cc b/extra/src/loggers/log_null/log_null.cc index 8d18e5406..f71f3f7ea 100644 --- a/extra/src/loggers/log_null/log_null.cc +++ b/extra/src/loggers/log_null/log_null.cc @@ -27,8 +27,6 @@ #include "config.h" #endif -#include - #include "framework/logger.h" #include "framework/module.h" diff --git a/extra/src/search_engines/lowmem/lowmem.cc b/extra/src/search_engines/lowmem/lowmem.cc index 74527af00..5f2b13530 100644 --- a/extra/src/search_engines/lowmem/lowmem.cc +++ b/extra/src/search_engines/lowmem/lowmem.cc @@ -32,12 +32,10 @@ #include "config.h" #endif -#include "sfksearch.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" #include "log/messages.h" #include "framework/mpse.h" -#include "profiler/profiler.h" + +#include "sfksearch.h" //------------------------------------------------------------------------- // "lowmem" diff --git a/extra/src/search_engines/lowmem/sfksearch.cc b/extra/src/search_engines/lowmem/sfksearch.cc index b2d759162..d498082ee 100644 --- a/extra/src/search_engines/lowmem/sfksearch.cc +++ b/extra/src/search_engines/lowmem/sfksearch.cc @@ -32,20 +32,13 @@ #include "config.h" #endif -#include -#include -#include -#include -#include -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" +#include "sfksearch.h" + +#include + #include "main/thread.h" #include "utils/util.h" -#include "sfksearch.h" - static void KTrieFree(KTRIENODE* n); static unsigned int mtot = 0; diff --git a/extra/src/search_engines/lowmem/trie_api.cc b/extra/src/search_engines/lowmem/trie_api.cc index 0e2438d07..27e04ab40 100644 --- a/extra/src/search_engines/lowmem/trie_api.cc +++ b/extra/src/search_engines/lowmem/trie_api.cc @@ -18,7 +18,12 @@ //-------------------------------------------------------------------------- // trie_api.cc author Russ Combs -#include "framework/mpse.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "framework/base_api.h" +#include "main/snort_types.h" extern const BaseApi* se_lowmem; diff --git a/extra/src/so_rules/sid_18758/sid_18758.cc b/extra/src/so_rules/sid_18758/sid_18758.cc index 9cd30b0a6..4ae0b35b8 100644 --- a/extra/src/so_rules/sid_18758/sid_18758.cc +++ b/extra/src/so_rules/sid_18758/sid_18758.cc @@ -21,13 +21,10 @@ #include "config.h" #endif -#include -#include +#include "sid_18758.h" -#include "main/snort_types.h" -#include "framework/so_rule.h" #include "detection/detection_defines.h" -#include "sid_18758.h" +#include "framework/so_rule.h" static int eval(void*, Cursor&, Packet*) { diff --git a/extra/src/so_rules/sid_18758/sid_18758.h b/extra/src/so_rules/sid_18758/sid_18758.h index 1b3654f8f..47bdcdbb1 100644 --- a/extra/src/so_rules/sid_18758/sid_18758.h +++ b/extra/src/so_rules/sid_18758/sid_18758.h @@ -1,3 +1,8 @@ +#ifndef SID_18758_H +#define SID_18758_H + +#include + const uint8_t rule_18758[] = { 0x61, 0x6C, 0x65, 0x72, 0x74, 0x20, 0x74, 0x63, 0x70, 0x20, 0x24, 0x48, 0x4F, 0x4D, 0x45, 0x5F, @@ -34,3 +39,5 @@ const uint8_t rule_18758[] = 0x20, 0x20, 0x20, 0x73, 0x6F, 0x3A, 0x65, 0x76, 0x61, 0x6C, 0x3B, 0x0A, 0x29, 0x0A, 0x00, }; const unsigned rule_18758_len = 0; + +#endif diff --git a/src/actions/act_react.cc b/src/actions/act_react.cc index ea9be0be8..cb2bd3e7a 100644 --- a/src/actions/act_react.cc +++ b/src/actions/act_react.cc @@ -44,23 +44,14 @@ #include "config.h" #endif -#include #include -#include -#include -#include - -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "packet_io/active.h" -#include "parser/parser.h" #include "framework/ips_action.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "log/messages.h" +#include "packet_io/active.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #include "utils/util.h" #define s_name "react" diff --git a/src/actions/act_reject.cc b/src/actions/act_reject.cc index 3e589d86f..d07912424 100644 --- a/src/actions/act_reject.cc +++ b/src/actions/act_reject.cc @@ -48,15 +48,10 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "packet_io/active.h" -#include "utils/util.h" #include "framework/ips_action.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "packet_io/active.h" +#include "profiler/profiler.h" #define REJ_RST_SRC 0x01 #define REJ_RST_DST 0x02 diff --git a/src/actions/act_replace.cc b/src/actions/act_replace.cc index c250c03ed..01ce3517b 100644 --- a/src/actions/act_replace.cc +++ b/src/actions/act_replace.cc @@ -17,20 +17,16 @@ //-------------------------------------------------------------------------- // act_replace.cc author Russ Combs -#include "act_replace.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "act_replace.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "framework/ips_action.h" #include "framework/module.h" -#include "protocols/packet.h" #include "packet_io/active.h" +#include "protocols/packet.h" #define s_name "rewrite" diff --git a/src/actions/actions.cc b/src/actions/actions.cc index a5cb8d2d8..00ce92765 100644 --- a/src/actions/actions.cc +++ b/src/actions/actions.cc @@ -16,12 +16,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "actions.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "actions.h" + #include "detection/detect.h" #include "detection/tag.h" #include "packet_io/active.h" diff --git a/src/actions/actions.h b/src/actions/actions.h index 54292ba2f..a82758c54 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -21,7 +21,7 @@ // Define action types and provide hooks to apply a given action to a packet -#include +#include #define ACTION_LOG "log" #define ACTION_PASS "pass" diff --git a/src/actions/ips_actions.cc b/src/actions/ips_actions.cc index 79d1673f2..84b22ca8e 100644 --- a/src/actions/ips_actions.cc +++ b/src/actions/ips_actions.cc @@ -17,13 +17,14 @@ //-------------------------------------------------------------------------- // ips_actions.cc author Russ Combs -#include "ips_actions.h" -#include "managers/plugin_manager.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "ips_actions.h" + +#include "managers/plugin_manager.h" + #ifdef STATIC_IPS_ACTIONS extern const BaseApi* act_react[]; extern const BaseApi* act_reject[]; diff --git a/src/catch/unit_test.cc b/src/catch/unit_test.cc index 628a88773..c4e2841a5 100644 --- a/src/catch/unit_test.cc +++ b/src/catch/unit_test.cc @@ -17,13 +17,11 @@ //-------------------------------------------------------------------------- // unit_test.h author Russ Combs -#include "unit_test.h" - -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "unit_test.h" #define CATCH_CONFIG_RUNNER #include "catch.hpp" diff --git a/src/catch/unit_test_main.h b/src/catch/unit_test_main.h index b1dce8122..8d2fe6363 100644 --- a/src/catch/unit_test_main.h +++ b/src/catch/unit_test_main.h @@ -27,6 +27,7 @@ // Unresolved external symbol declarations and references. SNORT_CATCH_FORCED_INCLUSION_EXTERN(bitop_test); +SNORT_CATCH_FORCED_INCLUSION_EXTERN(lua_stack_test); SNORT_CATCH_FORCED_INCLUSION_EXTERN(sfdaq_module_test); SNORT_CATCH_FORCED_INCLUSION_EXTERN(sfip_test); SNORT_CATCH_FORCED_INCLUSION_EXTERN(sfrf_test); @@ -37,6 +38,7 @@ SNORT_CATCH_FORCED_INCLUSION_EXTERN(stopwatch_test); bool catch_extern_tests[] = { SNORT_CATCH_FORCED_INCLUSION_SYMBOL(bitop_test), + SNORT_CATCH_FORCED_INCLUSION_SYMBOL(lua_stack_test), SNORT_CATCH_FORCED_INCLUSION_SYMBOL(sfdaq_module_test), SNORT_CATCH_FORCED_INCLUSION_SYMBOL(sfip_test), SNORT_CATCH_FORCED_INCLUSION_SYMBOL(sfrf_test), diff --git a/src/codecs/codec_api.cc b/src/codecs/codec_api.cc index 4838efc3f..c3793e2be 100644 --- a/src/codecs/codec_api.cc +++ b/src/codecs/codec_api.cc @@ -17,12 +17,12 @@ //-------------------------------------------------------------------------- // codec_api.cc author Josh Rosenbaum -#include "codec_api.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "codec_api.h" + #include "framework/codec.h" #include "managers/plugin_manager.h" diff --git a/src/codecs/codec_module.cc b/src/codecs/codec_module.cc index 4bbd4b317..0e809e302 100644 --- a/src/codecs/codec_module.cc +++ b/src/codecs/codec_module.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // codec_module.cc author Josh Rosenbaum +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "codecs/codec_module.h" #define codec_module_help \ diff --git a/src/codecs/ip/cd_auth.cc b/src/codecs/ip/cd_auth.cc index 68b475824..7f795e6ae 100644 --- a/src/codecs/ip/cd_auth.cc +++ b/src/codecs/ip/cd_auth.cc @@ -21,11 +21,8 @@ #include "config.h" #endif -#include "framework/codec.h" -#include "protocols/protocol_ids.h" -#include "protocols/ipv6.h" -#include "protocols/packet.h" #include "codecs/codec_module.h" +#include "framework/codec.h" #include "main/snort_config.h" #define CD_AUTH_NAME "auth" diff --git a/src/codecs/ip/cd_dst_opts.cc b/src/codecs/ip/cd_dst_opts.cc index 0787be025..74c20bf5c 100644 --- a/src/codecs/ip/cd_dst_opts.cc +++ b/src/codecs/ip/cd_dst_opts.cc @@ -21,11 +21,8 @@ #include "config.h" #endif -#include "framework/codec.h" -#include "log/messages.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet.h" #include "codecs/codec_module.h" +#include "framework/codec.h" #include "main/snort_config.h" #define CD_DSTOPTS_NAME "ipv6_dst_opts" diff --git a/src/codecs/ip/cd_esp.cc b/src/codecs/ip/cd_esp.cc index 344008ffe..fcd86a785 100644 --- a/src/codecs/ip/cd_esp.cc +++ b/src/codecs/ip/cd_esp.cc @@ -22,10 +22,9 @@ #include "config.h" #endif +#include "codecs/codec_module.h" #include "framework/codec.h" #include "main/snort_config.h" -#include "protocols/protocol_ids.h" -#include "codecs/codec_module.h" #define CD_ESP_NAME "esp" #define CD_ESP_HELP "support for encapsulating security payload" diff --git a/src/codecs/ip/cd_frag.cc b/src/codecs/ip/cd_frag.cc index df4e90fdc..a85fdadcc 100644 --- a/src/codecs/ip/cd_frag.cc +++ b/src/codecs/ip/cd_frag.cc @@ -25,10 +25,6 @@ #include "framework/codec.h" #include "log/text_log.h" #include "main/snort_config.h" -#include "protocols/ipv6.h" -#include "protocols/packet.h" -#include "protocols/packet_manager.h" -#include "protocols/protocol_ids.h" #define CD_IPV6_FRAG_NAME "ipv6_frag" #define CD_IPV6_FRAG_HELP "support for IPv6 fragment decoding" diff --git a/src/codecs/ip/cd_gre.cc b/src/codecs/ip/cd_gre.cc index 8c78b0172..863fa3c24 100644 --- a/src/codecs/ip/cd_gre.cc +++ b/src/codecs/ip/cd_gre.cc @@ -22,13 +22,10 @@ #include "config.h" #endif +#include "codecs/codec_module.h" #include "framework/codec.h" -#include "protocols/packet.h" -#include "protocols/protocol_ids.h" #include "protocols/gre.h" #include "log/text_log.h" -#include "protocols/packet_manager.h" -#include "codecs/codec_module.h" #define CD_GRE_NAME "gre" #define CD_GRE_HELP "support for generic routing encapsulation" diff --git a/src/codecs/ip/cd_hop_opts.cc b/src/codecs/ip/cd_hop_opts.cc index 55698d6fe..7ab6af879 100644 --- a/src/codecs/ip/cd_hop_opts.cc +++ b/src/codecs/ip/cd_hop_opts.cc @@ -23,9 +23,7 @@ #include "codecs/codec_module.h" #include "framework/codec.h" -#include "protocols/ipv6.h" #include "main/snort_config.h" -#include "protocols/protocol_ids.h" #define CD_HOPOPTS_NAME "ipv6_hop_opts" #define CD_HOPOPTS_HELP "support for IPv6 hop options" diff --git a/src/codecs/ip/cd_icmp4.cc b/src/codecs/ip/cd_icmp4.cc index 989bcae7d..8c12b9f81 100644 --- a/src/codecs/ip/cd_icmp4.cc +++ b/src/codecs/ip/cd_icmp4.cc @@ -23,12 +23,13 @@ #endif #include "codecs/codec_module.h" -#include "codecs/ip/checksum.h" #include "framework/codec.h" #include "log/text_log.h" #include "main/snort_config.h" #include "protocols/icmp4.h" +#include "checksum.h" + #define CD_ICMP4_NAME "icmp4" #define CD_ICMP4_HELP "support for Internet control message protocol v4" diff --git a/src/codecs/ip/cd_icmp6.cc b/src/codecs/ip/cd_icmp6.cc index 749e183de..b48425756 100644 --- a/src/codecs/ip/cd_icmp6.cc +++ b/src/codecs/ip/cd_icmp6.cc @@ -22,18 +22,16 @@ #include "config.h" #endif -#include "main/snort_config.h" +#include "codecs/codec_module.h" #include "framework/codec.h" +#include "log/text_log.h" +#include "main/snort_config.h" #include "protocols/icmp6.h" #include "protocols/icmp4.h" -#include "codecs/codec_module.h" -#include "codecs/codec_module.h" -#include "codecs/ip/checksum.h" -#include "packet_io/active.h" -#include "log/text_log.h" -#include "main/snort_debug.h" #include "utils/util.h" +#include "checksum.h" + #define CD_ICMP6_NAME "icmp6" #define CD_ICMP6_HELP "support for Internet control message protocol v6" diff --git a/src/codecs/ip/cd_igmp.cc b/src/codecs/ip/cd_igmp.cc index 2a1f5deaa..4255e0cc7 100644 --- a/src/codecs/ip/cd_igmp.cc +++ b/src/codecs/ip/cd_igmp.cc @@ -23,8 +23,6 @@ #include "framework/codec.h" #include "codecs/codec_module.h" -#include "protocols/packet.h" -#include "protocols/ipv4_options.h" #define CD_IGMP_NAME "igmp" #define CD_IGMP_HELP "support for Internet group management protocol" diff --git a/src/codecs/ip/cd_ipv4.cc b/src/codecs/ip/cd_ipv4.cc index 78d866804..941d88c66 100644 --- a/src/codecs/ip/cd_ipv4.cc +++ b/src/codecs/ip/cd_ipv4.cc @@ -22,28 +22,20 @@ #include "config.h" #endif -#include -#include - -#include "utils/dnet_header.h" +#include "codecs/codec_module.h" +#include "log/log_text.h" +#include "log/messages.h" #include "main/snort_config.h" - -#include "protocols/tcp.h" -#include "protocols/ipv4.h" -#include "protocols/packet_manager.h" - -#include "utils/stats.h" #include "packet_io/active.h" -#include "codecs/ip/checksum.h" -#include "main/thread.h" -#include "codecs/codec_module.h" +#include "parser/parse_ip.h" #include "protocols/ip.h" +#include "protocols/ipv4.h" #include "protocols/ipv4_options.h" -#include "log/messages.h" -#include "log/text_log.h" -#include "log/log_text.h" +#include "protocols/tcp.h" #include "sfip/sf_ipvar.h" -#include "parser/parse_ip.h" +#include "utils/dnet_header.h" + +#include "checksum.h" #define CD_IPV4_NAME "ipv4" #define CD_IPV4_HELP "support for Internet protocol v4" diff --git a/src/codecs/ip/cd_ipv6.cc b/src/codecs/ip/cd_ipv6.cc index e05f489c4..07242e735 100644 --- a/src/codecs/ip/cd_ipv6.cc +++ b/src/codecs/ip/cd_ipv6.cc @@ -22,18 +22,11 @@ #include "config.h" #endif -#include -#include - -#include "protocols/ipv6.h" #include "codecs/codec_module.h" #include "framework/codec.h" +#include "log/text_log.h" #include "main/snort_config.h" #include "packet_io/active.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet_manager.h" -#include "log/text_log.h" -#include "sfip/sf_ip.h" #define CD_IPV6_NAME "ipv6" #define CD_IPV6_HELP "support for Internet protocol v6" diff --git a/src/codecs/ip/cd_mobility.cc b/src/codecs/ip/cd_mobility.cc index 69460d701..9d9858357 100644 --- a/src/codecs/ip/cd_mobility.cc +++ b/src/codecs/ip/cd_mobility.cc @@ -21,9 +21,9 @@ #include "config.h" #endif +#include "codecs/codec_module.h" #include "framework/codec.h" #include "main/snort_config.h" -#include "codecs/codec_module.h" // yes, macros are necessary. The API and class constructor require different strings. #define CD_MOBILE_NAME "ipv6_mobility" diff --git a/src/codecs/ip/cd_no_next.cc b/src/codecs/ip/cd_no_next.cc index dfe719d37..27b9eedce 100644 --- a/src/codecs/ip/cd_no_next.cc +++ b/src/codecs/ip/cd_no_next.cc @@ -21,9 +21,8 @@ #include "config.h" #endif -#include "framework/codec.h" #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" +#include "framework/codec.h" #include "main/snort_config.h" namespace diff --git a/src/codecs/ip/cd_pgm.cc b/src/codecs/ip/cd_pgm.cc index 83e2be249..5794f2660 100644 --- a/src/codecs/ip/cd_pgm.cc +++ b/src/codecs/ip/cd_pgm.cc @@ -22,10 +22,10 @@ #include "config.h" #endif -#include "framework/codec.h" #include "codecs/codec_module.h" -#include "codecs/ip/checksum.h" -#include "protocols/packet.h" +#include "framework/codec.h" + +#include "checksum.h" namespace { diff --git a/src/codecs/ip/cd_routing.cc b/src/codecs/ip/cd_routing.cc index 06df4e5a6..e44785c56 100644 --- a/src/codecs/ip/cd_routing.cc +++ b/src/codecs/ip/cd_routing.cc @@ -22,11 +22,9 @@ #include "config.h" #endif -#include "framework/codec.h" #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" +#include "framework/codec.h" #include "main/snort_config.h" -#include "protocols/ipv6.h" #define CD_IPV6_ROUTING_NAME "ipv6_routing" #define CD_IPV6_ROUTING_HELP "support for IPv6 routing extension" diff --git a/src/codecs/ip/cd_sun_nd.cc b/src/codecs/ip/cd_sun_nd.cc index bbaa036b1..c3af5c37d 100644 --- a/src/codecs/ip/cd_sun_nd.cc +++ b/src/codecs/ip/cd_sun_nd.cc @@ -21,8 +21,8 @@ #include "config.h" #endif -#include "framework/codec.h" #include "codecs/codec_module.h" +#include "framework/codec.h" namespace { diff --git a/src/codecs/ip/cd_swipe.cc b/src/codecs/ip/cd_swipe.cc index 608f7e067..fd71180e1 100644 --- a/src/codecs/ip/cd_swipe.cc +++ b/src/codecs/ip/cd_swipe.cc @@ -21,8 +21,8 @@ #include "config.h" #endif -#include "framework/codec.h" #include "codecs/codec_module.h" +#include "framework/codec.h" #define CD_SWIPE_NAME "swipe" #define CD_SWIPE_HELP "support for Swipe" diff --git a/src/codecs/ip/cd_tcp.cc b/src/codecs/ip/cd_tcp.cc index 571a704d6..5a646074f 100644 --- a/src/codecs/ip/cd_tcp.cc +++ b/src/codecs/ip/cd_tcp.cc @@ -22,23 +22,19 @@ #include "config.h" #endif -#include "framework/codec.h" #include "codecs/codec_module.h" -#include "codecs/ip/checksum.h" +#include "framework/codec.h" +#include "log/log.h" +#include "log/log_text.h" +#include "main/snort_config.h" +#include "parser/parse_ip.h" #include "protocols/tcp.h" #include "protocols/tcp_options.h" -#include "protocols/ipv6.h" -#include "protocols/packet.h" -#include "packet_io/active.h" -#include "packet_io/sfdaq.h" -#include "parser/parse_ip.h" #include "sfip/sf_ipvar.h" -#include "log/text_log.h" -#include "log/log_text.h" -#include "log/log.h" -#include "protocols/packet_manager.h" #include "utils/util.h" +#include "checksum.h" + #define CD_TCP_NAME "tcp" #define CD_TCP_HELP "support for transmission control protocol" diff --git a/src/codecs/ip/cd_udp.cc b/src/codecs/ip/cd_udp.cc index e42521e35..ca604c585 100644 --- a/src/codecs/ip/cd_udp.cc +++ b/src/codecs/ip/cd_udp.cc @@ -21,25 +21,17 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include "utils/dnet_header.h" #include "codecs/codec_module.h" -#include "protocols/udp.h" -#include "protocols/teredo.h" -#include "protocols/protocol_ids.h" -#include "protocols/icmp4.h" -#include "protocols/ipv4.h" -#include "protocols/protocol_ids.h" -#include "codecs/ip/checksum.h" -#include "log/text_log.h" #include "framework/codec.h" -#include "packet_io/active.h" -#include "parser/config_file.h" +#include "log/text_log.h" #include "main/snort_config.h" -#include "main/snort_debug.h" +#include "protocols/teredo.h" +#include "protocols/udp.h" #include "utils/util.h" +#include "checksum.h" + #define CD_UDP_NAME "udp" #define CD_UDP_HELP "support for user datagram protocol" diff --git a/src/codecs/ip/checksum.h b/src/codecs/ip/checksum.h index 7edebcbb3..a8c8ee42b 100644 --- a/src/codecs/ip/checksum.h +++ b/src/codecs/ip/checksum.h @@ -20,8 +20,6 @@ #ifndef CODECS_CHECKSUM_H #define CODECS_CHECKSUM_H -#include -#include #include #include diff --git a/src/codecs/link/cd_arp.cc b/src/codecs/link/cd_arp.cc index 9d669f347..91d47701f 100644 --- a/src/codecs/link/cd_arp.cc +++ b/src/codecs/link/cd_arp.cc @@ -18,12 +18,13 @@ //-------------------------------------------------------------------------- // cd_arp.cc author Josh Rosenbaum -#include "framework/codec.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" +#include "framework/codec.h" #include "protocols/arp.h" -#include "protocols/packet.h" -#include "log/text_log.h" #define CD_ARP_NAME "arp" #define CD_ARP_HELP "support for address resolution protocol" diff --git a/src/codecs/link/cd_ciscometadata.cc b/src/codecs/link/cd_ciscometadata.cc index 17abcb5d5..33ef1b078 100644 --- a/src/codecs/link/cd_ciscometadata.cc +++ b/src/codecs/link/cd_ciscometadata.cc @@ -17,10 +17,12 @@ //-------------------------------------------------------------------------- // cd_ciscometadata.cc author Bhagya Tholpady -#include "framework/codec.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet.h" +#include "framework/codec.h" #define CD_CISCOMETADATA_NAME "ciscometadata" #define CD_CISCOMETADATA_HELP "support for cisco metadata" diff --git a/src/codecs/link/cd_erspan2.cc b/src/codecs/link/cd_erspan2.cc index 32f62ee91..a7697252f 100644 --- a/src/codecs/link/cd_erspan2.cc +++ b/src/codecs/link/cd_erspan2.cc @@ -17,10 +17,12 @@ //-------------------------------------------------------------------------- // cd_erspan2.cc author Josh Rosenbaum -#include "framework/codec.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet.h" +#include "framework/codec.h" #define CD_ERSPAN2_NAME "erspan2" #define CD_ERSPAN2_HELP "support for encapsulated remote switched port analyzer - type 2" diff --git a/src/codecs/link/cd_erspan3.cc b/src/codecs/link/cd_erspan3.cc index 69cf1c230..f685557cf 100644 --- a/src/codecs/link/cd_erspan3.cc +++ b/src/codecs/link/cd_erspan3.cc @@ -17,11 +17,12 @@ //-------------------------------------------------------------------------- // cd_erspan3.cc author Josh Rosenbaum -#include -#include "framework/codec.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet.h" +#include "framework/codec.h" #define CD_ERSPAN3_NAME "erspan3" #define CD_ERSPAN3_HELP "support for encapsulated remote switched port analyzer - type 3" diff --git a/src/codecs/link/cd_fabricpath.cc b/src/codecs/link/cd_fabricpath.cc index 0b1aed80d..85f5b9bce 100644 --- a/src/codecs/link/cd_fabricpath.cc +++ b/src/codecs/link/cd_fabricpath.cc @@ -17,10 +17,12 @@ //-------------------------------------------------------------------------- // cd_fabricpath.cc author Josh Rosenbaum -#include "framework/codec.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "codecs/codec_module.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet.h" +#include "framework/codec.h" #define CD_FABRICPATH_NAME "fabricpath" #define CD_FABRICPATH_HELP "support for fabricpath" diff --git a/src/codecs/link/cd_mpls.cc b/src/codecs/link/cd_mpls.cc index 059fe39f5..4a60bfed5 100644 --- a/src/codecs/link/cd_mpls.cc +++ b/src/codecs/link/cd_mpls.cc @@ -18,14 +18,14 @@ //-------------------------------------------------------------------------- // cd_mpls.cc author Josh Rosenbaum -#include "framework/codec.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "codecs/codec_module.h" -#include "protocols/mpls.h" -#include "packet_io/active.h" -#include "protocols/protocol_ids.h" -#include "protocols/mpls.h" +#include "flow/flow.h" +#include "framework/codec.h" #include "main/snort_config.h" -#include "log/text_log.h" #include "utils/safec.h" #define CD_MPLS_NAME "mpls" diff --git a/src/codecs/link/cd_ppp_encap.cc b/src/codecs/link/cd_ppp_encap.cc index d9ba8a6f1..dafc9be81 100644 --- a/src/codecs/link/cd_ppp_encap.cc +++ b/src/codecs/link/cd_ppp_encap.cc @@ -23,8 +23,6 @@ #endif #include "framework/codec.h" -#include "protocols/protocol_ids.h" -#include "main/snort_config.h" #include "main/snort_debug.h" #define CD_PPPENCAP_NAME "ppp_encap" diff --git a/src/codecs/link/cd_pppoe.cc b/src/codecs/link/cd_pppoe.cc index 1120202b1..9a1cc8495 100644 --- a/src/codecs/link/cd_pppoe.cc +++ b/src/codecs/link/cd_pppoe.cc @@ -18,11 +18,12 @@ //-------------------------------------------------------------------------- // cd_pppoe.cc author Josh Rosenbaum -#include "framework/codec.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "codecs/codec_module.h" -#include "protocols/packet.h" -#include "protocols/layer.h" -#include "main/snort_debug.h" +#include "framework/codec.h" namespace { diff --git a/src/codecs/link/cd_trans_bridge.cc b/src/codecs/link/cd_trans_bridge.cc index 88f743e1a..7ec4d8714 100644 --- a/src/codecs/link/cd_trans_bridge.cc +++ b/src/codecs/link/cd_trans_bridge.cc @@ -21,12 +21,9 @@ #include "config.h" #endif -#include "framework/codec.h" #include "codecs/codec_module.h" - +#include "framework/codec.h" #include "protocols/eth.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet.h" namespace { diff --git a/src/codecs/link/cd_vlan.cc b/src/codecs/link/cd_vlan.cc index 0c5a9f71b..31768c6a4 100644 --- a/src/codecs/link/cd_vlan.cc +++ b/src/codecs/link/cd_vlan.cc @@ -21,14 +21,10 @@ #include "config.h" #endif -#include "protocols/packet.h" -#include "framework/codec.h" #include "codecs/codec_module.h" -#include "protocols/vlan.h" -#include "protocols/eth.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet_manager.h" +#include "framework/codec.h" #include "log/text_log.h" +#include "protocols/vlan.h" #define CD_VLAN_NAME "vlan" #define CD_VLAN_HELP "support for local area network" diff --git a/src/codecs/misc/cd_default.cc b/src/codecs/misc/cd_default.cc index 12d4f44bb..fa908964f 100644 --- a/src/codecs/misc/cd_default.cc +++ b/src/codecs/misc/cd_default.cc @@ -17,8 +17,11 @@ //-------------------------------------------------------------------------- // cd_default.cc author Josh Rosenbaum +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "framework/codec.h" -#include "protocols/protocol_ids.h" #define CD_DEFAULT_NAME "unknown" #define CD_DEFAULT_HELP "support for unkown protocols" diff --git a/src/codecs/misc/cd_gtp.cc b/src/codecs/misc/cd_gtp.cc index b75f0c351..fa522e68b 100644 --- a/src/codecs/misc/cd_gtp.cc +++ b/src/codecs/misc/cd_gtp.cc @@ -22,12 +22,10 @@ #include "config.h" #endif -#include "main/snort_debug.h" +#include "codecs/codec_module.h" #include "framework/codec.h" -#include "protocols/packet.h" +#include "main/snort_config.h" #include "packet_io/active.h" -#include "protocols/protocol_ids.h" -#include "codecs/codec_module.h" #define CD_GTP_NAME "gtp" #define CD_GTP_HELP "support for general-packet-radio-service tunnelling protocol" diff --git a/src/codecs/misc/cd_icmp4_ip.cc b/src/codecs/misc/cd_icmp4_ip.cc index d71cf62f0..59e7f9510 100644 --- a/src/codecs/misc/cd_icmp4_ip.cc +++ b/src/codecs/misc/cd_icmp4_ip.cc @@ -21,17 +21,14 @@ #include "config.h" #endif +#include "codecs/codec_module.h" #include "framework/codec.h" -#include "protocols/ipv4.h" -#include "protocols/packet.h" -#include "protocols/tcp.h" #include "log/text_log.h" #include "main/snort_config.h" -#include "log/messages.h" -#include "protocols/packet_manager.h" #include "protocols/icmp4.h" +#include "protocols/packet_manager.h" +#include "protocols/tcp.h" #include "protocols/udp.h" -#include "codecs/codec_module.h" namespace { diff --git a/src/codecs/misc/cd_icmp6_ip.cc b/src/codecs/misc/cd_icmp6_ip.cc index b18b121e5..a252b08a7 100644 --- a/src/codecs/misc/cd_icmp6_ip.cc +++ b/src/codecs/misc/cd_icmp6_ip.cc @@ -21,11 +21,8 @@ #include "config.h" #endif -#include "framework/codec.h" -#include "protocols/protocol_ids.h" -#include "protocols/ipv6.h" -#include "protocols/packet.h" #include "codecs/codec_module.h" +#include "framework/codec.h" // yes, macros are necessary. The API and class constructor require different strings. // diff --git a/src/codecs/misc/cd_llc.cc b/src/codecs/misc/cd_llc.cc index 22abad96d..d1738e837 100644 --- a/src/codecs/misc/cd_llc.cc +++ b/src/codecs/misc/cd_llc.cc @@ -21,13 +21,9 @@ #include "config.h" #endif -#include "framework/codec.h" -#include "codecs/codec_module.h" -#include "protocols/packet.h" -#include "framework/module.h" #include "codecs/codec_module.h" +#include "framework/codec.h" #include "log/text_log.h" -#include "protocols/packet_manager.h" #define LLC_NAME "llc" #define LLC_HELP "support for logical link control" diff --git a/src/codecs/misc/cd_teredo.cc b/src/codecs/misc/cd_teredo.cc index c1fccc7dd..4f63390de 100644 --- a/src/codecs/misc/cd_teredo.cc +++ b/src/codecs/misc/cd_teredo.cc @@ -23,11 +23,9 @@ #endif #include "framework/codec.h" +#include "main/snort_config.h" #include "packet_io/active.h" -#include "main/snort_types.h" -#include "protocols/packet.h" #include "protocols/teredo.h" -#include "protocols/protocol_ids.h" #define CD_TEREDO_NAME "teredo" #define CD_TEREDO_HELP "support for teredo" diff --git a/src/codecs/misc/cd_user.cc b/src/codecs/misc/cd_user.cc index de4b235c8..92f93bdb6 100644 --- a/src/codecs/misc/cd_user.cc +++ b/src/codecs/misc/cd_user.cc @@ -21,10 +21,10 @@ #include "config.h" #endif -#include "framework/codec.h" +#include + #include "daqs/daq_user.h" -#include "protocols/packet.h" -#include "sfip/sf_ip.h" +#include "framework/codec.h" #define CD_NAME "user" #define CD_HELP_STR "support for user sessions" diff --git a/src/codecs/root/cd_eth.cc b/src/codecs/root/cd_eth.cc index afb45c4b5..e54760f65 100644 --- a/src/codecs/root/cd_eth.cc +++ b/src/codecs/root/cd_eth.cc @@ -22,16 +22,13 @@ #include "config.h" #endif -extern "C" { #include -} #include "codecs/codec_module.h" #include "framework/codec.h" -#include "protocols/packet.h" +#include "log/text_log.h" #include "protocols/eth.h" #include "protocols/packet_manager.h" -#include "log/text_log.h" #define CD_ETH_NAME "eth" #define CD_ETH_HELP_STR "support for ethernet protocol" diff --git a/src/connectors/connectors.cc b/src/connectors/connectors.cc index cda850530..a632c1663 100644 --- a/src/connectors/connectors.cc +++ b/src/connectors/connectors.cc @@ -16,6 +16,10 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "connectors.h" #include "framework/connector.h" diff --git a/src/connectors/file_connector/file_connector.cc b/src/connectors/file_connector/file_connector.cc index 5d48d6683..21ad14339 100644 --- a/src/connectors/file_connector/file_connector.cc +++ b/src/connectors/file_connector/file_connector.cc @@ -18,25 +18,17 @@ // file_connector.cc author Ed Borgoyn -#include "file_connector.h" - -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "file_connector.h" -#include "file_connector_module.h" -#include "main/snort_types.h" #include "main/snort_debug.h" -#include "main/thread.h" -#include "profiler/profiler.h" -#include "parser/parser.h" +#include "profiler/profiler_defs.h" #include "side_channel/side_channel.h" -#include "framework/connector.h" + +#include "file_connector_module.h" /* Globals ****************************************************************/ diff --git a/src/connectors/file_connector/file_connector.h b/src/connectors/file_connector/file_connector.h index bb07b0799..cd08df8b4 100644 --- a/src/connectors/file_connector/file_connector.h +++ b/src/connectors/file_connector/file_connector.h @@ -23,10 +23,9 @@ #include -#include "file_connector_config.h" #include "framework/connector.h" -#include "main/thread.h" -#include "profiler/profiler.h" + +#include "file_connector_config.h" #define FILE_FORMAT_VERSION (1) diff --git a/src/connectors/file_connector/file_connector_module.cc b/src/connectors/file_connector/file_connector_module.cc index 642383b31..3135be27c 100644 --- a/src/connectors/file_connector/file_connector_module.cc +++ b/src/connectors/file_connector/file_connector_module.cc @@ -18,6 +18,10 @@ // file_connector_module.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_connector_module.h" #include "main/snort_debug.h" diff --git a/src/connectors/file_connector/file_connector_module.h b/src/connectors/file_connector/file_connector_module.h index d2b8974c3..232944cc8 100644 --- a/src/connectors/file_connector/file_connector_module.h +++ b/src/connectors/file_connector/file_connector_module.h @@ -21,9 +21,9 @@ #ifndef FILE_CONNECTOR_MODULE_H #define FILE_CONNECTOR_MODULE_H -#include "file_connector_config.h" #include "framework/module.h" -#include "main/thread.h" + +#include "file_connector_config.h" #define FILE_CONNECTOR_NAME "file_connector" #define FILE_CONNECTOR_HELP "implement the file based connector" diff --git a/src/connectors/file_connector/test/file_connector_module_test.cc b/src/connectors/file_connector/test/file_connector_module_test.cc index eb51caeee..8d1522fd2 100644 --- a/src/connectors/file_connector/test/file_connector_module_test.cc +++ b/src/connectors/file_connector/test/file_connector_module_test.cc @@ -19,6 +19,10 @@ // file_connector_module_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "connectors/file_connector/file_connector_module.h" #include "profiler/profiler.h" diff --git a/src/connectors/file_connector/test/file_connector_test.cc b/src/connectors/file_connector/test/file_connector_test.cc index d39f72322..301d34965 100644 --- a/src/connectors/file_connector/test/file_connector_test.cc +++ b/src/connectors/file_connector/test/file_connector_test.cc @@ -19,6 +19,10 @@ // file_connector_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "connectors/file_connector/file_connector.h" #include "connectors/file_connector/file_connector_module.h" diff --git a/src/connectors/tcp_connector/tcp_connector.cc b/src/connectors/tcp_connector/tcp_connector.cc index fe5672311..37ef5e42f 100644 --- a/src/connectors/tcp_connector/tcp_connector.cc +++ b/src/connectors/tcp_connector/tcp_connector.cc @@ -18,31 +18,23 @@ // tcp_connector.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_connector.h" -#include -#include -#include -#include -#include #include #include +#include +#include -#include -#include -#include -#include - -#include "helpers/ring.h" -#include "tcp_connector_module.h" #include "log/messages.h" -#include "main/snort_types.h" #include "main/snort_debug.h" #include "main/thread.h" -#include "profiler/profiler.h" -#include "parser/parser.h" -#include "side_channel/side_channel.h" -#include "framework/connector.h" +#include "profiler/profiler_defs.h" + +#include "tcp_connector_module.h" /* Globals ****************************************************************/ diff --git a/src/connectors/tcp_connector/tcp_connector.h b/src/connectors/tcp_connector/tcp_connector.h index 8b8535e88..947be7a8b 100644 --- a/src/connectors/tcp_connector/tcp_connector.h +++ b/src/connectors/tcp_connector/tcp_connector.h @@ -21,14 +21,12 @@ #ifndef TCP_CONNECTOR_H #define TCP_CONNECTOR_H -#include #include -#include "tcp_connector_config.h" #include "framework/connector.h" #include "helpers/ring.h" -#include "main/thread.h" -#include "profiler/profiler.h" + +#include "tcp_connector_config.h" #define TCP_FORMAT_VERSION (1) diff --git a/src/connectors/tcp_connector/tcp_connector_module.cc b/src/connectors/tcp_connector/tcp_connector_module.cc index 0526ee125..d6684d1f6 100644 --- a/src/connectors/tcp_connector/tcp_connector_module.cc +++ b/src/connectors/tcp_connector/tcp_connector_module.cc @@ -18,6 +18,10 @@ // tcp_connector_module.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_connector_module.h" #include "main/snort_debug.h" diff --git a/src/connectors/tcp_connector/tcp_connector_module.h b/src/connectors/tcp_connector/tcp_connector_module.h index 1a07dc01d..7d59f5c49 100644 --- a/src/connectors/tcp_connector/tcp_connector_module.h +++ b/src/connectors/tcp_connector/tcp_connector_module.h @@ -21,9 +21,9 @@ #ifndef TCP_CONNECTOR_MODULE_H #define TCP_CONNECTOR_MODULE_H -#include "tcp_connector_config.h" #include "framework/module.h" -#include "main/thread.h" + +#include "tcp_connector_config.h" #define TCP_CONNECTOR_NAME "tcp_connector" #define TCP_CONNECTOR_HELP "implement the tcp stream connector" diff --git a/src/connectors/tcp_connector/test/tcp_connector_module_test.cc b/src/connectors/tcp_connector/test/tcp_connector_module_test.cc index 9685e562a..738ede4fc 100644 --- a/src/connectors/tcp_connector/test/tcp_connector_module_test.cc +++ b/src/connectors/tcp_connector/test/tcp_connector_module_test.cc @@ -19,6 +19,10 @@ // tcp_connector_module_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "connectors/tcp_connector/tcp_connector_module.h" #include "profiler/profiler.h" diff --git a/src/connectors/tcp_connector/test/tcp_connector_test.cc b/src/connectors/tcp_connector/test/tcp_connector_test.cc index cd4048aa7..64b33655f 100644 --- a/src/connectors/tcp_connector/test/tcp_connector_test.cc +++ b/src/connectors/tcp_connector/test/tcp_connector_test.cc @@ -19,12 +19,17 @@ // tcp_connector_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "connectors/tcp_connector/tcp_connector.h" #include "connectors/tcp_connector/tcp_connector_module.h" -#include -#include #include +#include +#include +#include #include "main/snort_debug.h" diff --git a/src/control/idle_processing.cc b/src/control/idle_processing.cc index 8e3cdfe21..6e4b56ebe 100644 --- a/src/control/idle_processing.cc +++ b/src/control/idle_processing.cc @@ -22,12 +22,12 @@ // Allow functions to be registered to be called when packet // processing is idle. -#include "idle_processing.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "idle_processing.h" + #include #ifdef UNIT_TEST diff --git a/src/decompress/file_decomp.cc b/src/decompress/file_decomp.cc index 9382bca62..6c509ecfc 100644 --- a/src/decompress/file_decomp.cc +++ b/src/decompress/file_decomp.cc @@ -18,21 +18,16 @@ // file_decomp.cc author Ed Borgoyn -#include "file_decomp.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef HAVE_LZMA -#include -#endif +#include "file_decomp.h" -#include +#include -#include "main/snort_types.h" -#include "utils/util.h" #include "detection/detection_util.h" +#include "utils/util.h" #include "file_decomp_pdf.h" #include "file_decomp_swf.h" diff --git a/src/decompress/file_decomp.h b/src/decompress/file_decomp.h index 5af2fbb69..60ea88234 100644 --- a/src/decompress/file_decomp.h +++ b/src/decompress/file_decomp.h @@ -23,8 +23,7 @@ // File_Decomp global typedefs (used in child objects) -#include -#include +#include #include "main/snort_types.h" diff --git a/src/decompress/file_decomp_pdf.cc b/src/decompress/file_decomp_pdf.cc index 5891c5360..1cc48cd9d 100644 --- a/src/decompress/file_decomp_pdf.cc +++ b/src/decompress/file_decomp_pdf.cc @@ -18,16 +18,11 @@ // file_decomp_pdf.cc author Ed Borgoyn -#include "file_decomp_pdf.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "file_decomp_pdf.h" #include "main/thread.h" #include "utils/util.h" diff --git a/src/decompress/file_decomp_pdf.h b/src/decompress/file_decomp_pdf.h index 112966128..18594d1f7 100644 --- a/src/decompress/file_decomp_pdf.h +++ b/src/decompress/file_decomp_pdf.h @@ -22,7 +22,6 @@ #ifndef FILE_DECOMP_PDF_H #define FILE_DECOMP_PDF_H -#include #include #include "file_decomp.h" diff --git a/src/decompress/file_decomp_swf.cc b/src/decompress/file_decomp_swf.cc index 5ff79e7f1..394e588dc 100644 --- a/src/decompress/file_decomp_swf.cc +++ b/src/decompress/file_decomp_swf.cc @@ -18,18 +18,11 @@ // file_decomp_swf.cc author Ed Borgoyn -#include "file_decomp_swf.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include - -#ifdef HAVE_LZMA -#include -#endif +#include "file_decomp_swf.h" #include "utils/util.h" diff --git a/src/decompress/file_decomp_swf.h b/src/decompress/file_decomp_swf.h index e29db56da..8e4d4e25e 100644 --- a/src/decompress/file_decomp_swf.h +++ b/src/decompress/file_decomp_swf.h @@ -22,16 +22,10 @@ #ifndef FILE_DECOMP_SWF_H #define FILE_DECOMP_SWF_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - #ifdef HAVE_LZMA #include #endif +#include #include "file_decomp.h" diff --git a/src/detection/CMakeLists.txt b/src/detection/CMakeLists.txt index 782c8816c..4c96503db 100644 --- a/src/detection/CMakeLists.txt +++ b/src/detection/CMakeLists.txt @@ -4,7 +4,6 @@ set (DETECTION_INCLUDES detection_defines.h detection_options.h detection_util.h - pattern_match_data.h rule_option_types.h rules.h signature.h @@ -24,6 +23,7 @@ add_library (detection STATIC fp_detect.h fp_utils.cc fp_utils.h + pattern_match_data.h pcrm.cc pcrm.h service_map.cc diff --git a/src/detection/Makefile.am b/src/detection/Makefile.am index e405d0b4c..1cb2e3c08 100644 --- a/src/detection/Makefile.am +++ b/src/detection/Makefile.am @@ -6,9 +6,7 @@ x_includedir = $(pkgincludedir)/detection x_include_HEADERS = \ detect.h \ detection_defines.h \ -detection_options.h \ detection_util.h \ -pattern_match_data.h \ rule_option_types.h \ rules.h \ signature.h \ @@ -17,6 +15,7 @@ treenodes.h libdetection_a_SOURCES = \ detect.cc \ detection_options.cc \ +detection_options.h \ detection_util.cc \ fp_config.cc \ fp_config.h \ @@ -26,6 +25,7 @@ fp_detect.cc \ fp_detect.h \ fp_utils.cc \ fp_utils.h \ +pattern_match_data.h \ pcrm.cc \ pcrm.h \ service_map.cc \ diff --git a/src/detection/detect.cc b/src/detection/detect.cc index 1b0f1d3ef..d11b5189e 100644 --- a/src/detection/detect.cc +++ b/src/detection/detect.cc @@ -24,22 +24,16 @@ ** */ -#include "detect.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#define FASTPKT - -#include -#include - -#include "detection_defines.h" -#include "fp_detect.h" -#include "tag.h" +#include "detect.h" +#include "events/event.h" #include "latency/packet_latency.h" +#include "main/snort_config.h" +#include "main/snort_debug.h" #include "managers/event_manager.h" #include "managers/inspector_manager.h" #include "packet_io/active.h" @@ -49,6 +43,11 @@ #include "stream/stream.h" #include "utils/stats.h" +#include "detection_defines.h" +#include "fp_detect.h" +#include "tag.h" +#include "treenodes.h" + #define CHECK_SRC_IP 0x01 #define CHECK_DST_IP 0x02 #define INVERSE 0x04 diff --git a/src/detection/detect.h b/src/detection/detect.h index 0e055cfa9..1c1342ae2 100644 --- a/src/detection/detect.h +++ b/src/detection/detect.h @@ -21,19 +21,14 @@ #ifndef DETECT_H #define DETECT_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "protocols/packet.h" #include "detection/rules.h" -#include "detection/treenodes.h" -#include "log/log.h" -#include "events/event.h" +#include "main/snort_types.h" +#include "main/thread.h" +struct Event; struct ProfileStats; +struct RuleFpList; +struct RuleTreeNode; extern THREAD_LOCAL bool do_detect; extern THREAD_LOCAL bool do_detect_content; diff --git a/src/detection/detection_options.cc b/src/detection/detection_options.cc index e3163be5b..627f364f4 100644 --- a/src/detection/detection_options.cc +++ b/src/detection/detection_options.cc @@ -26,36 +26,32 @@ ** detection options only once per pattern match. */ -#include "detection_options.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "detection_defines.h" -#include "detection_util.h" -#include "treenodes.h" -#include "fp_create.h" -#include "fp_detect.h" -#include "pattern_match_data.h" -#include "rules.h" +#include "detection_options.h" -#include "profiler/profiler.h" -#include "utils/util.h" -#include "hash/sfxhash.h" +#include "filters/detection_filter.h" +#include "framework/cursor.h" #include "hash/sfhashfcn.h" -#include "parser/parser.h" +#include "hash/sfxhash.h" #include "ips_options/ips_byte_extract.h" #include "ips_options/ips_flowbits.h" -#include "ips_options/ips_pcre.h" -#include "filters/detection_filter.h" #include "latency/packet_latency.h" +#include "latency/rule_latency_state.h" #include "log/messages.h" +#include "main/snort_config.h" #include "main/thread_config.h" -#include "framework/ips_option.h" -#include "framework/cursor.h" #include "managers/ips_manager.h" +#include "parser/parser.h" +#include "profiler/rule_profiler_defs.h" #include "protocols/packet_manager.h" +#include "utils/util.h" + +#include "detection_defines.h" +#include "fp_detect.h" +#include "pattern_match_data.h" #define HASH_RULE_OPTIONS 16384 #define HASH_RULE_TREE 8192 diff --git a/src/detection/detection_options.h b/src/detection/detection_options.h index ab591bcd2..1a6ded7da 100644 --- a/src/detection/detection_options.h +++ b/src/detection/detection_options.h @@ -31,17 +31,13 @@ // Eval, profiling, and latency data are attached in an array sized per max // packet threads. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include + #include "detection/rule_option_types.h" -#include "main/snort_types.h" -#include "latency/rule_latency_state.h" #include "time/clock_defs.h" struct Packet; +struct RuleLatencyState; struct SFXHASH; typedef int (* eval_func_t)(void* option_data, class Cursor&, Packet*); diff --git a/src/detection/detection_util.cc b/src/detection/detection_util.cc index 482ec572c..bfdbb5f7d 100644 --- a/src/detection/detection_util.cc +++ b/src/detection/detection_util.cc @@ -18,16 +18,19 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "detection_util.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "detection_util.h" -#include "main/snort_config.h" +#include "events/event.h" #include "log/text_log.h" -#include "actions/actions.h" +#include "protocols/packet.h" #include "utils/stats.h" +#include "treenodes.h" + THREAD_LOCAL DataPointer g_file_data; #define LOG_CHARS 16 diff --git a/src/detection/detection_util.h b/src/detection/detection_util.h index dd6c1b6bb..4ea132d46 100644 --- a/src/detection/detection_util.h +++ b/src/detection/detection_util.h @@ -25,13 +25,7 @@ // it provides file and alt data pointers, event trace foo, and // some http stuff. -#include - -#include "main/snort_types.h" #include "main/snort_config.h" -#include "main/snort_debug.h" -#include "detection/detect.h" -#include "protocols/packet.h" #define DECODE_BLEN 65535 diff --git a/src/detection/fp_config.cc b/src/detection/fp_config.cc index 35d2d4df2..a343cb7f7 100644 --- a/src/detection/fp_config.cc +++ b/src/detection/fp_config.cc @@ -23,16 +23,17 @@ ** Marc Norton */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "fp_config.h" -#include -#include -#include +#include +#include -#include "fp_config.h" -#include "framework/mpse.h" -#include "managers/mpse_manager.h" #include "log/messages.h" +#include "managers/mpse_manager.h" FastPatternConfig::FastPatternConfig() { diff --git a/src/detection/fp_create.cc b/src/detection/fp_create.cc index d9b1bbaf6..f887d6c9c 100644 --- a/src/detection/fp_create.cc +++ b/src/detection/fp_create.cc @@ -28,44 +28,31 @@ ** */ -#include "fp_create.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "fp_create.h" -#include "main/snort_config.h" +#include "framework/mpse.h" #include "hash/sfghash.h" -#include "ips_options/ips_flow.h" -#include "utils/util.h" -#include "utils/stats.h" -#include "utils/sflsq.h" -#include "parser/parser.h" +#include "log/messages.h" +#include "main/snort_config.h" +#include "managers/mpse_manager.h" #include "parser/parse_rule.h" +#include "parser/parser.h" #include "ports/port_table.h" -#include "ports/port_utils.h" #include "ports/rule_port_tables.h" -#include "framework/mpse.h" -#include "framework/ips_option.h" -#include "log/messages.h" -#include "managers/mpse_manager.h" -#include "target_based/snort_protocols.h" +#include "utils/stats.h" +#include "utils/util.h" +#include "detection_options.h" #include "fp_config.h" -#include "service_map.h" -#include "rules.h" -#include "treenodes.h" -#include "fp_detect.h" #include "fp_utils.h" -#include "detection_options.h" -#include "detection_defines.h" -#include "sfrim.h" #include "pattern_match_data.h" +#include "pcrm.h" +#include "service_map.h" +#include "treenodes.h" static unsigned mpse_count = 0; static const char* s_group = ""; diff --git a/src/detection/fp_create.h b/src/detection/fp_create.h index e96ca261a..561cf783a 100644 --- a/src/detection/fp_create.h +++ b/src/detection/fp_create.h @@ -27,9 +27,7 @@ // this is where rule groups are compiled and MPSE are instantiated -#include "detection/pcrm.h" #include "ports/port_group.h" -#include "target_based/snort_protocols.h" struct SnortConfig; diff --git a/src/detection/fp_detect.cc b/src/detection/fp_detect.cc index 554cbfa96..121a529e8 100644 --- a/src/detection/fp_detect.cc +++ b/src/detection/fp_detect.cc @@ -34,53 +34,41 @@ ** */ -#include "fp_detect.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - -#include "detect.h" -#include "fp_config.h" -#include "fp_create.h" -#include "service_map.h" -#include "detection_util.h" -#include "detection_options.h" -#include "pattern_match_data.h" -#include "pcrm.h" -#include "tag.h" -#include "rules.h" -#include "treenodes.h" +#include "fp_detect.h" +#include "events/event.h" +#include "filters/rate_filter.h" +#include "filters/sfthreshold.h" +#include "framework/cursor.h" +#include "framework/mpse.h" #include "latency/packet_latency.h" #include "latency/rule_latency.h" #include "log/messages.h" #include "main/snort_config.h" #include "main/snort_debug.h" -#include "framework/cursor.h" -#include "framework/inspector.h" -#include "framework/ips_action.h" -#include "framework/mpse.h" -#include "filters/sfthreshold.h" -#include "filters/rate_filter.h" -#include "events/event_wrapper.h" -#include "packet_io/active.h" -#include "parser/parser.h" -#include "utils/sflsq.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "actions/actions.h" -#include "sfip/sf_ip.h" #include "managers/action_manager.h" +#include "parser/parser.h" +#include "profiler/profiler_defs.h" +#include "protocols/icmp4.h" #include "protocols/packet_manager.h" -#include "protocols/tcp.h" #include "protocols/udp.h" -#include "protocols/icmp4.h" #include "search_engines/pat_stats.h" #include "stream/stream.h" #include "utils/stats.h" +#include "utils/util.h" + +#include "detect.h" +#include "detection_options.h" +#include "detection_util.h" +#include "fp_config.h" +#include "fp_create.h" +#include "pattern_match_data.h" +#include "pcrm.h" +#include "service_map.h" THREAD_LOCAL ProfileStats rulePerfStats; THREAD_LOCAL ProfileStats ruleRTNEvalPerfStats; diff --git a/src/detection/fp_detect.h b/src/detection/fp_detect.h index 957b429d5..ba18ec2b7 100644 --- a/src/detection/fp_detect.h +++ b/src/detection/fp_detect.h @@ -29,19 +29,14 @@ // rule groups are selected based on traffic and any fast pattern // matches trigger rule tree evaluation. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "utils/sflsq.h" +#include "main/thread.h" #define REBUILD_FLAGS (PKT_REBUILT_FRAG | PKT_REBUILT_STREAM) +struct Packet; +struct PortGroup; struct ProfileStats; struct OptTreeNode; -struct PortGroup; extern THREAD_LOCAL ProfileStats rulePerfStats; extern THREAD_LOCAL ProfileStats ruleRTNEvalPerfStats; diff --git a/src/detection/fp_utils.cc b/src/detection/fp_utils.cc index b5841758b..beb7cd524 100644 --- a/src/detection/fp_utils.cc +++ b/src/detection/fp_utils.cc @@ -16,22 +16,25 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "fp_utils.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "fp_utils.h" -#ifdef UNIT_TEST -#include "catch/catch.hpp" -#endif +#include +#include #include "ips_options/ips_flow.h" #include "log/messages.h" +#include "main/thread_config.h" #include "ports/port_group.h" #include "target_based/snort_protocols.h" +#include "utils/util.h" + +#ifdef UNIT_TEST +#include "catch/catch.hpp" +#endif #include "pattern_match_data.h" #include "treenodes.h" diff --git a/src/detection/pattern_match_data.h b/src/detection/pattern_match_data.h index bb784b9c1..707327e64 100644 --- a/src/detection/pattern_match_data.h +++ b/src/detection/pattern_match_data.h @@ -21,16 +21,10 @@ #ifndef PATTERN_MATCH_DATA_H #define PATTERN_MATCH_DATA_H -#include -#include #include #include -#include "detection/treenodes.h" #include "framework/ips_option.h" // FIXIT-L not a good dependency -#include "main/snort_types.h" -#include "main/thread_config.h" -#include "utils/util.h" struct PmdLastCheck { diff --git a/src/detection/pcrm.cc b/src/detection/pcrm.cc index 7378438de..3f4877575 100644 --- a/src/detection/pcrm.cc +++ b/src/detection/pcrm.cc @@ -32,18 +32,17 @@ ** -------------------------------------------------------------------------- */ -#include "pcrm.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "pcrm.h" -#include "fp_config.h" -#include "fp_create.h" -#include "log/messages.h" #include "main/snort_config.h" #include "utils/util.h" +#include "fp_config.h" + PORT_RULE_MAP* prmNewMap() { PORT_RULE_MAP* p = (PORT_RULE_MAP*)snort_calloc(sizeof(PORT_RULE_MAP)); diff --git a/src/detection/pcrm.h b/src/detection/pcrm.h index 76a579ed0..71cf19ec2 100644 --- a/src/detection/pcrm.h +++ b/src/detection/pcrm.h @@ -29,8 +29,8 @@ // runle groups by source and dest ports as well as any // (generic refers to any) -#include "protocols/packet.h" #include "ports/port_group.h" +#include "protocols/packet.h" #define ANYPORT (-1) diff --git a/src/detection/rules.h b/src/detection/rules.h index b1469d089..38da7196d 100644 --- a/src/detection/rules.h +++ b/src/detection/rules.h @@ -24,7 +24,6 @@ // misc rule and rule list support // FIXIT-L refactor this header -#include "main/snort_types.h" #include "actions/actions.h" #define EXCEPT_SRC_IP 0x0001 diff --git a/src/detection/service_map.cc b/src/detection/service_map.cc index f23de8428..be34a2b1c 100644 --- a/src/detection/service_map.cc +++ b/src/detection/service_map.cc @@ -29,16 +29,13 @@ ** */ -#include "service_map.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "service_map.h" + +#include #include "hash/sfghash.h" #include "ips_options/ips_flow.h" diff --git a/src/detection/service_map.h b/src/detection/service_map.h index d23060d13..1158338b8 100644 --- a/src/detection/service_map.h +++ b/src/detection/service_map.h @@ -30,9 +30,9 @@ #include -#include "detection/pcrm.h" #include "target_based/snort_protocols.h" +struct PortGroup; struct SFGHASH; struct SnortConfig; diff --git a/src/detection/sfrim.cc b/src/detection/sfrim.cc index 5a1a914ec..89050844f 100644 --- a/src/detection/sfrim.cc +++ b/src/detection/sfrim.cc @@ -20,16 +20,13 @@ // sfrim.c author Marc Norton // modified to use a vector w/o a hard max -#include "sfrim.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "sfrim.h" +#include #include #ifdef UNIT_TEST diff --git a/src/detection/signature.cc b/src/detection/signature.cc index 71512f941..2427cbef6 100644 --- a/src/detection/signature.cc +++ b/src/detection/signature.cc @@ -18,18 +18,18 @@ //-------------------------------------------------------------------------- // Author(s): Andrew R. Baker -#include "signature.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "signature.h" -#include "utils/util.h" -#include "detection/rules.h" -#include "detection/treenodes.h" -#include "hash/sfghash.h" #include "log/messages.h" -#include "parser/parser.h" #include "main/snort_config.h" +#include "parser/parser.h" +#include "utils/util.h" + +#include "treenodes.h" /********************* Reference Implementation *******************************/ diff --git a/src/detection/signature.h b/src/detection/signature.h index 9940922d4..4f2215c69 100644 --- a/src/detection/signature.h +++ b/src/detection/signature.h @@ -24,10 +24,8 @@ // basic non-detection signature info: gid, sid, rev, class, priority, etc. -#include -#include - -#include "main/snort_types.h" +#include +#include struct SnortConfig; struct OptTreeNode; diff --git a/src/detection/tag.cc b/src/detection/tag.cc index 6819953cc..7a9fb2924 100644 --- a/src/detection/tag.cc +++ b/src/detection/tag.cc @@ -19,26 +19,24 @@ //-------------------------------------------------------------------------- // Chris Green -#include "tag.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include -#include +#include "tag.h" -#include "rules.h" -#include "treenodes.h" +#include "events/event.h" +#include "hash/sfxhash.h" #include "log/messages.h" -#include "main/snort_debug.h" #include "main/snort_config.h" -#include "protocols/packet.h" -#include "utils/util.h" -#include "log/log.h" +#include "main/snort_debug.h" #include "parser/parser.h" -#include "events/event.h" -#include "hash/sfxhash.h" +#include "protocols/packet.h" #include "sfip/sf_ip.h" +#include "utils/cpp_macros.h" +#include "utils/util.h" + +#include "treenodes.h" /* D E F I N E S **************************************************/ #define MAX_TAG_NODES 256 diff --git a/src/detection/treenodes.cc b/src/detection/treenodes.cc index d07ef6277..523f3c84c 100644 --- a/src/detection/treenodes.cc +++ b/src/detection/treenodes.cc @@ -18,15 +18,15 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "treenodes.h" #include "framework/ips_option.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "utils/util.h" -#include "detect.h" - OptFpList* AddOptFuncToList(RuleOptEvalFunc ro_eval_func, OptTreeNode* otn) { OptFpList* ofp = (OptFpList*)snort_calloc(sizeof(OptFpList)); diff --git a/src/detection/treenodes.h b/src/detection/treenodes.h index a74b7bed2..b8f12b987 100644 --- a/src/detection/treenodes.h +++ b/src/detection/treenodes.h @@ -22,14 +22,10 @@ // rule header (RTN) and body (OTN) nodes -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main/snort_types.h" +#include "actions/actions.h" #include "detection/signature.h" #include "detection/rule_option_types.h" -#include "actions/actions.h" +#include "main/snort_types.h" #include "time/clock_defs.h" class IpsOption; diff --git a/src/events/event.cc b/src/events/event.cc index 918494621..a7e73bcb7 100644 --- a/src/events/event.cc +++ b/src/events/event.cc @@ -17,18 +17,14 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "event.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "event.h" -#include "main/snort_config.h" #include "detection/signature.h" +#include "main/snort_config.h" THREAD_LOCAL uint16_t event_id; // FIXIT-M also incremented in fpLogEvent() THREAD_LOCAL SigInfo sig_info; // FIXIT-M move to stack diff --git a/src/events/event.h b/src/events/event.h index 98f294241..9246a4c62 100644 --- a/src/events/event.h +++ b/src/events/event.h @@ -21,9 +21,6 @@ #ifndef EVENT_H #define EVENT_H -#include - -#include "main/snort_types.h" #include "main/thread.h" struct SigInfo; diff --git a/src/events/event_queue.cc b/src/events/event_queue.cc index e85b5a2b2..fe70f7074 100644 --- a/src/events/event_queue.cc +++ b/src/events/event_queue.cc @@ -51,16 +51,21 @@ ** SnortEventqAdd() - only adds events that have an otn ** */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "event_queue.h" -#include "sfeventq.h" -#include "event_wrapper.h" #include "detection/fp_detect.h" -#include "utils/util.h" -#include "utils/stats.h" #include "filters/sfthreshold.h" #include "log/messages.h" #include "parser/parser.h" +#include "utils/stats.h" +#include "utils/util.h" + +#include "sfeventq.h" typedef struct s_SNORT_EVENTQ_USER { diff --git a/src/events/event_queue.h b/src/events/event_queue.h index c196e9f51..f8f1edd98 100644 --- a/src/events/event_queue.h +++ b/src/events/event_queue.h @@ -20,8 +20,8 @@ #ifndef EVENT_QUEUE_H #define EVENT_QUEUE_H -#include "main/snort_types.h" #include "actions/actions.h" +#include "main/snort_types.h" #define SNORT_EVENTQ_PRIORITY 1 #define SNORT_EVENTQ_CONTENT_LEN 2 diff --git a/src/events/event_wrapper.cc b/src/events/event_wrapper.cc index 3437fe6ad..88d8e9cd0 100644 --- a/src/events/event_wrapper.cc +++ b/src/events/event_wrapper.cc @@ -37,18 +37,14 @@ * an event, but the rule controls the alert/drop functionality. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "event_wrapper.h" -#include "detection/rules.h" -#include "detection/treenodes.h" -#include "detection/signature.h" #include "detection/fp_detect.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "parser/parser.h" -#include "events/event.h" -#include "detection/detect.h" -#include "utils/util.h" /* * This function has been updated to find an otn and route the call to fpLogEvent diff --git a/src/events/event_wrapper.h b/src/events/event_wrapper.h index e9a1952b9..97dc80c14 100644 --- a/src/events/event_wrapper.h +++ b/src/events/event_wrapper.h @@ -20,8 +20,7 @@ #ifndef EVENT_WRAPPER_H #define EVENT_WRAPPER_H -#include -#include "main/snort_types.h" +#include uint32_t GenerateSnortEvent(struct Packet* p, uint32_t gen_id, uint32_t sig_id); diff --git a/src/events/sfeventq.cc b/src/events/sfeventq.cc index 899c0a7be..664cad448 100644 --- a/src/events/sfeventq.cc +++ b/src/events/sfeventq.cc @@ -47,13 +47,12 @@ ** number of events to log. */ -#include "sfeventq.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "sfeventq.h" + #include "utils/util.h" /* diff --git a/src/file_api/circular_buffer.cc b/src/file_api/circular_buffer.cc index dff9290e0..2d5b64db1 100644 --- a/src/file_api/circular_buffer.cc +++ b/src/file_api/circular_buffer.cc @@ -30,6 +30,10 @@ ** 5.25.13 - Initial Source Code. Hui Cao */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "circular_buffer.h" #include "utils/util.h" diff --git a/src/file_api/file_cache.cc b/src/file_api/file_cache.cc index 84ee83341..8ee455203 100644 --- a/src/file_api/file_cache.cc +++ b/src/file_api/file_cache.cc @@ -17,8 +17,13 @@ //-------------------------------------------------------------------------- // file_cache.cc author Hui Cao +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_cache.h" +#include "hash/sfxhash.h" #include "log/messages.h" #include "main/snort_config.h" #include "main/snort_debug.h" diff --git a/src/file_api/file_cache.h b/src/file_api/file_cache.h index 22146a31d..23197f82b 100644 --- a/src/file_api/file_cache.h +++ b/src/file_api/file_cache.h @@ -23,12 +23,13 @@ #include -#include "hash/sfxhash.h" #include "sfip/sf_ip.h" #include "utils/cpp_macros.h" #include "file_config.h" +struct SFXHASH; + class FileCache { public: diff --git a/src/file_api/file_capture.cc b/src/file_api/file_capture.cc index 127e353ba..7cb51eef0 100644 --- a/src/file_api/file_capture.cc +++ b/src/file_api/file_capture.cc @@ -24,26 +24,20 @@ ** 5.05.2013 - Initial Source Code. Hui Cao */ -#include "file_capture.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "file_capture.h" + #include -#include -#include -#include -#include -#include -#include "hash/hashes.h" +#include + #include "log/messages.h" -#include "main/snort_config.h" -#include "utils/util.h" #include "utils/stats.h" +#include "utils/util.h" -#include "file_config.h" #include "file_mempool.h" #include "file_stats.h" diff --git a/src/file_api/file_capture.h b/src/file_api/file_capture.h index c023a9325..464b3785d 100644 --- a/src/file_api/file_capture.h +++ b/src/file_api/file_capture.h @@ -93,7 +93,7 @@ public: static FileCaptureState error_capture(FileCaptureState); - static int64_t get_block_size() { return capture_block_size; }; + static int64_t get_block_size() { return capture_block_size; } private: diff --git a/src/file_api/file_config.cc b/src/file_api/file_config.cc index 74b19e441..35d2242ff 100644 --- a/src/file_api/file_config.cc +++ b/src/file_api/file_config.cc @@ -23,12 +23,12 @@ ** 5.25.2012 - Initial Source Code. Hui Cao */ -#include "file_config.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "file_config.h" + #include "main/snort_config.h" #include "managers/inspector_manager.h" #include "parser/parse_utils.h" diff --git a/src/file_api/file_enforcer.cc b/src/file_api/file_enforcer.cc index 536cf0182..d043333b7 100644 --- a/src/file_api/file_enforcer.cc +++ b/src/file_api/file_enforcer.cc @@ -23,6 +23,10 @@ ** 9.25.2012 - Initial Source Code. Hui Cao */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_enforcer.h" #include "log/messages.h" diff --git a/src/file_api/file_flows.cc b/src/file_api/file_flows.cc index 6c1282470..96af7f296 100644 --- a/src/file_api/file_flows.cc +++ b/src/file_api/file_flows.cc @@ -23,12 +23,12 @@ ** 8.15.15 - Initial Source Code. Hui Cao */ -#include "file_flows.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "file_flows.h" + #include "managers/inspector_manager.h" #include "protocols/packet.h" diff --git a/src/file_api/file_identifier.cc b/src/file_api/file_identifier.cc index c5dc73a7c..96fc55d83 100644 --- a/src/file_api/file_identifier.cc +++ b/src/file_api/file_identifier.cc @@ -23,15 +23,14 @@ ** 5.25.2012 - Initial Source Code. Hcao */ -#include "file_identifier.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "file_identifier.h" #include +#include #include "log/messages.h" #include "utils/util.h" diff --git a/src/file_api/file_lib.cc b/src/file_api/file_lib.cc index 6472a42d0..af818d356 100644 --- a/src/file_api/file_lib.cc +++ b/src/file_api/file_lib.cc @@ -23,12 +23,14 @@ ** 5.25.12 - Initial Source Code. Hcao */ -#include "file_lib.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "file_lib.h" + +#include + #include #include diff --git a/src/file_api/file_mempool.cc b/src/file_api/file_mempool.cc index d48330080..a204f073b 100644 --- a/src/file_api/file_mempool.cc +++ b/src/file_api/file_mempool.cc @@ -25,6 +25,10 @@ ** */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_mempool.h" #include "log/messages.h" diff --git a/src/file_api/file_module.cc b/src/file_api/file_module.cc index 3e97c140c..f632e4570 100644 --- a/src/file_api/file_module.cc +++ b/src/file_api/file_module.cc @@ -23,6 +23,10 @@ ** 5.05.2012 - Initial Source Code. Hui Cao */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_module.h" #include "main/snort_config.h" diff --git a/src/file_api/file_policy.cc b/src/file_api/file_policy.cc index 17eafb43c..df9be3df1 100644 --- a/src/file_api/file_policy.cc +++ b/src/file_api/file_policy.cc @@ -18,6 +18,10 @@ // // author Hui Cao +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_policy.h" #include "hash/hashes.h" diff --git a/src/file_api/file_segment.cc b/src/file_api/file_segment.cc index 8e094f39d..cbc61fad5 100644 --- a/src/file_api/file_segment.cc +++ b/src/file_api/file_segment.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // file_segment.cc author Hui Cao +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_segment.h" #include "file_lib.h" diff --git a/src/file_api/file_service.cc b/src/file_api/file_service.cc index ae8a02d2b..ac62f0b84 100644 --- a/src/file_api/file_service.cc +++ b/src/file_api/file_service.cc @@ -23,12 +23,12 @@ ** 5.25.12 - Initial Source Code. Hui Cao */ -#include "file_service.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "file_service.h" + #include "main/snort_config.h" #include "mime/file_mime_process.h" diff --git a/src/file_api/file_stats.cc b/src/file_api/file_stats.cc index 747840061..3b173cdc7 100644 --- a/src/file_api/file_stats.cc +++ b/src/file_api/file_stats.cc @@ -24,12 +24,12 @@ ** 5.25.13 - Initial Source Code. Hui Cao */ -#include "file_stats.h" - #ifdef HAVE_CONFIG_H #include #endif +#include "file_stats.h" + #include "log/messages.h" #include "utils/stats.h" #include "utils/util.h" diff --git a/src/filters/CMakeLists.txt b/src/filters/CMakeLists.txt index fb6cf216d..2ebe27c1f 100644 --- a/src/filters/CMakeLists.txt +++ b/src/filters/CMakeLists.txt @@ -1,8 +1,4 @@ -set (FILTER_INCLUDES - sfrf.h -) - if ( ENABLE_UNIT_TESTS ) set(TEST_FILES sfrf_test.cc @@ -18,13 +14,9 @@ add_library (filter STATIC sfthreshold.cc sfthreshold.h sfrf.cc + sfrf.h sfthd.cc sfthd.h - ${FILTER_INCLUDES} ${TEST_FILES} ) -install(FILES ${FILTER_INCLUDES} - DESTINATION "${INCLUDE_INSTALL_PATH}/filters" -) - diff --git a/src/filters/Makefile.am b/src/filters/Makefile.am index e42ecc7dd..0bc84e3c4 100644 --- a/src/filters/Makefile.am +++ b/src/filters/Makefile.am @@ -1,11 +1,6 @@ noinst_LIBRARIES = libfilter.a -x_includedir = $(pkgincludedir)/filters - -x_include_HEADERS = \ -sfrf.h - libfilter_a_SOURCES = \ detection_filter.cc \ detection_filter.h \ @@ -13,6 +8,7 @@ rate_filter.cc \ rate_filter.h \ sfthreshold.cc \ sfthreshold.h \ +sfrf.h \ sfrf.cc \ sfthd.cc \ sfthd.h diff --git a/src/filters/detection_filter.cc b/src/filters/detection_filter.cc index 6c5e62013..9c59fb137 100644 --- a/src/filters/detection_filter.cc +++ b/src/filters/detection_filter.cc @@ -17,6 +17,10 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detection_filter.h" #include "hash/sfxhash.h" diff --git a/src/filters/rate_filter.cc b/src/filters/rate_filter.cc index bfd3c7fdf..d665f4743 100644 --- a/src/filters/rate_filter.cc +++ b/src/filters/rate_filter.cc @@ -18,15 +18,14 @@ //-------------------------------------------------------------------------- // rate_filter.cc author Dilbagh Chahal - -#include "rate_filter.h" - // rate filter interface for Snort #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "rate_filter.h" + #include "detection/rules.h" #include "detection/treenodes.h" #include "main/snort_config.h" diff --git a/src/filters/sfrf.cc b/src/filters/sfrf.cc index 97173485c..97862ebd6 100644 --- a/src/filters/sfrf.cc +++ b/src/filters/sfrf.cc @@ -20,12 +20,12 @@ // sfrf.cc author Dilbagh Chahal // rate filter implementation for Snort -#include "sfrf.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "sfrf.h" + #include "detection/rules.h" #include "hash/sfghash.h" #include "hash/sfxhash.h" diff --git a/src/filters/sfthd.cc b/src/filters/sfthd.cc index 3ed772d73..d92f2122d 100644 --- a/src/filters/sfthd.cc +++ b/src/filters/sfthd.cc @@ -27,12 +27,14 @@ * Boris Lytochkin found it. */ -#include "sfthd.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "sfthd.h" + +#include + #include "hash/sfghash.h" #include "hash/sfxhash.h" #include "sfip/sf_ipvar.h" diff --git a/src/filters/sfthd.h b/src/filters/sfthd.h index 2b117af5b..c2ed037e2 100644 --- a/src/filters/sfthd.h +++ b/src/filters/sfthd.h @@ -23,10 +23,6 @@ #ifndef SFTHD_H #define SFTHD_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "main/policy.h" #include "sfip/sf_ip.h" #include "utils/cpp_macros.h" diff --git a/src/filters/sfthd_test.cc b/src/filters/sfthd_test.cc index 1de5d0457..a9e4a11e5 100644 --- a/src/filters/sfthd_test.cc +++ b/src/filters/sfthd_test.cc @@ -18,6 +18,10 @@ //-------------------------------------------------------------------------- // sfthd_test.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "catch/catch.hpp" #include "catch/unit_test.h" #include "hash/sfxhash.h" diff --git a/src/filters/sfthreshold.cc b/src/filters/sfthreshold.cc index b3f691c77..cc9e41c8b 100644 --- a/src/filters/sfthreshold.cc +++ b/src/filters/sfthreshold.cc @@ -36,6 +36,11 @@ 2003-11-3: man: cleaned up and added more startup printout. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sfthreshold.h" #include "hash/sfxhash.h" diff --git a/src/flow/CMakeLists.txt b/src/flow/CMakeLists.txt index a1b12a0e3..ef9359595 100644 --- a/src/flow/CMakeLists.txt +++ b/src/flow/CMakeLists.txt @@ -1,6 +1,5 @@ set (FLOW_INCLUDES flow.h - flow_config.h flow_key.h ha.h ha_module.h @@ -13,6 +12,7 @@ add_library (flow STATIC flow.cc flow_cache.cc flow_cache.h + flow_config.h flow_control.cc flow_control.h flow_key.cc diff --git a/src/flow/Makefile.am b/src/flow/Makefile.am index fac496ce5..4bb438c18 100644 --- a/src/flow/Makefile.am +++ b/src/flow/Makefile.am @@ -4,16 +4,14 @@ x_includedir = $(pkgincludedir)/flow x_include_HEADERS = \ flow.h \ -flow_config.h \ -flow_key.h \ -ha.h \ -ha_module.h +flow_key.h libflow_a_SOURCES = \ expect_cache.cc expect_cache.h \ flow.cc \ flow_key.cc \ flow_cache.cc flow_cache.h \ +flow_config.h \ flow_control.cc flow_control.h \ ha.cc ha.h \ ha_module.cc ha_module.h \ diff --git a/src/flow/expect_cache.cc b/src/flow/expect_cache.cc index 35177973b..346524415 100644 --- a/src/flow/expect_cache.cc +++ b/src/flow/expect_cache.cc @@ -17,9 +17,11 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "expect_cache.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "expect_cache.h" #include "hash/zhash.h" #include "packet_io/sfdaq.h" diff --git a/src/flow/expect_cache.h b/src/flow/expect_cache.h index f9c2f66e4..bca7c411d 100644 --- a/src/flow/expect_cache.h +++ b/src/flow/expect_cache.h @@ -61,8 +61,10 @@ // a la FlowCache) //------------------------------------------------------------------------- -#include "flow/flow.h" +#include "flow/flow_key.h" +class Flow; +class FlowData; struct Packet; struct ExpectFlow; struct ExpectNode; diff --git a/src/flow/flow.cc b/src/flow/flow.cc index 9a300ce80..aa3d4b635 100644 --- a/src/flow/flow.cc +++ b/src/flow/flow.cc @@ -17,12 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "flow.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "flow.h" + #include "flow/ha.h" #include "flow/session.h" #include "ips_options/ips_flowbits.h" diff --git a/src/flow/flow.h b/src/flow/flow.h index 911c010d4..1fe7d05d6 100644 --- a/src/flow/flow.h +++ b/src/flow/flow.h @@ -27,11 +27,9 @@ // state. Inspector state is stored in FlowData, and Flow manages a list // of FlowData items. -#include - -#include "flow/flow_key.h" +#include "framework/decode_data.h" #include "framework/inspector.h" -#include "framework/codec.h" +#include "protocols/layer.h" #include "sfip/sf_ip.h" #define SSNFLAG_SEEN_CLIENT 0x00000001 @@ -96,6 +94,7 @@ enum AppProtoIdIndex APP_PROTOID_MAX }; +struct FlowKey; struct Packet; typedef void (* StreamAppDataFree)(void*); diff --git a/src/flow/flow_cache.cc b/src/flow/flow_cache.cc index 4a636627a..758e02c60 100644 --- a/src/flow/flow_cache.cc +++ b/src/flow/flow_cache.cc @@ -18,12 +18,12 @@ //-------------------------------------------------------------------------- // flow_cache.cc author Russ Combs -#include "flow/flow_cache.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "flow/flow_cache.h" + #include "flow/ha.h" #include "hash/zhash.h" #include "helpers/flag_context.h" @@ -33,6 +33,8 @@ #include "time/packet_time.h" #include "utils/stats.h" +#include "flow_key.h" + #define SESSION_CACHE_FLAG_PURGING 0x01 //------------------------------------------------------------------------- diff --git a/src/flow/flow_control.cc b/src/flow/flow_control.cc index 4d11913dc..8fe73fe68 100644 --- a/src/flow/flow_control.cc +++ b/src/flow/flow_control.cc @@ -16,30 +16,27 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "flow_control.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "flow_control.h" #include "detection/detect.h" +#include "main/snort_config.h" +#include "main/snort_debug.h" #include "managers/inspector_manager.h" #include "memory/memory_cap.h" #include "packet_io/active.h" #include "protocols/icmp4.h" -#include "protocols/icmp6.h" #include "protocols/tcp.h" #include "protocols/udp.h" #include "protocols/vlan.h" -#include "sfip/sf_ip.h" #include "stream/stream.h" #include "utils/util.h" #include "expect_cache.h" #include "flow_cache.h" -#include "flow_config.h" #include "session.h" FlowControl::FlowControl() diff --git a/src/flow/flow_key.cc b/src/flow/flow_key.cc index 266ee07b0..14967f317 100644 --- a/src/flow/flow_key.cc +++ b/src/flow/flow_key.cc @@ -18,12 +18,12 @@ //-------------------------------------------------------------------------- // flow_key.cc author Steven Sturges -#include "flow/flow_key.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "flow/flow_key.h" + #include "hash/sfhashfcn.h" #include "main/snort_config.h" #include "protocols/icmp4.h" diff --git a/src/flow/flow_key.h b/src/flow/flow_key.h index 0e30cb114..b8986bbfc 100644 --- a/src/flow/flow_key.h +++ b/src/flow/flow_key.h @@ -23,7 +23,7 @@ // FlowKey is used to store Flows in the caches. the data members are // sequenced to avoid void space. -#include +#include #include "framework/decode_data.h" #include "utils/cpp_macros.h" diff --git a/src/flow/ha.cc b/src/flow/ha.cc index de5d91a14..69c6bf751 100644 --- a/src/flow/ha.cc +++ b/src/flow/ha.cc @@ -17,23 +17,24 @@ //-------------------------------------------------------------------------- // ha.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ha.h" -#include -#include #include -#include "flow.h" -#include "flow_key.h" -#include "ha_module.h" +#include "framework/counts.h" #include "log/messages.h" #include "main/snort_debug.h" -#include "packet_io/sfdaq.h" -#include "profiler/profiler.h" -#include "side_channel/side_channel.h" +#include "profiler/profiler_defs.h" #include "stream/stream.h" #include "time/packet_time.h" +#include "flow.h" +#include "flow_key.h" + static const uint8_t HA_MESSAGE_VERSION = 3; // define message size and content constants. diff --git a/src/flow/ha.h b/src/flow/ha.h index 589a164c0..8156a6d07 100644 --- a/src/flow/ha.h +++ b/src/flow/ha.h @@ -20,14 +20,14 @@ #ifndef HA_H #define HA_H -#include "flow/flow_key.h" -#include "main/snort_types.h" -#include "packet_io/sfdaq.h" +#include + #include "side_channel/side_channel.h" //------------------------------------------------------------------------- class Flow; +struct FlowKey; // The FlowHAHandle is the dynamically allocated index used uniquely identify // the client. Used both in the API and HA messages. diff --git a/src/flow/ha_module.cc b/src/flow/ha_module.cc index b3e95257b..2c7ddb196 100644 --- a/src/flow/ha_module.cc +++ b/src/flow/ha_module.cc @@ -18,14 +18,17 @@ // ha_module.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ha_module.h" #include -#include "ha.h" #include "log/messages.h" -#include "main/snort_debug.h" -#include "main/thread.h" + +#include "ha.h" static const PegInfo ha_pegs[] = { diff --git a/src/flow/ha_module.h b/src/flow/ha_module.h index ed26add2f..237a04438 100644 --- a/src/flow/ha_module.h +++ b/src/flow/ha_module.h @@ -21,8 +21,10 @@ #ifndef HA_MODULE_H #define HA_MODULE_H -#include "main/thread.h" +#include + #include "framework/module.h" +#include "main/thread.h" #define HA_NAME "high_availability" #define HA_HELP "implement flow tracking high availability" diff --git a/src/flow/test/ha_module_test.cc b/src/flow/test/ha_module_test.cc index 684f07ec9..f00ffa997 100644 --- a/src/flow/test/ha_module_test.cc +++ b/src/flow/test/ha_module_test.cc @@ -19,6 +19,10 @@ // ha_module_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "flow/ha.h" #include "flow/ha_module.h" diff --git a/src/flow/test/ha_test.cc b/src/flow/test/ha_test.cc index 71894ec96..163807dda 100644 --- a/src/flow/test/ha_test.cc +++ b/src/flow/test/ha_test.cc @@ -19,9 +19,14 @@ // ha_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "flow/ha.h" #include "flow/flow.h" +#include "flow/flow_key.h" #include "main/snort_debug.h" #include "stream/stream.h" diff --git a/src/framework/base_api.h b/src/framework/base_api.h index edf0b3ddf..0de3386af 100644 --- a/src/framework/base_api.h +++ b/src/framework/base_api.h @@ -25,11 +25,7 @@ // usage fields, it provides module instantiation and release functions, as // well as additional data to help detect mismatched builds etc. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main/snort_types.h" +#include // this is the current version of the base api // must be prefixed to subtype version diff --git a/src/framework/codec.cc b/src/framework/codec.cc index 5931c4646..9862d46ff 100644 --- a/src/framework/codec.cc +++ b/src/framework/codec.cc @@ -17,10 +17,14 @@ //-------------------------------------------------------------------------- // codec.h author Josh Rosenbaum -#include "framework/codec.h" -#include "events/event_queue.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "codec.h" + #include "codecs/codec_module.h" -#include "protocols/ipv6.h" +#include "events/event_queue.h" EncState::EncState(const ip::IpApi& api, EncodeFlags f, IpProtocol pr, uint8_t t, uint16_t data_size) : diff --git a/src/framework/codec.h b/src/framework/codec.h index b0d2feb04..fd138871d 100644 --- a/src/framework/codec.h +++ b/src/framework/codec.h @@ -23,18 +23,10 @@ // Codec is a type of plugin that provides protocol-specific encoding and // decoding. -#include #include -#include -#include // static_assert +#include -#include "main/snort_types.h" #include "framework/base_api.h" - -// unfortunately necessary due to use of Ipapi in struct -#include "protocols/protocol_ids.h" -#include "protocols/ip.h" -#include "protocols/layer.h" #include "framework/decode_data.h" struct TextLog; diff --git a/src/framework/connector.h b/src/framework/connector.h index d72399ff0..a8535a312 100644 --- a/src/framework/connector.h +++ b/src/framework/connector.h @@ -23,11 +23,11 @@ // Connector provides out-of-band communications among packet processing // threads, high-availability partners, and other threads. -#include #include +#include -#include "main/snort_types.h" #include "framework/base_api.h" +#include "main/snort_types.h" // this is the current version of the api #define CONNECTOR_API_VERSION ((BASE_API_VERSION << 16) | 0) diff --git a/src/framework/cursor.cc b/src/framework/cursor.cc index f3f4269f0..e7a839592 100644 --- a/src/framework/cursor.cc +++ b/src/framework/cursor.cc @@ -17,10 +17,13 @@ //-------------------------------------------------------------------------- // cursor.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "cursor.h" + #include "detection/detection_util.h" -#include "framework/inspector.h" -#include "flow/flow.h" #include "protocols/packet.h" Cursor::Cursor(Packet* p) diff --git a/src/framework/cursor.h b/src/framework/cursor.h index 9cd9e1ad4..8b5c7de59 100644 --- a/src/framework/cursor.h +++ b/src/framework/cursor.h @@ -25,9 +25,8 @@ // Cursor provides a formal way of using buffers when doing detection with // IpsOptions. -#include -#include -#include +#include +#include struct Packet; diff --git a/src/framework/data_bus.cc b/src/framework/data_bus.cc index ce3e0a97c..1b7c44849 100644 --- a/src/framework/data_bus.cc +++ b/src/framework/data_bus.cc @@ -17,7 +17,12 @@ //-------------------------------------------------------------------------- // data_bus.cc author Russ Combs -#include "framework/data_bus.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "data_bus.h" + #include "main/policy.h" #include "protocols/packet.h" diff --git a/src/framework/data_bus.h b/src/framework/data_bus.h index d22680e72..c06cf916f 100644 --- a/src/framework/data_bus.h +++ b/src/framework/data_bus.h @@ -31,12 +31,12 @@ #include #include +#include "main/snort_types.h" + // FIXIT-P evaluate perf; focus is on correctness typedef std::vector DataList; typedef std::map DataMap; -#include "main/snort_types.h" - class Flow; struct Packet; diff --git a/src/framework/decode_data.h b/src/framework/decode_data.h index ab8f0b332..ac261a5ab 100644 --- a/src/framework/decode_data.h +++ b/src/framework/decode_data.h @@ -22,11 +22,8 @@ // Captures decode information from Codecs. -#include -#include - -#include "protocols/mpls.h" #include "protocols/ip.h" +#include "protocols/mpls.h" namespace tcp { diff --git a/src/framework/inspector.cc b/src/framework/inspector.cc index 647a8a583..b3f899e9c 100644 --- a/src/framework/inspector.cc +++ b/src/framework/inspector.cc @@ -17,10 +17,11 @@ //-------------------------------------------------------------------------- // inspector.cc author Russ Combs -#include "inspector.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "inspector.h" #include "main/thread_config.h" #include "protocols/packet.h" diff --git a/src/framework/inspector.h b/src/framework/inspector.h index 58086c61a..85fd1cf32 100644 --- a/src/framework/inspector.h +++ b/src/framework/inspector.h @@ -24,9 +24,8 @@ // decoding a packet and detection. There are several types that operate // in different ways. These correspond to Snort 2X preprocessors. -#include "main/snort_types.h" -#include "main/thread.h" #include "framework/base_api.h" +#include "main/thread.h" struct Packet; struct SnortConfig; diff --git a/src/framework/ips_action.h b/src/framework/ips_action.h index 4027672a6..4b12d87d5 100644 --- a/src/framework/ips_action.h +++ b/src/framework/ips_action.h @@ -25,9 +25,9 @@ // These can be used to execute external controls like updating an external // firewall. -#include "main/snort_types.h" -#include "framework/base_api.h" #include "actions/actions.h" +#include "framework/base_api.h" +#include "main/snort_types.h" struct Packet; diff --git a/src/framework/ips_option.cc b/src/framework/ips_option.cc index 599cce7d5..15bc4e1ee 100644 --- a/src/framework/ips_option.cc +++ b/src/framework/ips_option.cc @@ -17,17 +17,14 @@ //-------------------------------------------------------------------------- // ips_option.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ips_option.h" -#include -#include -#include -#include -#include -#include +#include -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "hash/sfhashfcn.h" static const char* s_buffer = nullptr; diff --git a/src/framework/ips_option.h b/src/framework/ips_option.h index ed51f1cba..89693c722 100644 --- a/src/framework/ips_option.h +++ b/src/framework/ips_option.h @@ -23,9 +23,9 @@ // All IPS rule keywords are realized as IpsOptions instantiated when rules // are parsed. -#include "main/snort_types.h" -#include "framework/base_api.h" #include "detection/rule_option_types.h" +#include "framework/base_api.h" +#include "main/snort_types.h" struct Packet; diff --git a/src/framework/logger.h b/src/framework/logger.h index 94a2823b1..6da9c4ad9 100644 --- a/src/framework/logger.h +++ b/src/framework/logger.h @@ -24,10 +24,10 @@ // they reach the Logger. Packets may be logged along with events or as a // result of tagging. -#include "main/snort_types.h" -#include "events/event.h" #include "framework/base_api.h" +#include "main/snort_types.h" +struct Event; struct Packet; // this is the current version of the api diff --git a/src/framework/lua_api.h b/src/framework/lua_api.h index 541e39fe0..5de8b79db 100644 --- a/src/framework/lua_api.h +++ b/src/framework/lua_api.h @@ -24,7 +24,7 @@ #include -#include "framework/base_api.h" +struct BaseApi; class LuaApi { diff --git a/src/framework/module.cc b/src/framework/module.cc index ed142f4c5..cf237e69c 100644 --- a/src/framework/module.cc +++ b/src/framework/module.cc @@ -17,10 +17,11 @@ //-------------------------------------------------------------------------- // module.cc author Russ Combs -#include "module.h" -#include "parameter.h" -#include "utils/stats.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "module.h" static const Parameter defaults[] = { diff --git a/src/framework/module.h b/src/framework/module.h index 2946ec231..341cd0eee 100644 --- a/src/framework/module.h +++ b/src/framework/module.h @@ -41,12 +41,11 @@ #include #include -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "framework/value.h" -#include "framework/parameter.h" #include "framework/counts.h" +#include "framework/parameter.h" +#include "framework/value.h" #include "main/snort_debug.h" +#include "main/snort_types.h" #include "utils/stats.h" using LuaCFunction = int(*)(struct lua_State*); diff --git a/src/framework/mpse.cc b/src/framework/mpse.cc index 356f1f2ed..fad37f09a 100644 --- a/src/framework/mpse.cc +++ b/src/framework/mpse.cc @@ -17,15 +17,13 @@ //-------------------------------------------------------------------------- // mpse.cc author Russ Combs -#include "mpse.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "profiler/profiler.h" +#include "mpse.h" + +#include "profiler/profiler_defs.h" using namespace std; diff --git a/src/framework/mpse.h b/src/framework/mpse.h index 9e7e14bb3..d86cfc057 100644 --- a/src/framework/mpse.h +++ b/src/framework/mpse.h @@ -26,13 +26,9 @@ #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - +#include "framework/base_api.h" #include "main/snort_types.h" #include "main/thread.h" -#include "framework/base_api.h" #include "search_engines/search_common.h" // this is the current version of the api diff --git a/src/framework/parameter.cc b/src/framework/parameter.cc index 7122c3374..696e5fd6c 100644 --- a/src/framework/parameter.cc +++ b/src/framework/parameter.cc @@ -17,20 +17,22 @@ //-------------------------------------------------------------------------- // parameter.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "parameter.h" -#include -#include -#include +#include -#include #include #include #include -#include "value.h" #include "utils/dnet_header.h" +#include "value.h" + using namespace std; static bool valid_bool(Value& v, const char*) diff --git a/src/framework/range.cc b/src/framework/range.cc index f29a0da01..fa0c39c9b 100644 --- a/src/framework/range.cc +++ b/src/framework/range.cc @@ -17,16 +17,15 @@ //-------------------------------------------------------------------------- // range.cc author Russ Combs -#include "framework/range.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "framework/range.h" +#include +#include +#include #include #ifdef UNIT_TEST diff --git a/src/framework/so_rule.h b/src/framework/so_rule.h index 79aa5ed3e..640d8506d 100644 --- a/src/framework/so_rule.h +++ b/src/framework/so_rule.h @@ -25,9 +25,8 @@ // like a text rule except that it can call function hooks. It can also // define its own rule options and any other plugins it may need. -#include "main/snort_types.h" #include "framework/base_api.h" -#include "framework/ips_option.h" +#include "main/snort_types.h" struct Packet; diff --git a/src/framework/value.cc b/src/framework/value.cc index aff043e21..5f9276fab 100644 --- a/src/framework/value.cc +++ b/src/framework/value.cc @@ -17,14 +17,15 @@ //-------------------------------------------------------------------------- // value.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "value.h" -#include -#include -#include -#include +#include -#include "sfip/sf_ip.h" +#include "sfip/sf_cidr.h" #ifdef UNIT_TEST #include "catch/catch.hpp" diff --git a/src/framework/value.h b/src/framework/value.h index afcc2c460..b76079662 100644 --- a/src/framework/value.h +++ b/src/framework/value.h @@ -22,16 +22,14 @@ // Value is used to represent Lua bool, number, and string. -#include - #include -#include +#include -#include "main/snort_types.h" #include "framework/bits.h" #include "framework/parameter.h" -#include "sfip/sf_cidr.h" +#include "main/snort_types.h" +struct SfCidr; struct SfIp; class SO_PUBLIC Value diff --git a/src/hash/CMakeLists.txt b/src/hash/CMakeLists.txt index 961a0d3da..07a2b5de6 100644 --- a/src/hash/CMakeLists.txt +++ b/src/hash/CMakeLists.txt @@ -1,7 +1,6 @@ set (HASH_INCLUDES hashes.h - lru_cache_shared.h sfghash.h sfxhash.h sfhashfcn.h diff --git a/src/hash/Makefile.am b/src/hash/Makefile.am index 653dd6ec3..cfb5f616b 100644 --- a/src/hash/Makefile.am +++ b/src/hash/Makefile.am @@ -5,7 +5,6 @@ x_includedir = $(pkgincludedir)/hash x_include_HEADERS = \ hashes.h \ -lru_cache_shared.h \ sfghash.h \ sfxhash.h \ sfhashfcn.h @@ -13,6 +12,7 @@ sfhashfcn.h libhash_a_SOURCES = \ hashes.cc \ lru_cache_shared.cc \ +lru_cache_shared.h \ sfghash.cc \ sfhashfcn.cc \ sfprimetable.cc sfprimetable.h \ diff --git a/src/hash/hashes.cc b/src/hash/hashes.cc index 422c75b77..ac3358ef6 100644 --- a/src/hash/hashes.cc +++ b/src/hash/hashes.cc @@ -17,8 +17,15 @@ //-------------------------------------------------------------------------- // hashes.h author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hashes.h" +#include +#include + void sha256(const unsigned char* data, size_t size, unsigned char* digest) { SHA256_CTX c; diff --git a/src/hash/hashes.h b/src/hash/hashes.h index d2c1a1718..e45c4e2b5 100644 --- a/src/hash/hashes.h +++ b/src/hash/hashes.h @@ -20,14 +20,6 @@ #ifndef HASHES_H #define HASHES_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - #include "main/snort_types.h" #define MD5_HASH_SIZE 16 diff --git a/src/hash/lru_cache_shared.cc b/src/hash/lru_cache_shared.cc index c1031e42c..fb22fb025 100644 --- a/src/hash/lru_cache_shared.cc +++ b/src/hash/lru_cache_shared.cc @@ -18,6 +18,10 @@ // lru_cache_shared.cc author Steve Chew +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hash/lru_cache_shared.h" const PegInfo lru_cache_shared_peg_names[] = diff --git a/src/hash/sfghash.cc b/src/hash/sfghash.cc index 850e434e1..c84336d23 100644 --- a/src/hash/sfghash.cc +++ b/src/hash/sfghash.cc @@ -51,19 +51,17 @@ * Author: Marc Norton * */ -#include "sfghash.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include +#include "sfghash.h" + +#include #include "utils/util.h" + #include "sfhashfcn.h" #include "sfprimetable.h" diff --git a/src/hash/sfghash.h b/src/hash/sfghash.h index ada6b3f70..0f9fa10da 100644 --- a/src/hash/sfghash.h +++ b/src/hash/sfghash.h @@ -24,10 +24,6 @@ // generic hash table - stores and maps key + data pairs -#include -#include -#include - #include "main/snort_types.h" struct SFHASHFCN; diff --git a/src/hash/sfhashfcn.cc b/src/hash/sfhashfcn.cc index a1958ad2d..f9042d948 100644 --- a/src/hash/sfhashfcn.cc +++ b/src/hash/sfhashfcn.cc @@ -29,9 +29,12 @@ 8/31/2006 - man - changed to use sfprimetable.c */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sfhashfcn.h" -#include "main/snort_types.h" #include "main/snort_config.h" #include "utils/util.h" diff --git a/src/hash/sfhashfcn.h b/src/hash/sfhashfcn.h index cd6287d66..dbfb7c438 100644 --- a/src/hash/sfhashfcn.h +++ b/src/hash/sfhashfcn.h @@ -20,11 +20,6 @@ #ifndef SFHASHFCN_H #define SFHASHFCN_H -#include -#include -#include -#include - #include "main/snort_types.h" #define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) diff --git a/src/hash/sfprimetable.cc b/src/hash/sfprimetable.cc index 1528d84fa..f6430494d 100644 --- a/src/hash/sfprimetable.cc +++ b/src/hash/sfprimetable.cc @@ -26,6 +26,11 @@ * in sfghash, and sfxhash. * */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sfprimetable.h" /* 0-8K, increments=8 */ diff --git a/src/hash/sfxhash.cc b/src/hash/sfxhash.cc index 14095f3c9..c88f2a8db 100644 --- a/src/hash/sfxhash.cc +++ b/src/hash/sfxhash.cc @@ -91,16 +91,10 @@ #include "config.h" #endif -#include -#include -#include +#include "sfxhash.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "utils/util.h" -#include "sfxhash.h" -#include "sfprimetable.h" #include "sfhashfcn.h" /* diff --git a/src/hash/sfxhash.h b/src/hash/sfxhash.h index 7abfe8cf0..f4b683b93 100644 --- a/src/hash/sfxhash.h +++ b/src/hash/sfxhash.h @@ -25,10 +25,6 @@ // generic hash table - stores and maps key + data pairs // (supports memcap and automatic memory recovery when out of memory) -#include -#include -#include - #include "utils/sfmemcap.h" #include "main/snort_types.h" diff --git a/src/hash/test/lru_cache_shared_test.cc b/src/hash/test/lru_cache_shared_test.cc index a3c08c208..3c73e7047 100644 --- a/src/hash/test/lru_cache_shared_test.cc +++ b/src/hash/test/lru_cache_shared_test.cc @@ -19,6 +19,10 @@ // lru_cache_shared_test.cc author Steve Chew // unit tests for LruCacheShared class +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hash/lru_cache_shared.h" #include diff --git a/src/hash/zhash.cc b/src/hash/zhash.cc index 61d54a100..16e6784ed 100644 --- a/src/hash/zhash.cc +++ b/src/hash/zhash.cc @@ -19,13 +19,15 @@ // zhash is based on sfxhash - see sfxhash.cc for details +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "zhash.h" -#include -#include +#include #include "sfhashfcn.h" -#include "utils/util.h" //------------------------------------------------------------------------- // private stuff diff --git a/src/helpers/chunk.cc b/src/helpers/chunk.cc index e37b69d19..7e398a875 100644 --- a/src/helpers/chunk.cc +++ b/src/helpers/chunk.cc @@ -17,15 +17,13 @@ //-------------------------------------------------------------------------- // chunk.cc author Russ Combs -#include "chunk.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "chunk.h" -#include "managers/ips_manager.h" -#include "hash/sfhashfcn.h" #include "log/messages.h" -#include "framework/cursor.h" -#include "profiler/profiler.h" #include "lua/lua.h" #ifdef UNIT_TEST diff --git a/src/helpers/directory.cc b/src/helpers/directory.cc index 17e3e0508..3e2cdae1b 100644 --- a/src/helpers/directory.cc +++ b/src/helpers/directory.cc @@ -17,19 +17,18 @@ //-------------------------------------------------------------------------- // directory.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "directory.h" -#include #include #include -#include -#include -#include #include -#include -#include -using namespace std; +#include +#include Directory::Directory(const char* s, const char* f) { diff --git a/src/helpers/markup.cc b/src/helpers/markup.cc index 160fec35f..ead186128 100644 --- a/src/helpers/markup.cc +++ b/src/helpers/markup.cc @@ -17,8 +17,13 @@ //-------------------------------------------------------------------------- // markup.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "markup.h" -#include + +#include using namespace std; diff --git a/src/helpers/process.cc b/src/helpers/process.cc index 10b115339..6ae085c5b 100644 --- a/src/helpers/process.cc +++ b/src/helpers/process.cc @@ -16,37 +16,30 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "process.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "process.h" -#ifdef HAVE_MALLINFO -#include -#endif +#include -#ifdef HAVE_MALLOC_TRIM +#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_TRIM) #include #endif +#include #include #include "log/messages.h" #include "main.h" -#include "main/thread.h" #include "main/snort.h" #include "main/snort_config.h" -#include "utils/util.h" #include "utils/stats.h" -#include "helpers/markup.h" -#include "helpers/ring.h" -#include "parser/parser.h" +#include "utils/util.h" + +#include "markup.h" +#include "ring.h" using namespace std; diff --git a/src/helpers/process.h b/src/helpers/process.h index 3aa3417d2..3a614a168 100644 --- a/src/helpers/process.h +++ b/src/helpers/process.h @@ -21,9 +21,6 @@ // process oriented services like signal handling, heap info, etc. -#include -#include - enum PigSignal { PIG_SIG_NONE, diff --git a/src/host_tracker/host_cache.cc b/src/host_tracker/host_cache.cc index ff3c7178d..192554fce 100644 --- a/src/host_tracker/host_cache.cc +++ b/src/host_tracker/host_cache.cc @@ -18,11 +18,11 @@ // host_cache.cc author Steve Chew -#include "host_tracker/host_cache.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "main/snort_config.h" -#include "target_based/snort_protocols.h" -#include +#include "host_cache.h" #define LRU_CACHE_INITIAL_SIZE 65535 diff --git a/src/host_tracker/host_cache.h b/src/host_tracker/host_cache.h index b59d17298..9ea80c8e9 100644 --- a/src/host_tracker/host_cache.h +++ b/src/host_tracker/host_cache.h @@ -24,11 +24,10 @@ // The host cache is used to cache information about hosts so that it can // be shared among threads. -#include -#include "host_tracker/host_tracker.h" -#include "hash/lru_cache_shared.h" -#include "main/snort_types.h" +#include +#include "hash/lru_cache_shared.h" +#include "host_tracker/host_tracker.h" struct HostIpKey { diff --git a/src/host_tracker/host_cache_module.cc b/src/host_tracker/host_cache_module.cc index e5b841c36..0bbcf244b 100644 --- a/src/host_tracker/host_cache_module.cc +++ b/src/host_tracker/host_cache_module.cc @@ -18,6 +18,10 @@ // host_cache_module.cc author Steve Chew +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "host_cache_module.h" #include "host_cache.h" diff --git a/src/host_tracker/host_cache_module.h b/src/host_tracker/host_cache_module.h index ed7f5656d..a4969e238 100644 --- a/src/host_tracker/host_cache_module.h +++ b/src/host_tracker/host_cache_module.h @@ -24,7 +24,6 @@ // Loads host cache configuration data. #include "framework/module.h" -#include #define host_cache_help \ "configure hosts" diff --git a/src/host_tracker/host_tracker.cc b/src/host_tracker/host_tracker.cc index 862fb0cd7..2f01e2172 100644 --- a/src/host_tracker/host_tracker.cc +++ b/src/host_tracker/host_tracker.cc @@ -18,7 +18,11 @@ // host_tracker.cc author Steve Chew -#include "host_tracker/host_tracker.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "host_tracker.h" THREAD_LOCAL struct HostTrackerStats host_tracker_stats; diff --git a/src/host_tracker/host_tracker.h b/src/host_tracker/host_tracker.h index 3316a8fdb..c4ccfbfc2 100644 --- a/src/host_tracker/host_tracker.h +++ b/src/host_tracker/host_tracker.h @@ -25,15 +25,14 @@ // configuration or dynamic discovery). It provides a thread-safe API to // set/get the host data. -#include -#include +#include #include #include -#include +#include -#include "sfip/sf_ip.h" #include "framework/counts.h" #include "main/thread.h" +#include "sfip/sf_ip.h" // FIXIT-M For now this emulates the Snort++ attribute table. // Need to add in sfrnaincludes/host_tracker.h data eventually. diff --git a/src/host_tracker/host_tracker_module.cc b/src/host_tracker/host_tracker_module.cc index 61722e1b4..95dc6d775 100644 --- a/src/host_tracker/host_tracker_module.cc +++ b/src/host_tracker/host_tracker_module.cc @@ -18,11 +18,16 @@ // host_tracker_module.cc author Steve Chew +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "host_tracker_module.h" #include "main/snort_config.h" #include "stream/stream.h" #include "target_based/snort_protocols.h" + #include "host_cache.h" const PegInfo host_tracker_pegs[] = diff --git a/src/host_tracker/host_tracker_module.h b/src/host_tracker/host_tracker_module.h index e498250a8..711fb25fb 100644 --- a/src/host_tracker/host_tracker_module.h +++ b/src/host_tracker/host_tracker_module.h @@ -27,9 +27,10 @@ // HostTracker object. May eventually replace old Hosts module with this // one. +#include + #include "framework/module.h" #include "host_tracker/host_tracker.h" -#include #define host_tracker_help \ "configure hosts" diff --git a/src/host_tracker/test/host_cache_module_test.cc b/src/host_tracker/test/host_cache_module_test.cc index 389b56eec..9f3e71f7b 100644 --- a/src/host_tracker/test/host_cache_module_test.cc +++ b/src/host_tracker/test/host_cache_module_test.cc @@ -19,6 +19,10 @@ // host_cache_module_test.cc author Steve Chew // unit tests for the host module APIs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "host_tracker/host_cache_module.h" #include "host_tracker/host_cache.h" diff --git a/src/host_tracker/test/host_cache_test.cc b/src/host_tracker/test/host_cache_test.cc index 44b1778bb..78df94d16 100644 --- a/src/host_tracker/test/host_cache_test.cc +++ b/src/host_tracker/test/host_cache_test.cc @@ -19,6 +19,10 @@ // host_cache_test.cc author Steve Chew // unit tests for the host cache APIs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "host_tracker/host_cache.h" #include diff --git a/src/host_tracker/test/host_tracker_module_test.cc b/src/host_tracker/test/host_tracker_module_test.cc index b3622448c..52f4074d9 100644 --- a/src/host_tracker/test/host_tracker_module_test.cc +++ b/src/host_tracker/test/host_tracker_module_test.cc @@ -19,6 +19,10 @@ // host_tracker_module_test.cc author Steve Chew // unit tests for the host module APIs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "target_based/snort_protocols.h" #include "host_tracker/host_tracker_module.h" #include "host_tracker/host_cache.h" diff --git a/src/host_tracker/test/host_tracker_test.cc b/src/host_tracker/test/host_tracker_test.cc index 60474b76c..b3ab239f8 100644 --- a/src/host_tracker/test/host_tracker_test.cc +++ b/src/host_tracker/test/host_tracker_test.cc @@ -19,6 +19,10 @@ // host_tracker_test.cc author Steve Chew // unit tests for HostTracker class +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "host_tracker/host_tracker.h" #include diff --git a/src/ips_options/asn1_detect.cc b/src/ips_options/asn1_detect.cc index 0f0e4a980..600ff9088 100644 --- a/src/ips_options/asn1_detect.cc +++ b/src/ips_options/asn1_detect.cc @@ -49,21 +49,17 @@ ** the file doc/README.asn1. */ -#include "asn1_detect.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "asn1_detect.h" -#include "asn1_util.h" -#include "main/snort_types.h" #include "main/snort_debug.h" #include "utils/snort_bounds.h" +#include "asn1_util.h" + /* ** NAME ** BitStringOverflow:: diff --git a/src/ips_options/asn1_detect.h b/src/ips_options/asn1_detect.h index e5d3be263..8005e8c52 100644 --- a/src/ips_options/asn1_detect.h +++ b/src/ips_options/asn1_detect.h @@ -20,7 +20,7 @@ #ifndef ASN1_DETECT_H #define ASN1_DETECT_H -#include +#include #define ABS_OFFSET 1 #define REL_OFFSET 2 diff --git a/src/ips_options/asn1_util.cc b/src/ips_options/asn1_util.cc index 4683d5ee1..802df4083 100644 --- a/src/ips_options/asn1_util.cc +++ b/src/ips_options/asn1_util.cc @@ -43,16 +43,10 @@ #include "config.h" #endif -#include -#include -#include -#include -#include +#include "asn1_util.h" -#include "utils/util.h" -#include "ips_options/asn1_util.h" #include "main/snort_config.h" -#include "main/thread.h" +#include "utils/util.h" /* ** Macros diff --git a/src/ips_options/extract.cc b/src/ips_options/extract.cc index 3baa63065..976bacc1a 100644 --- a/src/ips_options/extract.cc +++ b/src/ips_options/extract.cc @@ -19,19 +19,14 @@ // author Chris Green -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include #include "extract.h" -#include "main/snort_debug.h" -#include "utils/util.h" + #include "utils/snort_bounds.h" +#include "utils/util.h" #define TEXTLEN (PARSELEN + 1) diff --git a/src/ips_options/ips_ack.cc b/src/ips_options/ips_ack.cc index 447ed17a9..989609cd8 100644 --- a/src/ips_options/ips_ack.cc +++ b/src/ips_options/ips_ack.cc @@ -17,27 +17,17 @@ //-------------------------------------------------------------------------- // ips_ack.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler_defs.h" +#include "protocols/packet.h" #include "protocols/tcp.h" #define s_name "ack" diff --git a/src/ips_options/ips_asn1.cc b/src/ips_options/ips_asn1.cc index 5a98b1204..ea17b72b9 100644 --- a/src/ips_options/ips_asn1.cc +++ b/src/ips_options/ips_asn1.cc @@ -49,32 +49,20 @@ ** the file doc/README.asn1. */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include "asn1_detect.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "ips_options/asn1_util.h" -#include "hash/sfhashfcn.h" -#include "detection/treenodes.h" -#include "detection/detection_util.h" #include "detection/detection_defines.h" -#include "profiler/profiler.h" #include "framework/cursor.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" + +#include "asn1_detect.h" +#include "asn1_util.h" #define BITSTRING_OPT "bitstring_overflow" #define DOUBLE_OPT "double_overflow" diff --git a/src/ips_options/ips_base64.cc b/src/ips_options/ips_base64.cc index 0e05ed495..b3bd531dd 100644 --- a/src/ips_options/ips_base64.cc +++ b/src/ips_options/ips_base64.cc @@ -19,31 +19,21 @@ /* ips_base64.cc */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "profiler/profiler.h" -#include "utils/util.h" -#include "mime/decode_b64.h" -#include "utils/util_unfold.h" #include "detection/detection_defines.h" #include "detection/detection_util.h" +#include "detection/treenodes.h" +#include "hash/sfhashfcn.h" #include "framework/cursor.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "mime/decode_b64.h" +#include "profiler/profiler.h" +#include "utils/util_unfold.h" static THREAD_LOCAL uint8_t base64_decode_buf[DECODE_BLEN]; static THREAD_LOCAL uint32_t base64_decode_size; diff --git a/src/ips_options/ips_bufferlen.cc b/src/ips_options/ips_bufferlen.cc index 33136ca17..21bb00e7e 100644 --- a/src/ips_options/ips_bufferlen.cc +++ b/src/ips_options/ips_bufferlen.cc @@ -21,19 +21,13 @@ #include "config.h" #endif -#include -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" #include "detection/detection_defines.h" -#include "framework/range.h" -#include "framework/ips_option.h" -#include "framework/inspector.h" #include "framework/cursor.h" +#include "framework/ips_option.h" #include "framework/module.h" +#include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" #define s_name "bufferlen" diff --git a/src/ips_options/ips_byte_extract.cc b/src/ips_options/ips_byte_extract.cc index 1289e6485..d2f8678f4 100644 --- a/src/ips_options/ips_byte_extract.cc +++ b/src/ips_options/ips_byte_extract.cc @@ -18,26 +18,26 @@ //-------------------------------------------------------------------------- // Author: Ryan Jordan -#include "ips_byte_extract.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "extract.h" -#include "log/messages.h" -#include "main/snort_types.h" -#include "parser/parser.h" +#include "ips_byte_extract.h" + #include "detection/detection_defines.h" -#include "detection/detection_util.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" -#include "framework/ips_option.h" +#include "detection/treenodes.h" #include "framework/cursor.h" -#include "framework/parameter.h" +#include "framework/endianness.h" +#include "framework/ips_option.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "protocols/packet.h" +#include "profiler/profiler.h" #include "utils/util.h" +#include "extract.h" + static THREAD_LOCAL ProfileStats byteExtractPerfStats; #define s_name "byte_extract" diff --git a/src/ips_options/ips_byte_extract.h b/src/ips_options/ips_byte_extract.h index 7c327f722..de1267384 100644 --- a/src/ips_options/ips_byte_extract.h +++ b/src/ips_options/ips_byte_extract.h @@ -22,8 +22,6 @@ #ifndef IPS_BYTE_EXTRACT_H #define IPS_BYTE_EXTRACT_H -#include - #include "main/snort_types.h" #define NUM_BYTE_EXTRACT_VARS 2 diff --git a/src/ips_options/ips_byte_jump.cc b/src/ips_options/ips_byte_jump.cc index 243c4a9f1..0a6390eb6 100644 --- a/src/ips_options/ips_byte_jump.cc +++ b/src/ips_options/ips_byte_jump.cc @@ -62,34 +62,22 @@ * */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include - -#include -#include "extract.h" -#include "ips_byte_extract.h" -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" -#include "detection/detection_util.h" #include "framework/cursor.h" +#include "framework/endianness.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" + +#include "extract.h" +#include "ips_byte_extract.h" using namespace std; diff --git a/src/ips_options/ips_byte_test.cc b/src/ips_options/ips_byte_test.cc index ef18a0719..75751196a 100644 --- a/src/ips_options/ips_byte_test.cc +++ b/src/ips_options/ips_byte_test.cc @@ -82,34 +82,22 @@ * 0 if it is not. */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include - -#include -#include "extract.h" -#include "ips_byte_extract.h" -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" -#include "detection/detection_util.h" #include "framework/cursor.h" +#include "framework/endianness.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" + +#include "extract.h" +#include "ips_byte_extract.h" using namespace std; diff --git a/src/ips_options/ips_classtype.cc b/src/ips_options/ips_classtype.cc index 459f76bc3..d02e2f08b 100644 --- a/src/ips_options/ips_classtype.cc +++ b/src/ips_options/ips_classtype.cc @@ -17,23 +17,14 @@ //-------------------------------------------------------------------------- // ips_classtype.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "detection/treenodes.h" -#include "utils/util.h" -#include "detection/detection_defines.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "protocols/packet.h" #define s_name "classtype" diff --git a/src/ips_options/ips_content.cc b/src/ips_options/ips_content.cc index d0875ec31..75a756753 100644 --- a/src/ips_options/ips_content.cc +++ b/src/ips_options/ips_content.cc @@ -22,29 +22,19 @@ #include "config.h" #endif -#include -#ifdef DEBUG_MSGS -# include -#endif - -#include "ips_byte_extract.h" -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "utils/boyer_moore.h" -#include "utils/util.h" -#include "parser/parser.h" -#include "parser/parse_utils.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" -#include "detection/detection_util.h" #include "detection/pattern_match_data.h" #include "framework/cursor.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "parser/parse_utils.h" +#include "profiler/profiler.h" +#include "utils/boyer_moore.h" +#include "utils/util.h" + +#include "ips_byte_extract.h" #define MAX_PATTERN_SIZE 2048 diff --git a/src/ips_options/ips_cvs.cc b/src/ips_options/ips_cvs.cc index 26b75c3e9..795636037 100644 --- a/src/ips_options/ips_cvs.cc +++ b/src/ips_options/ips_cvs.cc @@ -35,28 +35,16 @@ ** */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" static THREAD_LOCAL ProfileStats cvsPerfStats; diff --git a/src/ips_options/ips_dsize.cc b/src/ips_options/ips_dsize.cc index 981434819..da7b4fdfe 100644 --- a/src/ips_options/ips_dsize.cc +++ b/src/ips_options/ips_dsize.cc @@ -17,27 +17,17 @@ //-------------------------------------------------------------------------- // ips_dsize.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #define s_name "dsize" diff --git a/src/ips_options/ips_file_data.cc b/src/ips_options/ips_file_data.cc index d1f050587..ed9b99349 100644 --- a/src/ips_options/ips_file_data.cc +++ b/src/ips_options/ips_file_data.cc @@ -22,19 +22,12 @@ #include "config.h" #endif -#include -#include -#include -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "profiler/profiler.h" #include "detection/detection_defines.h" #include "detection/detection_util.h" #include "framework/cursor.h" #include "framework/ips_option.h" #include "framework/module.h" +#include "profiler/profiler.h" #define s_name "file_data" diff --git a/src/ips_options/ips_file_type.cc b/src/ips_options/ips_file_type.cc index a55a446ed..707b534fd 100644 --- a/src/ips_options/ips_file_type.cc +++ b/src/ips_options/ips_file_type.cc @@ -18,13 +18,17 @@ //-------------------------------------------------------------------------- // ips_file_type.cc author Victor Roemer +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "file_api/file_identifier.h" #include "file_api/file_flows.h" +#include "file_api/file_identifier.h" #include "profiler/profiler.h" #include "protocols/packet.h" diff --git a/src/ips_options/ips_flags.cc b/src/ips_options/ips_flags.cc index 874540db7..46df1f706 100644 --- a/src/ips_options/ips_flags.cc +++ b/src/ips_options/ips_flags.cc @@ -18,29 +18,18 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "protocols/tcp.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" +#include "protocols/tcp.h" #define M_NORMAL 0 #define M_ALL 1 diff --git a/src/ips_options/ips_flow.cc b/src/ips_options/ips_flow.cc index 144027c42..299a25251 100644 --- a/src/ips_options/ips_flow.cc +++ b/src/ips_options/ips_flow.cc @@ -18,30 +18,20 @@ //-------------------------------------------------------------------------- // ips_flow.cc derived from sp_clientserver.c by Martin Roesch -#include "ips_flow.h" - -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" +#include "ips_flow.h" + #include "detection/detection_defines.h" +#include "detection/treenodes.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #include "target_based/snort_protocols.h" #define s_name "flow" diff --git a/src/ips_options/ips_flowbits.cc b/src/ips_options/ips_flowbits.cc index 31564ce1c..7d61559c9 100644 --- a/src/ips_options/ips_flowbits.cc +++ b/src/ips_options/ips_flowbits.cc @@ -35,38 +35,26 @@ ** - Check the value of the bitmask */ -#include "ips_flowbits.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "ips_flowbits.h" -#include #include -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "utils/stats.h" -#include "utils/sflsq.h" -#include "utils/bitop.h" -#include "hash/sfghash.h" -#include "parser/mstring.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfghash.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "parser/mstring.h" +#include "protocols/packet.h" +#include "profiler/profiler.h" +#include "utils/bitop.h" +#include "utils/sflsq.h" +#include "utils/util.h" using namespace std; diff --git a/src/ips_options/ips_fragbits.cc b/src/ips_options/ips_fragbits.cc index 7508d18d4..18fb22a8b 100644 --- a/src/ips_options/ips_fragbits.cc +++ b/src/ips_options/ips_fragbits.cc @@ -44,29 +44,17 @@ * */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" - +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" static THREAD_LOCAL ProfileStats fragBitsPerfStats; diff --git a/src/ips_options/ips_fragoffset.cc b/src/ips_options/ips_fragoffset.cc index fe8f78452..ede8bd5a0 100644 --- a/src/ips_options/ips_fragoffset.cc +++ b/src/ips_options/ips_fragoffset.cc @@ -17,25 +17,17 @@ //-------------------------------------------------------------------------- // ips_fragoffset.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #define s_name "fragoffset" diff --git a/src/ips_options/ips_gid.cc b/src/ips_options/ips_gid.cc index ca620ce87..521835ab8 100644 --- a/src/ips_options/ips_gid.cc +++ b/src/ips_options/ips_gid.cc @@ -17,20 +17,15 @@ //-------------------------------------------------------------------------- // ips_gid.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" +#include "detection/treenodes.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "protocols/packet.h" #define s_name "gid" diff --git a/src/ips_options/ips_hash.cc b/src/ips_options/ips_hash.cc index adcc25b8a..137c79f5e 100644 --- a/src/ips_options/ips_hash.cc +++ b/src/ips_options/ips_hash.cc @@ -20,24 +20,20 @@ #include "config.h" #endif -#include #include -#include +#include -#include "ips_byte_extract.h" -#include "log/messages.h" -#include "main/snort_types.h" -#include "parser/parser.h" -#include "parser/parse_utils.h" -#include "hash/sfhashfcn.h" -#include "hash/hashes.h" +#include "detection/detection_defines.h" #include "framework/cursor.h" #include "framework/ips_option.h" -#include "profiler/profiler.h" -#include "detection/detection_defines.h" -#include "detection/detection_util.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/hashes.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "parser/parse_utils.h" +#include "profiler/profiler.h" + +#include "ips_byte_extract.h" enum HashPsIdx { diff --git a/src/ips_options/ips_icmp_id.cc b/src/ips_options/ips_icmp_id.cc index f57159fa5..bbccac909 100644 --- a/src/ips_options/ips_icmp_id.cc +++ b/src/ips_options/ips_icmp_id.cc @@ -39,24 +39,19 @@ * */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" #include "protocols/icmp4.h" #include "protocols/icmp6.h" +#include "protocols/packet.h" #define s_name "icmp_id" diff --git a/src/ips_options/ips_icmp_seq.cc b/src/ips_options/ips_icmp_seq.cc index afabd2bdd..62aaea261 100644 --- a/src/ips_options/ips_icmp_seq.cc +++ b/src/ips_options/ips_icmp_seq.cc @@ -39,24 +39,19 @@ * */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" -#include "protocols/packet.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" #include "protocols/icmp4.h" #include "protocols/icmp6.h" +#include "protocols/packet.h" #define s_name "icmp_seq" diff --git a/src/ips_options/ips_icode.cc b/src/ips_options/ips_icode.cc index 8cb61f116..18858589f 100644 --- a/src/ips_options/ips_icode.cc +++ b/src/ips_options/ips_icode.cc @@ -17,25 +17,18 @@ //-------------------------------------------------------------------------- // ips_icode.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" #include "protocols/icmp4.h" +#include "protocols/packet.h" #define s_name "icode" diff --git a/src/ips_options/ips_id.cc b/src/ips_options/ips_id.cc index afa83307b..b3278e54f 100644 --- a/src/ips_options/ips_id.cc +++ b/src/ips_options/ips_id.cc @@ -17,22 +17,17 @@ //-------------------------------------------------------------------------- // ips_id.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #define s_name "id" diff --git a/src/ips_options/ips_ip_proto.cc b/src/ips_options/ips_ip_proto.cc index 7f8bd59de..da8c2356b 100644 --- a/src/ips_options/ips_ip_proto.cc +++ b/src/ips_options/ips_ip_proto.cc @@ -21,24 +21,16 @@ #include "config.h" #endif -#include -#include -#include -#include #include -#include "log/messages.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" +#include "utils/util.h" #define s_name "ip_proto" diff --git a/src/ips_options/ips_ipopts.cc b/src/ips_options/ips_ipopts.cc index 9e6ea9c6b..9c609f0eb 100644 --- a/src/ips_options/ips_ipopts.cc +++ b/src/ips_options/ips_ipopts.cc @@ -18,29 +18,17 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "protocols/ipv4.h" -#include "protocols/ipv4_options.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/ipv4_options.h" +#include "protocols/packet.h" #define s_name "ipopts" diff --git a/src/ips_options/ips_isdataat.cc b/src/ips_options/ips_isdataat.cc index d15aaab31..008dda03c 100644 --- a/src/ips_options/ips_isdataat.cc +++ b/src/ips_options/ips_isdataat.cc @@ -33,33 +33,23 @@ * content:"USER"; isdataat:30,relative; content:!"|0a|"; within:30;) */ -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include "ips_byte_extract.h" -#include "log/messages.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "parser/mstring.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "utils/snort_bounds.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" -#include "detection/treenodes.h" +#include + #include "detection/detection_defines.h" -#include "detection/detection_util.h" #include "framework/cursor.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "parser/mstring.h" +#include "profiler/profiler.h" +#include "utils/snort_bounds.h" + +#include "ips_byte_extract.h" #define s_name "isdataat" diff --git a/src/ips_options/ips_itype.cc b/src/ips_options/ips_itype.cc index 4ef4e6adc..2cc903002 100644 --- a/src/ips_options/ips_itype.cc +++ b/src/ips_options/ips_itype.cc @@ -21,17 +21,14 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" #include "protocols/icmp4.h" +#include "protocols/packet.h" #define s_name "itype" diff --git a/src/ips_options/ips_luajit.cc b/src/ips_options/ips_luajit.cc index 8fd50e718..5180dc827 100644 --- a/src/ips_options/ips_luajit.cc +++ b/src/ips_options/ips_luajit.cc @@ -17,27 +17,24 @@ //-------------------------------------------------------------------------- // ips_luajit.cc author Russ Combs -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "main/snort_types.h" -#include "main/thread.h" -#include "main/thread_config.h" +#include "detection/detection_defines.h" +#include "framework/cursor.h" +#include "framework/decode_data.h" +#include "framework/module.h" +#include "hash/sfhashfcn.h" #include "helpers/chunk.h" #include "lua/lua.h" +#include "log/messages.h" +#include "main/thread_config.h" #include "managers/ips_manager.h" #include "managers/lua_plugin_defs.h" #include "managers/plugin_manager.h" #include "managers/script_manager.h" -#include "hash/sfhashfcn.h" -#include "parser/parser.h" -#include "framework/cursor.h" -#include "framework/decode_data.h" -#include "framework/module.h" -#include "framework/parameter.h" -#include "log/messages.h" #include "profiler/profiler.h" -#include "detection/detection_defines.h" #include "utils/util.h" static THREAD_LOCAL ProfileStats luaIpsPerfStats; diff --git a/src/ips_options/ips_msg.cc b/src/ips_options/ips_msg.cc index de505984e..c123c9a91 100644 --- a/src/ips_options/ips_msg.cc +++ b/src/ips_options/ips_msg.cc @@ -17,23 +17,16 @@ //-------------------------------------------------------------------------- // ips_msg.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" +#include "detection/treenodes.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "utils/util.h" -#include "protocols/packet.h" #define s_name "msg" diff --git a/src/ips_options/ips_options.cc b/src/ips_options/ips_options.cc index f7d7b0340..13d2fbb0e 100644 --- a/src/ips_options/ips_options.cc +++ b/src/ips_options/ips_options.cc @@ -17,13 +17,12 @@ //-------------------------------------------------------------------------- // ips_options.cc author Russ Combs -#include "ips_options.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "framework/ips_option.h" +#include "ips_options.h" + #include "managers/plugin_manager.h" extern const BaseApi* ips_byte_extract; diff --git a/src/ips_options/ips_pcre.cc b/src/ips_options/ips_pcre.cc index 24848867c..b2f2c8125 100644 --- a/src/ips_options/ips_pcre.cc +++ b/src/ips_options/ips_pcre.cc @@ -19,31 +19,25 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "ips_pcre.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "ips_pcre.h" + #include -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "main/snort_config.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" -#include "detection/treenodes.h" +#include + #include "detection/detection_defines.h" -#include "detection/detection_util.h" #include "framework/cursor.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "main/snort_config.h" +#include "profiler/profiler.h" +#include "utils/util.h" #ifndef PCRE_STUDY_JIT_COMPILE #define PCRE_STUDY_JIT_COMPILE 0 diff --git a/src/ips_options/ips_pkt_data.cc b/src/ips_options/ips_pkt_data.cc index 1cd078d3e..1b70daef1 100644 --- a/src/ips_options/ips_pkt_data.cc +++ b/src/ips_options/ips_pkt_data.cc @@ -21,14 +21,12 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" +#include "detection/detection_defines.h" #include "framework/cursor.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "detection/detection_defines.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #define s_name "pkt_data" diff --git a/src/ips_options/ips_priority.cc b/src/ips_options/ips_priority.cc index 701e9f4ce..57f8e92dd 100644 --- a/src/ips_options/ips_priority.cc +++ b/src/ips_options/ips_priority.cc @@ -17,20 +17,15 @@ //-------------------------------------------------------------------------- // ips_priority.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" +#include "detection/treenodes.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "protocols/packet.h" #define s_name "priority" diff --git a/src/ips_options/ips_raw_data.cc b/src/ips_options/ips_raw_data.cc index 91da11d25..1dcdd18d8 100644 --- a/src/ips_options/ips_raw_data.cc +++ b/src/ips_options/ips_raw_data.cc @@ -21,15 +21,12 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" #include "detection/detection_defines.h" -#include "detection/detection_util.h" #include "framework/cursor.h" #include "framework/ips_option.h" #include "framework/module.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #define s_name "raw_data" diff --git a/src/ips_options/ips_regex.cc b/src/ips_options/ips_regex.cc index cacc7383f..b7a0e9435 100644 --- a/src/ips_options/ips_regex.cc +++ b/src/ips_options/ips_regex.cc @@ -19,25 +19,25 @@ // ips_regex.cc author Russ Combs // FIXIT-M add ! and anchor support like pcre and update retry -#include "ips_regex.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "ips_regex.h" #include #include +#include + +#include "detection/detection_defines.h" +#include "detection/pattern_match_data.h" #include "framework/cursor.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "detection/detection_defines.h" -#include "detection/pattern_match_data.h" #include "hash/sfhashfcn.h" #include "log/messages.h" #include "main/snort_config.h" -#include "main/thread.h" -#include "parser/parser.h" #include "profiler/profiler.h" #define s_name "regex" diff --git a/src/ips_options/ips_rem.cc b/src/ips_options/ips_rem.cc index 7ad89dcdb..ec7417d11 100644 --- a/src/ips_options/ips_rem.cc +++ b/src/ips_options/ips_rem.cc @@ -17,19 +17,14 @@ //-------------------------------------------------------------------------- // ips_rem.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "detection/detection_defines.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "protocols/packet.h" #define s_name "rem" diff --git a/src/ips_options/ips_replace.cc b/src/ips_options/ips_replace.cc index 209727ba0..3a970d383 100644 --- a/src/ips_options/ips_replace.cc +++ b/src/ips_options/ips_replace.cc @@ -22,26 +22,20 @@ #include "config.h" #endif -#include -#include - -#include "log/messages.h" -#include "main/snort_config.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "main/thread_config.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "parser/parse_utils.h" -#include "packet_io/sfdaq.h" +#include "actions/act_replace.h" +#include "detection/detection_defines.h" +#include "detection/treenodes.h" #include "framework/cursor.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "detection/detection_defines.h" -#include "actions/act_replace.h" #include "hash/sfhashfcn.h" +#include "log/messages.h" +#include "main/snort_config.h" +#include "main/thread_config.h" +#include "packet_io/sfdaq.h" +#include "parser/parse_utils.h" #include "profiler/profiler.h" +#include "protocols/packet.h" using namespace std; diff --git a/src/ips_options/ips_rev.cc b/src/ips_options/ips_rev.cc index c568e5101..678db62fd 100644 --- a/src/ips_options/ips_rev.cc +++ b/src/ips_options/ips_rev.cc @@ -21,14 +21,11 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" +#include "detection/treenodes.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "protocols/packet.h" #define s_name "rev" diff --git a/src/ips_options/ips_rpc.cc b/src/ips_options/ips_rpc.cc index 2976c1e83..4b48a2bce 100644 --- a/src/ips_options/ips_rpc.cc +++ b/src/ips_options/ips_rpc.cc @@ -22,21 +22,12 @@ #include "config.h" #endif -#include -#include -#include - -#include "protocols/packet.h" -#include "parser/parser.h" -#include "main/snort_debug.h" -#include "utils/util.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #define s_name "rpc" diff --git a/src/ips_options/ips_sd_pattern.cc b/src/ips_options/ips_sd_pattern.cc index 390a0f28a..e7d196517 100644 --- a/src/ips_options/ips_sd_pattern.cc +++ b/src/ips_options/ips_sd_pattern.cc @@ -18,26 +18,24 @@ // ips_sd_pattern.cc author Victor Roemer -#include "ips_sd_pattern.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "ips_sd_pattern.h" #include #include +#include "detection/detection_defines.h" +#include "detection/pattern_match_data.h" #include "framework/cursor.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "detection/detection_defines.h" -#include "detection/pattern_match_data.h" #include "hash/sfhashfcn.h" #include "log/messages.h" #include "log/obfuscator.h" #include "main/snort_config.h" -#include "main/thread.h" -#include "parser/parser.h" #include "profiler/profiler.h" #include "protocols/packet.h" diff --git a/src/ips_options/ips_seq.cc b/src/ips_options/ips_seq.cc index 9fd166906..6d3bd8656 100644 --- a/src/ips_options/ips_seq.cc +++ b/src/ips_options/ips_seq.cc @@ -21,15 +21,12 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" #include "protocols/packet.h" #include "protocols/tcp.h" diff --git a/src/ips_options/ips_session.cc b/src/ips_options/ips_session.cc index d85512ec2..3de1327d5 100644 --- a/src/ips_options/ips_session.cc +++ b/src/ips_options/ips_session.cc @@ -45,28 +45,17 @@ #include "config.h" #endif -#include -#include -#include -#include -#include #include -#include - +#include "detection/detection_defines.h" +#include "framework/ips_option.h" +#include "framework/module.h" +#include "hash/sfhashfcn.h" #include "log/messages.h" #include "main/snort_config.h" +#include "profiler/profiler.h" #include "protocols/packet.h" -#include "main/snort_debug.h" #include "utils/util.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" -#include "detection/detection_defines.h" -#include "detection/treenodes.h" -#include "framework/ips_option.h" -#include "framework/parameter.h" -#include "framework/module.h" -#include "sfip/sf_ip.h" #define s_name "session" diff --git a/src/ips_options/ips_sid.cc b/src/ips_options/ips_sid.cc index 9db9dd17e..c224984be 100644 --- a/src/ips_options/ips_sid.cc +++ b/src/ips_options/ips_sid.cc @@ -21,14 +21,11 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" +#include "detection/treenodes.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "protocols/packet.h" #define s_name "sid" diff --git a/src/ips_options/ips_so.cc b/src/ips_options/ips_so.cc index 9cc900105..92eb1fe50 100644 --- a/src/ips_options/ips_so.cc +++ b/src/ips_options/ips_so.cc @@ -17,21 +17,17 @@ //-------------------------------------------------------------------------- // ips_so.cc author Russ Combs -#include "framework/so_rule.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - -#include "framework/parameter.h" +#include "detection/treenodes.h" +#include "framework/ips_option.h" #include "framework/module.h" -#include "main/thread.h" -#include "managers/so_manager.h" +#include "framework/so_rule.h" #include "hash/sfhashfcn.h" #include "log/messages.h" -#include "detection/treenodes.h" +#include "managers/so_manager.h" #include "profiler/profiler.h" using namespace std; diff --git a/src/ips_options/ips_soid.cc b/src/ips_options/ips_soid.cc index ca7af2c42..07385eb5d 100644 --- a/src/ips_options/ips_soid.cc +++ b/src/ips_options/ips_soid.cc @@ -17,22 +17,15 @@ //-------------------------------------------------------------------------- // ips_soid.cc author Russ Combs -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" #include "detection/detection_defines.h" +#include "detection/treenodes.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "protocols/packet.h" #include "utils/util.h" #define s_name "soid" diff --git a/src/ips_options/ips_tag.cc b/src/ips_options/ips_tag.cc index d0f5166d9..0219f05ac 100644 --- a/src/ips_options/ips_tag.cc +++ b/src/ips_options/ips_tag.cc @@ -18,20 +18,15 @@ // ips_tag.cc author Russ Combs // FIXIT-L add TagOption::eval() instead of special case -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/treenodes.h" #include "detection/tag.h" +#include "detection/treenodes.h" +#include "framework/decode_data.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" -#include "protocols/packet.h" #include "utils/util.h" #define s_name "tag" diff --git a/src/ips_options/ips_tos.cc b/src/ips_options/ips_tos.cc index 36d933a7b..02e5654b4 100644 --- a/src/ips_options/ips_tos.cc +++ b/src/ips_options/ips_tos.cc @@ -21,15 +21,13 @@ #include "config.h" #endif -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #define s_name "tos" diff --git a/src/ips_options/ips_ttl.cc b/src/ips_options/ips_ttl.cc index 69a0e4cd2..fbcd69e03 100644 --- a/src/ips_options/ips_ttl.cc +++ b/src/ips_options/ips_ttl.cc @@ -21,16 +21,13 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "hash/sfhashfcn.h" -#include "profiler/profiler.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #define s_name "ttl" diff --git a/src/ips_options/ips_window.cc b/src/ips_options/ips_window.cc index b49f66609..2e7ae01b6 100644 --- a/src/ips_options/ips_window.cc +++ b/src/ips_options/ips_window.cc @@ -21,16 +21,13 @@ #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "hash/sfhashfcn.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" -#include "framework/parameter.h" #include "framework/module.h" #include "framework/range.h" +#include "hash/sfhashfcn.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #include "protocols/tcp.h" #define s_name "window" diff --git a/src/ips_options/sd_credit_card.cc b/src/ips_options/sd_credit_card.cc index 02d17494f..d9a5a82b0 100644 --- a/src/ips_options/sd_credit_card.cc +++ b/src/ips_options/sd_credit_card.cc @@ -19,10 +19,13 @@ // sd_credit_card.cc author Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sd_credit_card.h" -#include -#include +#include #define ISSUER_SIZE 4 #define CC_COPY_BUF_LEN 20 /* 16 digits + 3 spaces/dashes + null */ @@ -31,7 +34,7 @@ /* Check the Issuer Identification Number of a CC#. */ static inline int CheckIssuers(const uint8_t *cardnum, uint32_t buflen) { - if (cardnum == NULL || buflen < ISSUER_SIZE) + if (cardnum == nullptr || buflen < ISSUER_SIZE) return 0; /* Visa */ @@ -67,7 +70,7 @@ int SdLuhnAlgorithm(const uint8_t *buf, unsigned long long buflen) char cc_digits[CC_COPY_BUF_LEN]; /* Normalized CC# string */ uint32_t j; - if (buf == NULL || buflen < MIN_CC_BUF_LEN) + if (buf == nullptr || buflen < MIN_CC_BUF_LEN) return 0; /* Generally, the buffer has two non-digits, one on either side. Sometimes, diff --git a/src/ips_options/sd_credit_card.h b/src/ips_options/sd_credit_card.h index 1a0bca04d..841d002df 100644 --- a/src/ips_options/sd_credit_card.h +++ b/src/ips_options/sd_credit_card.h @@ -22,7 +22,7 @@ #ifndef SD_CREDIT_CARD_H #define SD_CREDIT_CARD_H -#include +#include int SdLuhnAlgorithm(const uint8_t *buf, unsigned long long buflen); diff --git a/src/ips_options/test/ips_regex_test.cc b/src/ips_options/test/ips_regex_test.cc index 0fc3256b7..3d0738eb6 100644 --- a/src/ips_options/test/ips_regex_test.cc +++ b/src/ips_options/test/ips_regex_test.cc @@ -18,6 +18,10 @@ // ips_regex_test.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ips_options/ips_regex.h" #include "framework/base_api.h" diff --git a/src/latency/CMakeLists.txt b/src/latency/CMakeLists.txt index 343a5a6c6..4f833fe08 100644 --- a/src/latency/CMakeLists.txt +++ b/src/latency/CMakeLists.txt @@ -1,19 +1,20 @@ -set ( LATENCY_INCLUDES - packet_latency.h - rule_latency.h - latency_rules.h - ) set ( LATENCY_SOURCES + latency_config.h + latency_rules.h + latency_stats.h latency_timer.h latency_util.h + latency_module.h + latency_module.cc + packet_latency.h packet_latency.cc + packet_latency_config.h + rule_latency_config.h + rule_latency_state.h + rule_latency.h rule_latency.cc - latency_module.cc ) add_library ( latency STATIC ${LATENCY_SOURCES} ) -install ( FILES ${LATENCY_INCLUDES} - DESTINATION "${INCLUDE_INSTALL_PATH}/latency" -) diff --git a/src/latency/Makefile.am b/src/latency/Makefile.am index a3f799f76..46cbd1d98 100644 --- a/src/latency/Makefile.am +++ b/src/latency/Makefile.am @@ -1,10 +1,5 @@ noinst_LIBRARIES = liblatency.a -x_includedir = $(pkgincludedir)/latency - -x_include_HEADERS = \ -latency_rules.h - liblatency_a_SOURCES = \ latency_config.h \ latency_rules.h \ @@ -13,9 +8,9 @@ latency_timer.h \ latency_util.h \ latency_module.h \ latency_module.cc \ -packet_latency_config.h \ packet_latency.h \ packet_latency.cc \ +packet_latency_config.h \ rule_latency_config.h \ rule_latency_state.h \ rule_latency.h \ diff --git a/src/latency/latency_module.cc b/src/latency/latency_module.cc index 3bbf21bfa..cdf30661e 100644 --- a/src/latency/latency_module.cc +++ b/src/latency/latency_module.cc @@ -18,14 +18,19 @@ // latency_module.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "latency_module.h" #include #include "main/snort_config.h" + #include "latency_config.h" -#include "latency_stats.h" #include "latency_rules.h" +#include "latency_stats.h" // ----------------------------------------------------------------------------- // latency attributes diff --git a/src/latency/packet_latency.cc b/src/latency/packet_latency.cc index f8d8bfbec..b9cb49673 100644 --- a/src/latency/packet_latency.cc +++ b/src/latency/packet_latency.cc @@ -18,29 +18,22 @@ // packet_latency.cc author Joel Cornett -#include "packet_latency.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "packet_latency.h" #include "log/messages.h" #include "main/snort_config.h" -#include "main/thread.h" #include "protocols/packet.h" -#include "sfip/sf_ip.h" -#include "time/clock_defs.h" #include "utils/stats.h" #include "latency_config.h" +#include "latency_rules.h" +#include "latency_stats.h" #include "latency_timer.h" #include "latency_util.h" -#include "latency_stats.h" -#include "latency_rules.h" - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #ifdef UNIT_TEST #include "catch/catch.hpp" diff --git a/src/latency/packet_latency.h b/src/latency/packet_latency.h index 6685ebc5f..504b3bf8f 100644 --- a/src/latency/packet_latency.h +++ b/src/latency/packet_latency.h @@ -21,8 +21,6 @@ #ifndef PACKET_LATENCY_H #define PACKET_LATENCY_H -#include - struct Packet; class PacketLatency diff --git a/src/latency/rule_latency.cc b/src/latency/rule_latency.cc index 3c0917707..d43744240 100644 --- a/src/latency/rule_latency.cc +++ b/src/latency/rule_latency.cc @@ -18,23 +18,17 @@ // rule_latency.cc author Joel Cornett -#include "rule_latency.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "rule_latency.h" #include "detection/detection_options.h" #include "detection/treenodes.h" -#include "events/event_queue.h" -#include "log/messages.h" #include "main/snort_config.h" +#include "log/messages.h" #include "protocols/packet.h" -#include "sfip/sf_ip.h" #include "utils/stats.h" #include "latency_config.h" @@ -42,6 +36,7 @@ #include "latency_stats.h" #include "latency_timer.h" #include "latency_util.h" +#include "rule_latency_state.h" #ifdef UNIT_TEST #include "catch/catch.hpp" diff --git a/src/latency/rule_latency_config.h b/src/latency/rule_latency_config.h index ed18ffb74..fdea53f4d 100644 --- a/src/latency/rule_latency_config.h +++ b/src/latency/rule_latency_config.h @@ -21,7 +21,6 @@ #ifndef RULE_LATENCY_CONFIG_H #define RULE_LATENCY_CONFIG_H -#include #include "time/clock_defs.h" struct RuleLatencyConfig diff --git a/src/log/CMakeLists.txt b/src/log/CMakeLists.txt index 7ceb5ec16..066cb2ca6 100644 --- a/src/log/CMakeLists.txt +++ b/src/log/CMakeLists.txt @@ -1,8 +1,6 @@ set (LOG_INCLUDES - log.h messages.h - obfuscator.h text_log.h unified2.h ) @@ -10,10 +8,12 @@ set (LOG_INCLUDES add_library ( log STATIC ${LOG_INCLUDES} log.cc + log.h log_text.cc log_text.h messages.cc obfuscator.cc + obfuscator.h text_log.cc ) diff --git a/src/log/Makefile.am b/src/log/Makefile.am index d2289aa61..4f7a27a30 100644 --- a/src/log/Makefile.am +++ b/src/log/Makefile.am @@ -4,18 +4,18 @@ noinst_LIBRARIES = liblog.a x_includedir = $(pkgincludedir)/log x_include_HEADERS = \ -log.h \ messages.h \ -obfuscator.h \ text_log.h \ unified2.h liblog_a_SOURCES = \ log.cc \ +log.h \ log_text.cc \ log_text.h \ messages.cc \ obfuscator.cc \ +obfuscator.h \ text_log.cc if ENABLE_UNIT_TESTS diff --git a/src/log/log.cc b/src/log/log.cc index 8cc6b0d98..05533eae7 100644 --- a/src/log/log.cc +++ b/src/log/log.cc @@ -18,23 +18,16 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "log.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include +#include "log.h" -#include #include #include "main/snort_debug.h" -#include "main/snort_config.h" +#include "protocols/packet.h" #include "protocols/tcp.h" #include "utils/util.h" diff --git a/src/log/log.h b/src/log/log.h index 810f3adfe..62d8c4dcf 100644 --- a/src/log/log.h +++ b/src/log/log.h @@ -21,9 +21,11 @@ #ifndef LOG_H #define LOG_H -#include "protocols/packet.h" +#include + #include "main/snort_types.h" +struct Packet; namespace tcp { struct TCPHdr; } SO_PUBLIC void CreateTCPFlagString(const tcp::TCPHdr* const, char*); diff --git a/src/log/log_text.cc b/src/log/log_text.cc index 12dae1bc3..566038235 100644 --- a/src/log/log_text.cc +++ b/src/log/log_text.cc @@ -20,18 +20,17 @@ // @file log_text.c // @author Russ Combs -#include "log_text.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -extern "C" { +#include "log_text.h" + #include -} #include "detection/detection_util.h" -#include "log/messages.h" +#include "detection/signature.h" +#include "events/event.h" #include "main/snort_config.h" #include "packet_io/sfdaq.h" #include "protocols/eth.h" @@ -46,8 +45,8 @@ extern "C" { #include "utils/util_net.h" #include "log.h" +#include "messages.h" #include "obfuscator.h" -#include "text_log.h" /*-------------------------------------------------------------------- * utility functions diff --git a/src/log/messages.cc b/src/log/messages.cc index 2eb74647c..50f59a6cd 100644 --- a/src/log/messages.cc +++ b/src/log/messages.cc @@ -17,38 +17,20 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "log/messages.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "messages.h" -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include #include "main/snort_config.h" -#include "main/snort_debug.h" -#include "packet_io/sfdaq.h" #include "parser/parser.h" #include "time/packet_time.h" -#include "time/timersub.h" -#include "sfip/sf_ip.h" #include "utils/util.h" #ifdef UNIT_TEST diff --git a/src/log/messages.h b/src/log/messages.h index 3a09ff7d7..89aef8e77 100644 --- a/src/log/messages.h +++ b/src/log/messages.h @@ -21,14 +21,11 @@ #ifndef MESSAGES_H #define MESSAGES_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include +#include #include "main/snort_types.h" -#include - #define LOG_DIV "--------------------------------------------------" #ifndef __GNUC__ diff --git a/src/log/obfuscator.cc b/src/log/obfuscator.cc index cb9af4f24..4b2f11e19 100644 --- a/src/log/obfuscator.cc +++ b/src/log/obfuscator.cc @@ -18,6 +18,10 @@ // obfuscate.h author Victor Roemer +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "obfuscator.h" bool Obfuscator::first(ObfuscatorBlock &b) diff --git a/src/log/obfuscator.h b/src/log/obfuscator.h index f303a14cc..46f225c49 100644 --- a/src/log/obfuscator.h +++ b/src/log/obfuscator.h @@ -21,8 +21,8 @@ #ifndef OBFUSCATOR_H #define OBFUSCATOR_H -#include -#include +#include +#include #include struct ObfuscatorBlock diff --git a/src/log/test/obfuscator_test.cc b/src/log/test/obfuscator_test.cc index ee5efc7ce..ea1160509 100644 --- a/src/log/test/obfuscator_test.cc +++ b/src/log/test/obfuscator_test.cc @@ -18,6 +18,10 @@ // obfuscator_test.cc author Victor Roemer +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "../obfuscator.h" #include diff --git a/src/log/text_log.cc b/src/log/text_log.cc index aa933031f..ee1addaf0 100644 --- a/src/log/text_log.cc +++ b/src/log/text_log.cc @@ -25,18 +25,20 @@ * @brief implements buffered text stream for logging */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "text_log.h" -#include -#include -#include -#include #include -#include "log.h" -#include "main/snort_types.h" +#include + #include "utils/util.h" +#include "log.h" + /* some reasonable minimums */ #define MIN_BUF (1* K_BYTES) #define MIN_FILE (MIN_BUF) diff --git a/src/log/text_log.h b/src/log/text_log.h index bd8c15963..b66bbdef7 100644 --- a/src/log/text_log.h +++ b/src/log/text_log.h @@ -34,9 +34,7 @@ * name plus a timestamp. */ -#include -#include -#include +#include #include "main/snort_types.h" diff --git a/src/log/unified2.h b/src/log/unified2.h index fac1640da..5f3418ae1 100644 --- a/src/log/unified2.h +++ b/src/log/unified2.h @@ -21,14 +21,6 @@ #ifndef UNIFIED2_H #define UNIFIED2_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#if defined(__linux__) -#include -#endif #include #include "protocols/protocol_ids.h" diff --git a/src/loggers/alert_csv.cc b/src/loggers/alert_csv.cc index e7f35f603..ed7fa1cde 100644 --- a/src/loggers/alert_csv.cc +++ b/src/loggers/alert_csv.cc @@ -28,31 +28,20 @@ #include "config.h" #endif -#include -#include -#include -#include - -#include -#include - -#include "main/snort_debug.h" +#include "detection/signature.h" +#include "events/event.h" #include "framework/logger.h" #include "framework/module.h" -#include "detection/signature.h" -#include "utils/util.h" -#include "utils/stats.h" #include "log/log.h" -#include "log/text_log.h" #include "log/log_text.h" -#include "protocols/packet.h" -#include "protocols/tcp.h" -#include "protocols/udp.h" -#include "protocols/icmp4.h" -#include "protocols/icmp6.h" -#include "protocols/eth.h" +#include "log/text_log.h" #include "packet_io/active.h" #include "packet_io/sfdaq.h" +#include "protocols/eth.h" +#include "protocols/icmp4.h" +#include "protocols/tcp.h" +#include "protocols/udp.h" +#include "utils/stats.h" using namespace std; diff --git a/src/loggers/alert_fast.cc b/src/loggers/alert_fast.cc index e62741a53..feb2b45ba 100644 --- a/src/loggers/alert_fast.cc +++ b/src/loggers/alert_fast.cc @@ -37,26 +37,16 @@ #include "config.h" #endif -#include -#include -#include -#include - -#include - -#include "main/snort_debug.h" -#include "main/snort_config.h" +#include "detection/signature.h" +#include "events/event.h" #include "framework/logger.h" #include "framework/module.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "log/text_log.h" #include "log/log_text.h" +#include "log/text_log.h" +#include "main/snort_config.h" #include "packet_io/active.h" -#include "packet_io/sfdaq.h" #include "packet_io/intf.h" -#include "events/event.h" +#include "packet_io/sfdaq.h" using namespace std; diff --git a/src/loggers/alert_full.cc b/src/loggers/alert_full.cc index b5e411984..c2df1c4db 100644 --- a/src/loggers/alert_full.cc +++ b/src/loggers/alert_full.cc @@ -37,24 +37,16 @@ #include "config.h" #endif -#include -#include - -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "main/snort_config.h" +#include "detection/signature.h" +#include "events/event.h" #include "framework/logger.h" #include "framework/module.h" -#include "events/event.h" -#include "protocols/packet.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "log/text_log.h" #include "log/log_text.h" -#include "packet_io/sfdaq.h" +#include "log/text_log.h" +#include "main/snort_config.h" #include "packet_io/intf.h" +#include "packet_io/sfdaq.h" +#include "protocols/packet.h" using namespace std; diff --git a/src/loggers/alert_luajit.cc b/src/loggers/alert_luajit.cc index 1287f1a0d..2d0593ac5 100644 --- a/src/loggers/alert_luajit.cc +++ b/src/loggers/alert_luajit.cc @@ -17,29 +17,23 @@ //-------------------------------------------------------------------------- // alert_luajit.cc author Russ Combs -#include -#include // FIXIT-W Returning null reference (somewhere below) -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "main/snort_types.h" -#include "main/thread_config.h" +#include "detection/signature.h" #include "events/event.h" +#include "framework/logger.h" +#include "framework/module.h" #include "helpers/chunk.h" #include "log/messages.h" #include "lua/lua.h" -#include "managers/event_manager.h" +#include "main/thread_config.h" #include "managers/lua_plugin_defs.h" -#include "managers/module_manager.h" #include "managers/plugin_manager.h" #include "managers/script_manager.h" -#include "hash/sfhashfcn.h" -#include "parser/parser.h" +#include "profiler/profiler_defs.h" #include "protocols/packet.h" -#include "framework/logger.h" -#include "framework/module.h" -#include "framework/parameter.h" -#include "profiler/profiler.h" -#include "utils/stats.h" static THREAD_LOCAL ProfileStats luaLogPerfStats; diff --git a/src/loggers/alert_sf_socket.cc b/src/loggers/alert_sf_socket.cc index 96daa14a6..e8a2cd312 100644 --- a/src/loggers/alert_sf_socket.cc +++ b/src/loggers/alert_sf_socket.cc @@ -19,31 +19,22 @@ /* We use some Linux only socket capabilities */ -#include -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef __linux__ + #include #include -#include -#include - -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" +#include "detection/treenodes.h" +#include "events/event.h" #include "framework/logger.h" #include "framework/module.h" #include "log/messages.h" +#include "main/snort_config.h" #include "managers/event_manager.h" -#include "detection/rules.h" -#include "detection/treenodes.h" -#include "events/event.h" -#include "hash/sfghash.h" #include "parser/parser.h" #include "protocols/packet.h" #include "target_based/snort_protocols.h" diff --git a/src/loggers/alert_syslog.cc b/src/loggers/alert_syslog.cc index a64bc948a..9f0f5b596 100644 --- a/src/loggers/alert_syslog.cc +++ b/src/loggers/alert_syslog.cc @@ -22,27 +22,19 @@ #include "config.h" #endif -#include #include -#include -#include - -#include "log/messages.h" -#include "main/snort_debug.h" -#include "main/snort_config.h" +#include "detection/signature.h" +#include "events/event.h" #include "framework/logger.h" #include "framework/module.h" +#include "log/messages.h" +#include "main/snort_config.h" +#include "packet_io/intf.h" +#include "packet_io/sfdaq.h" #include "protocols/packet.h" -#include "detection/detect.h" -#include "detection/rules.h" -#include "detection/treenodes.h" -#include "events/event.h" -#include "parser/parser.h" #include "utils/util.h" #include "utils/util_net.h" -#include "packet_io/sfdaq.h" -#include "packet_io/intf.h" using namespace std; diff --git a/src/loggers/log_codecs.cc b/src/loggers/log_codecs.cc index 66b9ef610..dab0a5d8c 100644 --- a/src/loggers/log_codecs.cc +++ b/src/loggers/log_codecs.cc @@ -22,22 +22,14 @@ #include "config.h" #endif -#include -#include - -#include -#include - -#include "main/snort_types.h" -#include "main/snort_config.h" +#include "detection/signature.h" +#include "events/event.h" #include "framework/logger.h" #include "framework/module.h" -#include "protocols/packet.h" -#include "protocols/packet_manager.h" -#include "detection/signature.h" -#include "log/text_log.h" #include "log/log_text.h" -#include "utils/stats.h" +#include "log/text_log.h" +#include "main/snort_config.h" +#include "protocols/packet_manager.h" static THREAD_LOCAL TextLog* test_file = nullptr; diff --git a/src/loggers/log_hext.cc b/src/loggers/log_hext.cc index 658c7d765..906d982e4 100644 --- a/src/loggers/log_hext.cc +++ b/src/loggers/log_hext.cc @@ -22,19 +22,10 @@ #include "config.h" #endif -#include -#include - -#include -#include -#include - -#include "main/snort_types.h" #include "framework/logger.h" #include "framework/module.h" -#include "protocols/packet.h" #include "log/text_log.h" -#include "sfip/sf_ip.h" +#include "protocols/packet.h" using namespace std; diff --git a/src/loggers/log_pcap.cc b/src/loggers/log_pcap.cc index 4c7c69f8d..b212d0100 100644 --- a/src/loggers/log_pcap.cc +++ b/src/loggers/log_pcap.cc @@ -22,32 +22,15 @@ #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include #include -extern "C" { -#include -} - -#include - -#include "log/messages.h" -#include "main/snort_debug.h" -#include "main/snort_config.h" #include "framework/logger.h" #include "framework/module.h" +#include "log/messages.h" +#include "main/snort_config.h" #include "protocols/packet.h" -#include "events/event.h" -#include "parser/parser.h" #include "packet_io/sfdaq.h" #include "utils/util.h" -#include "utils/stats.h" using namespace std; diff --git a/src/loggers/loggers.cc b/src/loggers/loggers.cc index e3a9e7d25..16656bf8e 100644 --- a/src/loggers/loggers.cc +++ b/src/loggers/loggers.cc @@ -17,13 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "loggers.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "framework/logger.h" +#include "loggers.h" + #include "managers/plugin_manager.h" // to ensure PacketManager::log_protocols() is built into Snort++ diff --git a/src/loggers/unified2.cc b/src/loggers/unified2.cc index a93641a2f..97cc97418 100644 --- a/src/loggers/unified2.cc +++ b/src/loggers/unified2.cc @@ -25,40 +25,24 @@ * */ -#include "log/unified2.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include - -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "main/snort_config.h" -#include "framework/logger.h" -#include "framework/module.h" -#include "protocols/packet.h" -#include "detection/rules.h" -#include "detection/treenodes.h" +#include "detection/signature.h" #include "detection/detection_util.h" -#include "detection/detect.h" -#include "parser/parser.h" #include "events/event.h" +#include "framework/logger.h" +#include "framework/module.h" #include "log/messages.h" #include "log/obfuscator.h" +#include "log/unified2.h" +#include "main/snort_config.h" #include "packet_io/active.h" #include "packet_io/sfdaq.h" -#include "protocols/layer.h" -#include "protocols/vlan.h" #include "protocols/icmp4.h" +#include "protocols/packet.h" +#include "protocols/vlan.h" #include "stream/stream.h" #include "utils/safec.h" #include "utils/util.h" diff --git a/src/lua/lua.cc b/src/lua/lua.cc index 780f61841..6816fd974 100644 --- a/src/lua/lua.cc +++ b/src/lua/lua.cc @@ -17,13 +17,14 @@ //-------------------------------------------------------------------------- // lua.cc author Joel Cornett -#include "lua.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "lua.h" + +#include +#include namespace Lua { @@ -66,8 +67,3 @@ ManageStack::~ManageStack() } } -#ifdef UNIT_TEST -// FIXIT-L Catch issue; see sfip/sf_ip.cc -#include "lua_stack_test.cc" -#endif - diff --git a/src/lua/lua.h b/src/lua/lua.h index d9bb96d60..b1aa6f2a2 100644 --- a/src/lua/lua.h +++ b/src/lua/lua.h @@ -22,7 +22,6 @@ // methods and templates for the C++ / LuaJIT interface -#include #include #include "main/snort_types.h" diff --git a/src/lua/lua_arg.h b/src/lua/lua_arg.h index bd418fc4e..95ce00ffa 100644 --- a/src/lua/lua_arg.h +++ b/src/lua/lua_arg.h @@ -20,8 +20,6 @@ #ifndef LUA_ARG_H #define LUA_ARG_H -#include - #include "lua_stack.h" namespace Lua diff --git a/src/lua/lua_iface.h b/src/lua/lua_iface.h index 74199aa55..9aded7a4e 100644 --- a/src/lua/lua_iface.h +++ b/src/lua/lua_iface.h @@ -21,7 +21,6 @@ #define LUA_IFACE_H #include -#include #include "lua.h" #include "lua_ref.h" diff --git a/src/lua/lua_ref.cc b/src/lua/lua_ref.cc index f0ae2e70c..c0e2ba275 100644 --- a/src/lua/lua_ref.cc +++ b/src/lua/lua_ref.cc @@ -17,9 +17,11 @@ //-------------------------------------------------------------------------- // lua_ref.cc author Joel Cornett -#include "lua_ref.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "lua_ref.h" #include "lua.h" diff --git a/src/lua/lua_stack.h b/src/lua/lua_stack.h index f951e1d96..76d2c1486 100644 --- a/src/lua/lua_stack.h +++ b/src/lua/lua_stack.h @@ -20,10 +20,10 @@ #ifndef LUA_STACK_H #define LUA_STACK_H -#include -#include #include +#include + namespace Lua { template diff --git a/src/lua/lua_stack_test.cc b/src/lua/lua_stack_test.cc index b32d6a638..473981cbf 100644 --- a/src/lua/lua_stack_test.cc +++ b/src/lua/lua_stack_test.cc @@ -17,14 +17,21 @@ //-------------------------------------------------------------------------- // lua_stack_test.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include #include -#include #include "catch/catch.hpp" +#include "catch/unit_test.h" #include "lua_test_common.h" #include "lua/lua_stack.h" +SNORT_CATCH_FORCED_INCLUSION_DEFINITION(lua_stack_test); + static lua_State* L = nullptr; static void test_signed() diff --git a/src/lua/lua_table.h b/src/lua/lua_table.h index 38a153591..9460cde34 100644 --- a/src/lua/lua_table.h +++ b/src/lua/lua_table.h @@ -21,7 +21,6 @@ #define LUA_TABLE_H #include -#include #include "lua_stack.h" diff --git a/src/lua/lua_test_common.h b/src/lua/lua_test_common.h index f3e5a863b..1ac327b93 100644 --- a/src/lua/lua_test_common.h +++ b/src/lua/lua_test_common.h @@ -21,8 +21,7 @@ #ifndef LUA_TEST_COMMON_H #define LUA_TEST_COMMON_H -#include -#include +//#include #include inline void l_end_lua_state(lua_State*& L_ptr) diff --git a/src/lua/lua_util.cc b/src/lua/lua_util.cc index bf67fb31c..26799335e 100644 --- a/src/lua/lua_util.cc +++ b/src/lua/lua_util.cc @@ -17,9 +17,11 @@ //-------------------------------------------------------------------------- // lua_util.cc author Joel Cornett -#include "lua_util.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "lua_util.h" #define LUA_MSG_BUFSIZE 128 diff --git a/src/lua/lua_util.h b/src/lua/lua_util.h index 0bbfbc6bd..7f9517386 100644 --- a/src/lua/lua_util.h +++ b/src/lua/lua_util.h @@ -20,7 +20,6 @@ #ifndef LUA_UTIL_H #define LUA_UTIL_H -#include #include #include diff --git a/src/main.cc b/src/main.cc index b10489b56..42d6d94fd 100644 --- a/src/main.cc +++ b/src/main.cc @@ -17,32 +17,21 @@ //-------------------------------------------------------------------------- // main.cc author Russ Combs -#include "main.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef SHELL -#include -#include -#endif +#include "main.h" -#include -#include #include +#include "control/idle_processing.h" +#include "framework/module.h" +#include "helpers/process.h" #include "helpers/ring.h" +#include "helpers/swapper.h" #include "log/messages.h" +#include "lua/lua.h" #include "main/analyzer.h" #include "main/shell.h" #include "main/snort.h" @@ -50,23 +39,15 @@ #include "main/snort_debug.h" #include "main/snort_module.h" #include "main/thread_config.h" -#include "framework/module.h" +#include "managers/inspector_manager.h" #include "managers/module_manager.h" #include "managers/plugin_manager.h" -#include "managers/inspector_manager.h" #include "memory/memory_cap.h" -#include "utils/util.h" -#include "parser/parser.h" -#include "packet_io/trough.h" -#include "packet_io/intf.h" #include "packet_io/sfdaq.h" -#include "control/idle_processing.h" +#include "packet_io/trough.h" #include "target_based/sftarget_reader.h" -#include "flow/flow_control.h" -#include "lua/lua.h" -#include "helpers/process.h" -#include "helpers/swapper.h" #include "time/periodic.h" +#include "utils/util.h" #include "utils/safec.h" #ifdef UNIT_TEST diff --git a/src/main.h b/src/main.h index 3e48b8dd0..500a1b44e 100644 --- a/src/main.h +++ b/src/main.h @@ -21,10 +21,6 @@ #ifndef MAIN_H #define MAIN_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - struct lua_State; const char* get_prompt(); diff --git a/src/main/analyzer.cc b/src/main/analyzer.cc index f4e5b2e85..f05947b71 100644 --- a/src/main/analyzer.cc +++ b/src/main/analyzer.cc @@ -18,19 +18,22 @@ //-------------------------------------------------------------------------- // analyzer.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "analyzer.h" -#include #include +#include "helpers/swapper.h" +#include "log/messages.h" #include "main.h" +#include "packet_io/sfdaq.h" + #include "snort.h" #include "snort_debug.h" #include "thread.h" -#include "helpers/swapper.h" -#include "log/messages.h" -#include "memory/memory_cap.h" -#include "packet_io/sfdaq.h" using namespace std; diff --git a/src/main/analyzer.h b/src/main/analyzer.h index 57c5d5b77..62f600b2a 100644 --- a/src/main/analyzer.h +++ b/src/main/analyzer.h @@ -25,7 +25,6 @@ // to control the thread and swap configuration. #include -#include "main/snort_types.h" enum AnalyzerCommand { diff --git a/src/main/help.cc b/src/main/help.cc index 17a2db05e..e4f23aee9 100644 --- a/src/main/help.cc +++ b/src/main/help.cc @@ -17,33 +17,29 @@ //-------------------------------------------------------------------------- // help.cc author Russ Combs -#include "help.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "help.h" + #include -#include -#include "main.h" -#include "main/snort_config.h" -#include "main/snort_module.h" #include "framework/module.h" -#include "framework/parameter.h" +#include "helpers/markup.h" +#include "helpers/process.h" #include "managers/event_manager.h" -#include "managers/so_manager.h" #include "managers/inspector_manager.h" #include "managers/module_manager.h" #include "managers/plugin_manager.h" #include "managers/script_manager.h" -#include "packet_io/sfdaq.h" +#include "managers/so_manager.h" #include "packet_io/intf.h" -#include "parser/config_file.h" -#include "helpers/process.h" +#include "packet_io/sfdaq.h" #include "utils/util.h" -#include "helpers/markup.h" + +#include "snort_config.h" +#include "snort_module.h" using namespace std; diff --git a/src/main/modules.cc b/src/main/modules.cc index 0ffa2a8e8..98e4fc8a9 100644 --- a/src/main/modules.cc +++ b/src/main/modules.cc @@ -18,25 +18,20 @@ // modules.cc author Russ Combs -#include "modules.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "snort_config.h" -#include "snort_module.h" -#include "thread_config.h" +#include "modules.h" #include "codecs/codec_module.h" #include "detection/fp_config.h" -#include "file_api/file_module.h" #include "filters/detection_filter.h" #include "filters/rate_filter.h" #include "filters/sfrf.h" #include "filters/sfthd.h" -#include "flow/ha_module.h" #include "filters/sfthreshold.h" +#include "flow/ha_module.h" #include "framework/module.h" #include "host_tracker/host_tracker_module.h" #include "host_tracker/host_cache_module.h" @@ -50,15 +45,18 @@ #include "parser/parse_conf.h" #include "parser/parse_ip.h" #include "parser/parser.h" -#include "profiler/profiler.h" +#include "profiler/profiler_defs.h" #include "search_engines/pat_stats.h" #include "side_channel/side_channel_module.h" -#include "sfip/sf_ip.h" #include "sfip/sf_ipvar.h" #include "stream/stream.h" #include "target_based/sftarget_data.h" #include "target_based/snort_protocols.h" +#include "snort_config.h" +#include "snort_module.h" +#include "thread_config.h" + using namespace std; //------------------------------------------------------------------------- diff --git a/src/main/policy.cc b/src/main/policy.cc index 2e3e3595c..cd336a9dc 100644 --- a/src/main/policy.cc +++ b/src/main/policy.cc @@ -17,21 +17,20 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "policy.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "policy.h" +#include "detection/detect.h" #include "managers/inspector_manager.h" #include "parser/vars.h" -#include "main/shell.h" -#include "main/snort_config.h" -#include "detection/detect.h" -#include "ports/port_table.h" -#include "ports/port_utils.h" #include "ports/port_var_table.h" +#include "shell.h" +#include "snort_config.h" + //------------------------------------------------------------------------- // traffic policy //------------------------------------------------------------------------- diff --git a/src/main/policy.h b/src/main/policy.h index 5ed904659..867168e5f 100644 --- a/src/main/policy.h +++ b/src/main/policy.h @@ -26,10 +26,6 @@ // -- inspection - for flow handling // -- ips - for rule handling -#include -#include - -#include "main/snort_types.h" #include "framework/data_bus.h" struct PortTable; diff --git a/src/main/shell.cc b/src/main/shell.cc index 3c603f7cf..8f6673425 100644 --- a/src/main/shell.cc +++ b/src/main/shell.cc @@ -17,19 +17,19 @@ //-------------------------------------------------------------------------- // shell.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "shell.h" -#include -#include -#include -#include +#include +#include #include -#include "framework/module.h" +#include "log/messages.h" #include "lua/lua.h" #include "managers/module_manager.h" -#include "parser/parser.h" -#include "log/messages.h" using namespace std; diff --git a/src/main/shell.h b/src/main/shell.h index ccf9b4987..1ff80b21f 100644 --- a/src/main/shell.h +++ b/src/main/shell.h @@ -23,6 +23,7 @@ // Shell encapsulates a Lua state. There is one for each policy file. #include + struct lua_State; class Shell diff --git a/src/main/snort.cc b/src/main/snort.cc index ab7b8b005..4db936b4d 100644 --- a/src/main/snort.cc +++ b/src/main/snort.cc @@ -17,23 +17,14 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "snort.h" - #ifdef HAVE_CONFIG_H -# include "config.h" +#include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include +#include "snort.h" -#include #include +#include #include "actions/ips_actions.h" #include "codecs/codec_api.h" @@ -56,8 +47,10 @@ #include "ips_options/ips_options.h" #include "latency/packet_latency.h" #include "latency/rule_latency.h" +#include "log/log.h" #include "log/messages.h" #include "loggers/loggers.h" +#include "main.h" #include "managers/action_manager.h" #include "managers/codec_manager.h" #include "managers/inspector_manager.h" @@ -68,15 +61,13 @@ #include "managers/plugin_manager.h" #include "managers/script_manager.h" #include "network_inspectors/network_inspectors.h" -#include "packet_io/sfdaq.h" #include "packet_io/active.h" +#include "packet_io/sfdaq.h" #include "packet_io/trough.h" #include "parser/cmd_line.h" #include "parser/parser.h" #include "perf_monitor/perf_monitor.h" #include "profiler/profiler.h" -#include "protocols/packet.h" -#include "protocols/packet_manager.h" #include "search_engines/search_engines.h" #include "service_inspectors/service_inspectors.h" #include "side_channel/side_channel.h" @@ -97,9 +88,7 @@ #endif #include "build.h" -#include "main.h" #include "snort_config.h" -#include "snort_debug.h" #include "thread_config.h" using namespace std; diff --git a/src/main/snort.h b/src/main/snort.h index d3ce2658c..59080c9bc 100644 --- a/src/main/snort.h +++ b/src/main/snort.h @@ -23,14 +23,9 @@ // Snort is the top-level application class. -#include -#include -#include -#include "main/snort_types.h" - -extern "C" { #include -} + +#include "main/snort_types.h" class Flow; struct Packet; diff --git a/src/main/snort_config.cc b/src/main/snort_config.cc index bc9e43642..b7cadb719 100644 --- a/src/main/snort_config.cc +++ b/src/main/snort_config.cc @@ -17,12 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "snort_config.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "snort_config.h" + #include "detection/fp_config.h" #include "detection/fp_create.h" #include "filters/detection_filter.h" @@ -42,9 +42,10 @@ #include "parser/parser.h" #include "parser/vars.h" #include "profiler/profiler.h" +#include "protocols/packet.h" #include "sfip/sf_ip.h" -#include "thread_config.h" #include "target_based/sftarget_reader.h" +#include "target_based/snort_protocols.h" #include "utils/util.h" #ifdef HAVE_HYPERSCAN @@ -53,6 +54,8 @@ #include "search_engines/hyperscan.h" #endif +#include "thread_config.h" + THREAD_LOCAL SnortConfig* snort_conf = nullptr; uint32_t SnortConfig::warning_flags = 0; diff --git a/src/main/snort_config.h b/src/main/snort_config.h index 62a262c2f..e01df2cd9 100644 --- a/src/main/snort_config.h +++ b/src/main/snort_config.h @@ -23,10 +23,6 @@ // SnortConfig encapsulates all data loaded from the config files. // FIXIT-L privatize most of this stuff. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "events/event_queue.h" #include "file_api/file_config.h" #include "framework/bits.h" diff --git a/src/main/snort_debug.cc b/src/main/snort_debug.cc index a1d44622a..4b4cff12c 100644 --- a/src/main/snort_debug.cc +++ b/src/main/snort_debug.cc @@ -18,18 +18,20 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "snort_debug.h" -#include -#include #include -#include + +#include #include "log/messages.h" +#include "utils/safec.h" -#include "snort_types.h" #include "snort_config.h" -#include "utils/safec.h" bool Debug::init = false; uint64_t Debug::mask = 0; diff --git a/src/main/snort_debug.h b/src/main/snort_debug.h index f52471afe..353f8d141 100644 --- a/src/main/snort_debug.h +++ b/src/main/snort_debug.h @@ -26,14 +26,7 @@ // // FIXIT-M debug flags needs to be replaced with a module facility. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include -#include -#include -#include #include "main/snort_types.h" diff --git a/src/main/snort_module.cc b/src/main/snort_module.cc index c649501ca..498e4d9b4 100644 --- a/src/main/snort_module.cc +++ b/src/main/snort_module.cc @@ -18,41 +18,32 @@ // snort_module.cc author Russ Combs -#include "snort_module.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include - -#include +#include "snort_module.h" -#include "main.h" -#include "snort_config.h" -#include "help.h" -#include "shell.h" -#include "thread_config.h" -#include "detection/detect.h" -#include "framework/base_api.h" #include "framework/module.h" #include "framework/parameter.h" #include "log/messages.h" -#include "managers/module_manager.h" -#include "managers/plugin_manager.h" +#include "main.h" #include "packet_io/sfdaq_config.h" +#include "packet_io/trough.h" #include "parser/config_file.h" #include "parser/parser.h" #include "parser/parse_utils.h" #include "parser/vars.h" -#include "packet_io/trough.h" -#include "utils/stats.h" #ifdef UNIT_TEST #include "catch/unit_test.h" #endif +#include "help.h" +#include "shell.h" +#include "snort_config.h" +#include "thread_config.h" + using namespace std; //------------------------------------------------------------------------- diff --git a/src/main/snort_types.h b/src/main/snort_types.h index f1aeee6b3..3b87b0c9f 100644 --- a/src/main/snort_types.h +++ b/src/main/snort_types.h @@ -22,74 +22,22 @@ // defines common types if not already defined -#define __STDC_FORMAT_MACROS -#include - -#include -#include - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include +#include +#include typedef uint16_t Port; -/* use these macros (and those in ) - * for 64 bit format portability - */ +/* use these macros for 64 bit format portability */ #define STDu64 "%" PRIu64 -#define CSVu64 STDu64 "," #define FMTu64(fmt) "%" fmt PRIu64 #define STDi64 "%" PRIi64 -#define CSVi64 STDi64 "," #define FMTi64(fmt) "%" fmt PRIi64 #define STDx64 "%" PRIx64 -#define CSVx64 STDx64 "," #define FMTx64(fmt) "%" fmt PRIx64 -#ifndef UINT8_MAX -# define UINT8_MAX 0xff -#endif - -#ifndef USHRT_MAX -# define USHRT_MAX 0xffff -#endif - -#ifndef UINT16_MAX -# define UINT16_MAX 0xffff -#endif - -#ifndef UINT32_MAX -# define UINT32_MAX (4294967295U) -#endif - -#ifndef UINT64_MAX -# if SIZEOF_UNSIGNED_LONG_INT == 8 -# define UINT64_MAX (18446744073709551615UL) -# else -# define UINT64_MAX (18446744073709551615ULL) -# endif -#endif - -/* Somewhat arbitrary, but should be enough for this application - * since files shouldn't be buried too deep. This provides about - * 15 levels of 255 character path components */ -#ifndef PATH_MAX -# define PATH_MAX 4096 -#endif - -/* utilities */ - -#ifndef SIZE_MAX -#define SIZE_MAX 0xFFFFFFFF // FIXIT-L use c++ define -#endif - -#ifndef INT32_MAX -#define INT32_MAX 0x7FFFFFFF // FIXIT-L use c++ define -#endif - #define UNUSED(x) (void)(x) #ifndef SO_PUBLIC diff --git a/src/main/thread.cc b/src/main/thread.cc index cb441500f..3611aec2d 100644 --- a/src/main/thread.cc +++ b/src/main/thread.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // thread.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "thread.h" #include diff --git a/src/main/thread.h b/src/main/thread.h index ba4fe9fb0..025a80b42 100644 --- a/src/main/thread.h +++ b/src/main/thread.h @@ -23,6 +23,7 @@ // basic thread management utilities #include + #include "main/snort_types.h" #define THREAD_LOCAL_TBD diff --git a/src/main/thread_config.cc b/src/main/thread_config.cc index 6cb9d492e..5f7b864a6 100644 --- a/src/main/thread_config.cc +++ b/src/main/thread_config.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // thread_config.cc author Michael Altizer +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "thread_config.h" #include diff --git a/src/managers/CMakeLists.txt b/src/managers/CMakeLists.txt index 31a475d8b..84a5a41fc 100644 --- a/src/managers/CMakeLists.txt +++ b/src/managers/CMakeLists.txt @@ -5,6 +5,7 @@ set (LUA_INCLUDES ) set( MANAGERS_INCLUDES + codec_manager.h inspector_manager.h ) @@ -12,7 +13,6 @@ add_library( managers STATIC ${MANAGERS_INCLUDES} action_manager.h action_manager.cc - codec_manager.h codec_manager.cc event_manager.cc event_manager.h diff --git a/src/managers/Makefile.am b/src/managers/Makefile.am index 745c687fb..f585253ad 100644 --- a/src/managers/Makefile.am +++ b/src/managers/Makefile.am @@ -8,6 +8,7 @@ snort_plugin.lua x_mgrdir = $(pkgincludedir)/managers x_mgr_HEADERS = \ +codec_manager.h \ inspector_manager.h noinst_LIBRARIES = libmanagers.a diff --git a/src/managers/action_manager.cc b/src/managers/action_manager.cc index 954fc319e..a0aced5ee 100644 --- a/src/managers/action_manager.cc +++ b/src/managers/action_manager.cc @@ -17,23 +17,18 @@ //-------------------------------------------------------------------------- // action_manager.cc author Russ Combs -#include "action_manager.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "action_manager.h" #include #include "actions/act_replace.h" -#include "actions/ips_actions.h" -#include "framework/ips_action.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" -#include "managers/module_manager.h" -#include "parser/parser.h" #include "packet_io/active.h" -#include "utils/util.h" +#include "parser/parser.h" using namespace std; diff --git a/src/managers/action_manager.h b/src/managers/action_manager.h index 78a6d48ce..fcad8537e 100644 --- a/src/managers/action_manager.h +++ b/src/managers/action_manager.h @@ -24,17 +24,12 @@ // which is just a single response deferred until end of current packet // processing. -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "main/snort_types.h" #include "actions/actions.h" -#include "framework/base_api.h" +#include "framework/ips_action.h" +#include "framework/module.h" #ifdef PIGLET #include "framework/ips_action.h" -#include "piglet/piglet_api.h" #endif struct ActionApi; diff --git a/src/managers/codec_manager.cc b/src/managers/codec_manager.cc index 0bc4215b7..8e0213af2 100644 --- a/src/managers/codec_manager.cc +++ b/src/managers/codec_manager.cc @@ -18,19 +18,15 @@ // codec_manager.cc author Josh Rosenbaum #ifdef HAVE_CONFIG_H -# include "config.h" +#include "config.h" #endif -#include -#include +#include "codec_manager.h" -#include "main/snort_config.h" -#include "framework/codec.h" -#include "managers/codec_manager.h" -#include "protocols/packet_manager.h" #include "log/messages.h" -#include "parser/parser.h" +#include "main/snort_config.h" #include "packet_io/sfdaq.h" +#include "protocols/packet_manager.h" #include "utils/dnet_header.h" struct CodecManager::CodecApiWrapper diff --git a/src/managers/codec_manager.h b/src/managers/codec_manager.h index c5d764b90..b6e0c9e39 100644 --- a/src/managers/codec_manager.h +++ b/src/managers/codec_manager.h @@ -23,21 +23,14 @@ // Factory for Codecs. Runtime support is provided by PacketManager. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include -#include #include -#include #include "main/thread.h" #include "protocols/protocol_ids.h" #ifdef PIGLET #include "framework/codec.h" -#include "piglet/piglet_api.h" #endif struct SnortConfig; diff --git a/src/managers/connector_manager.cc b/src/managers/connector_manager.cc index ffa1ece32..e5f03705f 100644 --- a/src/managers/connector_manager.cc +++ b/src/managers/connector_manager.cc @@ -17,22 +17,22 @@ //-------------------------------------------------------------------------- // connector_manager.cc author Ed Borgoyn -#include "connector_manager.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "connector_manager.h" +#include #include +#include #include -#include #include "framework/connector.h" #include "log/messages.h" -#include "main/snort_config.h" #include "main/snort_debug.h" #include "utils/util.h" -#include "module_manager.h" - // ConnectorManager Private Data // One ConnectorElem for each Connector within the ConnectorCommon configuration diff --git a/src/managers/connector_manager.h b/src/managers/connector_manager.h index 12920eed3..d03175076 100644 --- a/src/managers/connector_manager.h +++ b/src/managers/connector_manager.h @@ -22,7 +22,7 @@ // Factory for Connectors. -#include "framework/connector.h" +#include struct SnortConfig; struct ConnectorApi; diff --git a/src/managers/event_manager.cc b/src/managers/event_manager.cc index 42d5221a0..212bf6961 100644 --- a/src/managers/event_manager.cc +++ b/src/managers/event_manager.cc @@ -17,30 +17,20 @@ //-------------------------------------------------------------------------- // event_manager.cc author Russ Combs -#include "event_manager.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include -#include -#include -#include +#include "event_manager.h" +#include #include -#include "plugin_manager.h" -#include "module_manager.h" - -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" -#include "utils/util.h" #include "framework/logger.h" -#include "framework/module.h" -#include "loggers/loggers.h" -#include "parser/parser.h" #include "log/messages.h" +#include "main/snort_config.h" + +#include "module_manager.h" using namespace std; diff --git a/src/managers/event_manager.h b/src/managers/event_manager.h index 7414c43d8..fe2454350 100644 --- a/src/managers/event_manager.h +++ b/src/managers/event_manager.h @@ -24,16 +24,10 @@ // OutputSet is a group of Loggers that can be attached to external data. // Also provides runtime logging. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main/snort_types.h" -#include "framework/base_api.h" +#include "framework/module.h" #ifdef PIGLET #include "framework/logger.h" -#include "piglet/piglet_api.h" #endif #define OUTPUT_TYPE_FLAG__NONE 0x0 diff --git a/src/managers/inspector_manager.cc b/src/managers/inspector_manager.cc index 64ec58348..29ff6745e 100644 --- a/src/managers/inspector_manager.cc +++ b/src/managers/inspector_manager.cc @@ -17,25 +17,27 @@ //-------------------------------------------------------------------------- // inspector_manager.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "inspector_manager.h" -#include -#include #include #include -#include "module_manager.h" -#include "main/snort_config.h" -#include "main/thread_config.h" +#include "binder/bind_module.h" +#include "binder/binder.h" +#include "detection/detect.h" #include "flow/flow.h" #include "flow/session.h" -#include "framework/inspector.h" -#include "detection/detection_util.h" #include "log/messages.h" -#include "packet_io/active.h" +#include "main/snort_config.h" +#include "main/thread_config.h" +#include "protocols/packet.h" #include "target_based/snort_protocols.h" -#include "binder/bind_module.h" -#include "binder/binder.h" + +#include "module_manager.h" using namespace std; diff --git a/src/managers/inspector_manager.h b/src/managers/inspector_manager.h index bf535a12b..0eb9381de 100644 --- a/src/managers/inspector_manager.h +++ b/src/managers/inspector_manager.h @@ -23,17 +23,10 @@ // Factory for Inspectors. // Also provides packet evaluation. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main/snort_types.h" -#include "framework/base_api.h" #include "framework/inspector.h" #ifdef PIGLET #include "framework/inspector.h" -#include "piglet/piglet_api.h" #endif struct Packet; diff --git a/src/managers/ips_manager.cc b/src/managers/ips_manager.cc index f564aa1df..72822be95 100644 --- a/src/managers/ips_manager.cc +++ b/src/managers/ips_manager.cc @@ -17,33 +17,21 @@ //-------------------------------------------------------------------------- // ips_manager.cc author Russ Combs -#include "ips_manager.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include -#include -#include -#include -#include +#include "ips_manager.h" +#include #include -#include -#include "plugin_manager.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" -#include "framework/ips_option.h" -#include "framework/so_rule.h" -#include "framework/module.h" -#include "framework/parameter.h" -#include "managers/module_manager.h" -#include "ips_options/ips_options.h" -#include "utils/util.h" -#include "parser/parser.h" +#include "detection/treenodes.h" #include "log/messages.h" +#include "main/snort_config.h" + +#include "module_manager.h" +#include "plugin_manager.h" using namespace std; diff --git a/src/managers/ips_manager.h b/src/managers/ips_manager.h index 94290e040..11b1619c7 100644 --- a/src/managers/ips_manager.h +++ b/src/managers/ips_manager.h @@ -23,22 +23,9 @@ // Factory for IpsOptions. // Runtime use of IpsOptions is via detection option tree. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include "main/snort_types.h" #include "detection/detection_options.h" -#include "framework/base_api.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "detection/treenodes.h" - -#ifdef PIGLET -#include "piglet/piglet_api.h" -#endif struct SnortConfig; struct IpsApi; diff --git a/src/managers/module_manager.cc b/src/managers/module_manager.cc index 05909815f..7b604e36a 100644 --- a/src/managers/module_manager.cc +++ b/src/managers/module_manager.cc @@ -17,32 +17,33 @@ //-------------------------------------------------------------------------- // module_manager.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "module_manager.h" -#include +#include +#include #include -#include #include #include -#include -#include -#include "plugin_manager.h" +#include "framework/base_api.h" +#include "framework/module.h" +#include "helpers/markup.h" #include "log/messages.h" -#include "main/snort_config.h" #include "main/modules.h" #include "main/shell.h" -#include "main/snort_types.h" #include "main/snort.h" -#include "framework/base_api.h" -#include "framework/module.h" -#include "parser/parser.h" +#include "main/snort_config.h" #include "parser/parse_conf.h" +#include "parser/parser.h" #include "parser/vars.h" #include "profiler/profiler.h" -#include "helpers/markup.h" -#include "utils/stats.h" + +#include "plugin_manager.h" using namespace std; diff --git a/src/managers/module_manager.h b/src/managers/module_manager.h index 2b5c2142f..bd91df938 100644 --- a/src/managers/module_manager.h +++ b/src/managers/module_manager.h @@ -24,7 +24,6 @@ // Modules are strictly used during parse time. #include -#include //------------------------------------------------------------------------- diff --git a/src/managers/mpse_manager.cc b/src/managers/mpse_manager.cc index 398d28813..5fb42fec5 100644 --- a/src/managers/mpse_manager.cc +++ b/src/managers/mpse_manager.cc @@ -17,19 +17,18 @@ //-------------------------------------------------------------------------- // mpse_manager.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "mpse_manager.h" #include -#include "module_manager.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" -#include "utils/util.h" #include "framework/mpse.h" -#include "parser/parser.h" #include "log/messages.h" -#include "search_engines/search_common.h" + +#include "module_manager.h" using namespace std; diff --git a/src/managers/mpse_manager.h b/src/managers/mpse_manager.h index d11247f3a..bb2de47e5 100644 --- a/src/managers/mpse_manager.h +++ b/src/managers/mpse_manager.h @@ -24,16 +24,10 @@ // as searching by inspectors with a SearchTool. Runtime use of the Mpse // is by the fast pattern detection module. -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "main/snort_types.h" -#include "framework/base_api.h" +#include "framework/module.h" #ifdef PIGLET #include "framework/mpse.h" -#include "piglet/piglet_api.h" #endif struct MpseApi; diff --git a/src/managers/plugin_manager.cc b/src/managers/plugin_manager.cc index 521fe8eab..102abf558 100644 --- a/src/managers/plugin_manager.cc +++ b/src/managers/plugin_manager.cc @@ -17,46 +17,39 @@ //-------------------------------------------------------------------------- // plugin_manager.cc author Russ Combs -#include "plugin_manager.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include +#include "plugin_manager.h" + #include +#include -#include -#include #include - -#ifdef PIGLET -#include "piglet/piglet_api.h" -#include "piglet/piglet_manager.h" -#endif +#include #include "framework/codec.h" +#include "framework/connector.h" #include "framework/logger.h" -#include "framework/ips_action.h" -#include "framework/ips_option.h" -#include "framework/inspector.h" #include "framework/mpse.h" -#include "framework/so_rule.h" - -#include "log/messages.h" #include "helpers/directory.h" #include "helpers/markup.h" -#include "parser/parser.h" +#include "log/messages.h" + +#ifdef PIGLET +#include "piglet/piglet_api.h" +#include "piglet/piglet_manager.h" +#endif #include "action_manager.h" +#include "codec_manager.h" #include "connector_manager.h" #include "event_manager.h" #include "inspector_manager.h" #include "ips_manager.h" #include "module_manager.h" #include "mpse_manager.h" -#include "codec_manager.h" #include "script_manager.h" #include "so_manager.h" diff --git a/src/managers/plugin_manager.h b/src/managers/plugin_manager.h index 1c97cd0c9..e94e13985 100644 --- a/src/managers/plugin_manager.h +++ b/src/managers/plugin_manager.h @@ -32,9 +32,7 @@ //------------------------------------------------------------------------- #include -#include -#include "main/snort_types.h" #include "framework/base_api.h" class Module; diff --git a/src/managers/script_manager.cc b/src/managers/script_manager.cc index 9446c9035..30a2fb3e5 100644 --- a/src/managers/script_manager.cc +++ b/src/managers/script_manager.cc @@ -17,24 +17,21 @@ //-------------------------------------------------------------------------- // script_manager.cc author Russ Combs -#include "script_manager.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "script_manager.h" -#include -#include #include -#include -#include "ips_manager.h" -#include "plugin_manager.h" -#include "lua/lua.h" -#include "lua/lua_util.h" #include "framework/ips_option.h" #include "framework/logger.h" #include "framework/lua_api.h" -#include "log/messages.h" #include "helpers/directory.h" +#include "log/messages.h" +#include "lua/lua.h" +#include "lua/lua_util.h" #ifdef PIGLET #include "piglet/piglet_manager.h" diff --git a/src/managers/script_manager.h b/src/managers/script_manager.h index 3dcfef1f0..e5d892934 100644 --- a/src/managers/script_manager.h +++ b/src/managers/script_manager.h @@ -26,7 +26,6 @@ #include #include -#include "main/snort_types.h" #include "framework/base_api.h" //------------------------------------------------------------------------- diff --git a/src/managers/so_manager.cc b/src/managers/so_manager.cc index 3c2988562..f98e2a3f9 100644 --- a/src/managers/so_manager.cc +++ b/src/managers/so_manager.cc @@ -17,34 +17,22 @@ //-------------------------------------------------------------------------- // so_manager.cc author Russ Combs -#include "so_manager.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include +#include "so_manager.h" + #include -#include +#include +#include +#include #include #include +#include #include -#include "plugin_manager.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" -#include "framework/so_rule.h" -#include "framework/module.h" -#include "utils/util.h" -#include "parser/parser.h" #include "log/messages.h" using namespace std; diff --git a/src/managers/so_manager.h b/src/managers/so_manager.h index 771b5665b..056142382 100644 --- a/src/managers/so_manager.h +++ b/src/managers/so_manager.h @@ -23,8 +23,6 @@ // Factory for shared object rules. // Runtime is same as for text rules. -#include "main/snort_types.h" -#include "framework/base_api.h" #include "framework/so_rule.h" struct SnortConfig; diff --git a/src/memory/memory_allocator.cc b/src/memory/memory_allocator.cc index 88fdf8707..b37f55fbf 100644 --- a/src/memory/memory_allocator.cc +++ b/src/memory/memory_allocator.cc @@ -18,6 +18,10 @@ // memory_allocator.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "memory_allocator.h" #include diff --git a/src/memory/memory_cap.cc b/src/memory/memory_cap.cc index b4bc9aadf..e2d6df0fd 100644 --- a/src/memory/memory_cap.cc +++ b/src/memory/memory_cap.cc @@ -18,18 +18,16 @@ // memory_cap.cc author Joel Cornett -#include "memory_cap.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif #include +#include "memory_cap.h" + #include "log/messages.h" #include "main/snort_config.h" -#include "main/snort_debug.h" -#include "main/thread.h" #include "profiler/memory_profiler_active_context.h" #include "memory_config.h" diff --git a/src/memory/memory_manager.cc b/src/memory/memory_manager.cc index 99584b40f..15153c2e8 100644 --- a/src/memory/memory_manager.cc +++ b/src/memory/memory_manager.cc @@ -22,9 +22,8 @@ #include "config.h" #endif -#include -#include #include +#include #include "main/thread.h" diff --git a/src/memory/memory_module.cc b/src/memory/memory_module.cc index 696423af2..ab6af99d7 100644 --- a/src/memory/memory_module.cc +++ b/src/memory/memory_module.cc @@ -18,9 +18,14 @@ // memory_module.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "memory_module.h" #include "main/snort_config.h" + #include "memory_config.h" // ----------------------------------------------------------------------------- diff --git a/src/memory/prune_handler.cc b/src/memory/prune_handler.cc index e19b4bb1d..8b1bc6693 100644 --- a/src/memory/prune_handler.cc +++ b/src/memory/prune_handler.cc @@ -18,7 +18,12 @@ // prune_handler.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "prune_handler.h" + #include "stream/stream.h" namespace memory diff --git a/src/mime/CMakeLists.txt b/src/mime/CMakeLists.txt index c71405dd1..6498c4eb2 100644 --- a/src/mime/CMakeLists.txt +++ b/src/mime/CMakeLists.txt @@ -2,10 +2,6 @@ set( MIME_INCLUDES decode_b64.h decode_base.h - decode_bit.h - decode_buffer.h - decode_qp.h - decode_uu.h file_mime_config.h file_mime_decode.h file_mime_log.h @@ -23,10 +19,13 @@ add_library ( mime STATIC decode_base.cc decode_b64.cc decode_bit.cc + decode_bit.h decode_buffer.cc + decode_buffer.h decode_qp.cc + decode_qp.h decode_uu.cc - + decode_uu.h ) target_link_libraries(mime file_api) diff --git a/src/mime/Makefile.am b/src/mime/Makefile.am index 49ab51464..f197c620e 100644 --- a/src/mime/Makefile.am +++ b/src/mime/Makefile.am @@ -6,10 +6,6 @@ x_includedir = $(pkgincludedir)/mime x_include_HEADERS = \ decode_b64.h \ decode_base.h \ -decode_bit.h \ -decode_buffer.h \ -decode_qp.h \ -decode_uu.h \ file_mime_config.h \ file_mime_decode.h \ file_mime_log.h \ @@ -20,9 +16,13 @@ libmime_a_SOURCES = \ decode_b64.cc \ decode_base.cc \ decode_bit.cc \ +decode_bit.h \ decode_buffer.cc \ +decode_buffer.h \ decode_qp.cc \ +decode_qp.h \ decode_uu.cc \ +decode_uu.h \ file_mime_config.cc \ file_mime_decode.cc \ file_mime_log.cc \ diff --git a/src/mime/decode_b64.cc b/src/mime/decode_b64.cc index 75d6eda8a..f91bf9f52 100644 --- a/src/mime/decode_b64.cc +++ b/src/mime/decode_b64.cc @@ -18,12 +18,14 @@ //-------------------------------------------------------------------------- // decode_b64.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "decode_b64.h" -#include "utils/util.h" #include "utils/util_unfold.h" -#include "decode_base.h" #include "decode_buffer.h" void B64Decode::reset_decode_state() diff --git a/src/mime/decode_b64.h b/src/mime/decode_b64.h index 93a59933c..f9431bf2d 100644 --- a/src/mime/decode_b64.h +++ b/src/mime/decode_b64.h @@ -22,8 +22,6 @@ // Email attachment decoder -#include - #include "main/snort_types.h" #include "mime/decode_base.h" diff --git a/src/mime/decode_base.cc b/src/mime/decode_base.cc index 7c6425e35..b67b8e413 100644 --- a/src/mime/decode_base.cc +++ b/src/mime/decode_base.cc @@ -18,8 +18,11 @@ //-------------------------------------------------------------------------- // decode_base.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "decode_base.h" -#include "utils/util.h" void DataDecode::reset_decoded_bytes() { diff --git a/src/mime/decode_base.h b/src/mime/decode_base.h index d49652c82..3926f9123 100644 --- a/src/mime/decode_base.h +++ b/src/mime/decode_base.h @@ -22,8 +22,7 @@ // Email attachment decoder -#include -#include "main/snort_types.h" +#include enum DecodeResult { diff --git a/src/mime/decode_bit.cc b/src/mime/decode_bit.cc index 23d9a9a72..adbf81bb0 100644 --- a/src/mime/decode_bit.cc +++ b/src/mime/decode_bit.cc @@ -18,8 +18,11 @@ //-------------------------------------------------------------------------- // decode_bit.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "decode_bit.h" -#include "utils/util.h" void BitDecode::reset_decode_state() { diff --git a/src/mime/decode_bit.h b/src/mime/decode_bit.h index 5ea46f2b0..fa3bb547a 100644 --- a/src/mime/decode_bit.h +++ b/src/mime/decode_bit.h @@ -22,7 +22,6 @@ // Email attachment decoder -#include #include "mime/decode_base.h" class BitDecode : public DataDecode diff --git a/src/mime/decode_buffer.cc b/src/mime/decode_buffer.cc index 98047265f..cd962173e 100644 --- a/src/mime/decode_buffer.cc +++ b/src/mime/decode_buffer.cc @@ -18,7 +18,12 @@ //-------------------------------------------------------------------------- // decode_buffer.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "decode_buffer.h" + #include "utils/util.h" void DecodeBuffer::reset_saved() diff --git a/src/mime/decode_buffer.h b/src/mime/decode_buffer.h index 818f671a7..b880a4992 100644 --- a/src/mime/decode_buffer.h +++ b/src/mime/decode_buffer.h @@ -22,7 +22,6 @@ // Manage decode/encode buffers -#include #include "main/snort_types.h" class DecodeBuffer diff --git a/src/mime/decode_qp.cc b/src/mime/decode_qp.cc index bf602cc19..f8191e894 100644 --- a/src/mime/decode_qp.cc +++ b/src/mime/decode_qp.cc @@ -18,9 +18,15 @@ //-------------------------------------------------------------------------- // decode_qp.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "decode_qp.h" -#include "utils/util.h" +#include +#include + #include "utils/util_unfold.h" #include "decode_buffer.h" diff --git a/src/mime/decode_qp.h b/src/mime/decode_qp.h index f778d4039..a3547ed05 100644 --- a/src/mime/decode_qp.h +++ b/src/mime/decode_qp.h @@ -22,7 +22,6 @@ // Email attachment decoder -#include #include "mime/decode_base.h" class QPDecode : public DataDecode diff --git a/src/mime/decode_uu.cc b/src/mime/decode_uu.cc index 2a8b503ea..9885c0801 100644 --- a/src/mime/decode_uu.cc +++ b/src/mime/decode_uu.cc @@ -18,11 +18,14 @@ //-------------------------------------------------------------------------- // decode_uu.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "decode_uu.h" #include "utils/safec.h" #include "utils/util.h" -#include "utils/util_unfold.h" #include "decode_buffer.h" diff --git a/src/mime/file_mime_config.cc b/src/mime/file_mime_config.cc index a2864203c..81159a158 100644 --- a/src/mime/file_mime_config.cc +++ b/src/mime/file_mime_config.cc @@ -20,14 +20,15 @@ // file_mime_config.cc author Hui Cao // 9.25.2012 - Initial Source Code. Hui Cao +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_mime_config.h" #include "log/messages.h" -#include "main/snort_types.h" #include "file_api/file_service.h" -#include "file_mime_process.h" - void DecodeConfig::set_ignore_data(bool ignored) { ignore_data = ignored; diff --git a/src/mime/file_mime_decode.cc b/src/mime/file_mime_decode.cc index 08b96753c..fa7e6642d 100644 --- a/src/mime/file_mime_decode.cc +++ b/src/mime/file_mime_decode.cc @@ -18,9 +18,12 @@ //-------------------------------------------------------------------------- // file_mime_decode.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "file_mime_decode.h" -#include "utils/util_unfold.h" #include "utils/util.h" #include "decode_b64.h" diff --git a/src/mime/file_mime_decode.h b/src/mime/file_mime_decode.h index 82cdcb9a7..fa9798a07 100644 --- a/src/mime/file_mime_decode.h +++ b/src/mime/file_mime_decode.h @@ -22,10 +22,7 @@ // Email attachment decoder, supports Base64, QP, UU, and Bit7/8 -#include - #include "framework/counts.h" -#include "main/snort_types.h" #include "mime/decode_base.h" #include "mime/file_mime_config.h" diff --git a/src/mime/file_mime_log.cc b/src/mime/file_mime_log.cc index f458a4567..c90430dd5 100644 --- a/src/mime/file_mime_log.cc +++ b/src/mime/file_mime_log.cc @@ -20,16 +20,15 @@ // file_mime_log.cc author Hui Cao // 9.25.2012 - Initial Source Code. Hui Cao -#include "file_mime_log.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "utils/util.h" -#include "file_api/file_api.h" +#include "file_mime_log.h" + #include "file_api/file_flows.h" #include "utils/safec.h" +#include "utils/util.h" #define MAX_FILE 1024 #define MAX_EMAIL 1024 diff --git a/src/mime/file_mime_log.h b/src/mime/file_mime_log.h index a450ff67b..8d69ccb7a 100644 --- a/src/mime/file_mime_log.h +++ b/src/mime/file_mime_log.h @@ -24,8 +24,7 @@ // File name will be extracted from MIME header // Email headers and emails are also stored in the log buffer -#include "mime/file_mime_config.h" -#include "file_api/file_api.h" +#include enum EmailUserType { diff --git a/src/mime/file_mime_paf.cc b/src/mime/file_mime_paf.cc index 0d3c2c295..ed0b9b51e 100644 --- a/src/mime/file_mime_paf.cc +++ b/src/mime/file_mime_paf.cc @@ -20,17 +20,15 @@ // file_mime_paf.cc author Hui Cao // 9.25.2012 - Initial Source Code. Hui Cao -#include "file_mime_paf.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "file_api/file_api.h" +#include "file_mime_paf.h" + +#include -#include "file_mime_config.h" +#include "main/snort_debug.h" static const char* boundary_str = "boundary="; diff --git a/src/mime/file_mime_paf.h b/src/mime/file_mime_paf.h index ab0c0365f..386f1f0ec 100644 --- a/src/mime/file_mime_paf.h +++ b/src/mime/file_mime_paf.h @@ -24,9 +24,7 @@ // Provides list of MIME processing functions. Encoded file data will be decoded // and file name will be extracted from MIME header -#include "mime/decode_base.h" -#include "mime/file_mime_config.h" -#include "file_api/file_api.h" +#include "main/snort_types.h" /* State tracker for data */ enum MimeDataState diff --git a/src/mime/file_mime_process.cc b/src/mime/file_mime_process.cc index 80fed9a43..bfba6398f 100644 --- a/src/mime/file_mime_process.cc +++ b/src/mime/file_mime_process.cc @@ -20,24 +20,16 @@ // file_mime_process.cc author Hui Cao // 9.25.2012 - Initial Source Code. Hui Cao -#include "file_mime_process.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" +#include "file_mime_process.h" + #include "detection/detection_util.h" -#include "file_api/file_api.h" #include "file_api/file_flows.h" -#include "framework/data_bus.h" #include "log/messages.h" -#include "protocols/packet.h" #include "search_engines/search_tool.h" -#include "utils/util.h" - -#include "file_mime_config.h" -#include "file_mime_decode.h" struct MimeToken { diff --git a/src/mime/file_mime_process.h b/src/mime/file_mime_process.h index f60ea68a5..4991c1980 100644 --- a/src/mime/file_mime_process.h +++ b/src/mime/file_mime_process.h @@ -24,12 +24,11 @@ // Provides list of MIME processing functions. Encoded file data will be decoded // and file name will be extracted from MIME header -#include "main/snort_types.h" #include "file_api/file_api.h" #include "mime/file_mime_config.h" -#include "mime/file_mime_paf.h" -#include "mime/file_mime_log.h" #include "mime/file_mime_decode.h" +#include "mime/file_mime_log.h" +#include "mime/file_mime_paf.h" /* state flags */ #define MIME_FLAG_FOLDING 0x00000001 diff --git a/src/network_inspectors/appid/app_forecast.cc b/src/network_inspectors/appid/app_forecast.cc index 542cfc94c..f31f0a63e 100644 --- a/src/network_inspectors/appid/app_forecast.cc +++ b/src/network_inspectors/appid/app_forecast.cc @@ -19,12 +19,18 @@ // app_forecast.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "app_forecast.h" #include "hash/sfxhash.h" -#include "time/packet_time.h" #include "log/messages.h" -#include "application_ids.h" +#include "protocols/packet.h" +#include "time/packet_time.h" + +#include "appid_session.h" static AFActKey master_key; static THREAD_LOCAL SFXHASH* AF_indicators = nullptr; // App Forecasting list of "indicator apps" diff --git a/src/network_inspectors/appid/app_forecast.h b/src/network_inspectors/appid/app_forecast.h index 37eefca0d..e06d1ea68 100644 --- a/src/network_inspectors/appid/app_forecast.h +++ b/src/network_inspectors/appid/app_forecast.h @@ -23,13 +23,11 @@ #define APP_FORECAST_H // AppId flow forcasting data structures and methods -// -#include -#include "appid_api.h" -#include "protocols/packet.h" +#include "flow/flow.h" -#include "appid_session.h" +class AppIdSession; +struct Packet; // indicator - the appId that indicates there may be subsequent flows to look for, from the same host // forecast - the appId in the subsequent flow that we are looking for @@ -38,7 +36,6 @@ // for now, indicator and target are WEB APPLICATIONS. The forecast is APP PROTOCOL. We can change this // later by adding app type info for each, if we find a use case. -class AppIdConfig; enum ApplicationId : int32_t; struct AFElement diff --git a/src/network_inspectors/appid/app_info_table.cc b/src/network_inspectors/appid/app_info_table.cc index 1e6a65c77..f5cf264f7 100644 --- a/src/network_inspectors/appid/app_info_table.cc +++ b/src/network_inspectors/appid/app_info_table.cc @@ -19,16 +19,18 @@ // app_info_table.cc author Sourcefire Inc. -#include "app_info_table.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "application_ids.h" +#include "app_info_table.h" + +#include + #include "log/messages.h" #include "main/snort_debug.h" -#include "utils/util.h" + +#include "appid_config.h" #include "service_plugins/service_util.h" #define MAX_TABLE_LINE_LEN 1024 diff --git a/src/network_inspectors/appid/app_info_table.h b/src/network_inspectors/appid/app_info_table.h index 9e9210c02..aa4264645 100644 --- a/src/network_inspectors/appid/app_info_table.h +++ b/src/network_inspectors/appid/app_info_table.h @@ -22,15 +22,14 @@ #ifndef APP_INFO_TABLE_H #define APP_INFO_TABLE_H -#include -#include #include +#include -#include "application_ids.h" -#include "appid_api.h" -#include "appid_config.h" +#include "flow/flow.h" #include "utils/util.h" +#include "application_ids.h" + #define APP_PRIORITY_DEFAULT 2 #define SF_APPID_MAX 40000 #define SF_APPID_BUILDIN_MAX 30000 diff --git a/src/network_inspectors/appid/appid_api.cc b/src/network_inspectors/appid/appid_api.cc index b0aa6f7d7..c3ced8477 100644 --- a/src/network_inspectors/appid/appid_api.cc +++ b/src/network_inspectors/appid/appid_api.cc @@ -19,13 +19,14 @@ // appid_api.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "appid_api.h" #include "app_info_table.h" #include "service_plugins/service_base.h" -#include "app_info_table.h" - -#include "utils/util.h" #define SSL_WHITELIST_PKT_LIMIT 20 diff --git a/src/network_inspectors/appid/appid_api.h b/src/network_inspectors/appid/appid_api.h index 4694fc11f..75b270e1f 100644 --- a/src/network_inspectors/appid/appid_api.h +++ b/src/network_inspectors/appid/appid_api.h @@ -22,8 +22,6 @@ #ifndef APPID_API_H #define APPID_API_H -#include - #include "flow/flow.h" enum class IpProtocol : uint8_t; diff --git a/src/network_inspectors/appid/appid_config.cc b/src/network_inspectors/appid/appid_config.cc index beacbff83..d9b56b0b3 100644 --- a/src/network_inspectors/appid/appid_config.cc +++ b/src/network_inspectors/appid/appid_config.cc @@ -18,18 +18,22 @@ //-------------------------------------------------------------------------- // appid_config.cc author Sourcefire Inc. -#include -#include + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "appid_config.h" + +#include +#include + +#include "log/messages.h" +#include "main/snort_debug.h" + #include "app_info_table.h" -#include "appid_utils/network_set.h" -#include "appid_utils/ip_funcs.h" #include "appid_utils/appid_utils.h" -#include "main/snort_debug.h" -#include "log/messages.h" -#include "utils/util.h" -#include "thirdparty_appid_utils.h" +#include "appid_utils/network_set.h" #include "service_plugins/service_base.h" #define ODP_PORT_DETECTORS "odp/port/*" diff --git a/src/network_inspectors/appid/appid_http_event_handler.cc b/src/network_inspectors/appid/appid_http_event_handler.cc index 944557339..ac4aeccdb 100644 --- a/src/network_inspectors/appid/appid_http_event_handler.cc +++ b/src/network_inspectors/appid/appid_http_event_handler.cc @@ -21,12 +21,13 @@ // Receive events from the HTTP inspector containing header information // to be used to detect AppIds. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "appid_http_event_handler.h" -#include "appid_config.h" -#include "appid_session.h" + #include "appid_module.h" -#include "thirdparty_appid_utils.h" -#include "utils/util.h" static void replace_header_data(char **data, uint16_t &datalen, const uint8_t *header_start, int32_t header_length) diff --git a/src/network_inspectors/appid/appid_http_event_handler.h b/src/network_inspectors/appid/appid_http_event_handler.h index c87509702..1381bc10f 100644 --- a/src/network_inspectors/appid/appid_http_event_handler.h +++ b/src/network_inspectors/appid/appid_http_event_handler.h @@ -24,8 +24,6 @@ #ifndef APPID_HTTP_EVENT_HANDLER_H #define APPID_HTTP_EVENT_HANDLER_H -#include "framework/data_bus.h" - #include "pub_sub/http_events.h" class HttpEventHandler : public DataHandler diff --git a/src/network_inspectors/appid/appid_inspector.cc b/src/network_inspectors/appid/appid_inspector.cc index 75bfda4d1..6204c6712 100644 --- a/src/network_inspectors/appid/appid_inspector.cc +++ b/src/network_inspectors/appid/appid_inspector.cc @@ -19,33 +19,32 @@ // appid_inspector.cc author davis mcpherson // Created on: May 10, 2016 -#include "appid_inspector.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "appid_inspector.h" + #include #include "log/messages.h" -#include "main/thread.h" #include "profiler/profiler.h" -#include "appid_stats.h" -#include "appid_session.h" -#include "lua_detector_module.h" -#include "lua_detector_api.h" -#include "host_port_app_cache.h" +#include "pub_sub/sip_events.h" + #include "app_forecast.h" -#include "service_plugins/service_base.h" -#include "service_plugins/service_ssl.h" +#include "appid_http_event_handler.h" +#include "appid_module.h" +#include "appid_stats.h" #include "client_plugins/client_app_base.h" #include "detector_plugins/detector_base.h" #include "detector_plugins/detector_dns.h" #include "detector_plugins/detector_http.h" -#include "detector_plugins/detector_sip.h" #include "detector_plugins/detector_pattern.h" -#include "appid_http_event_handler.h" -#include "pub_sub/sip_events.h" +#include "host_port_app_cache.h" +#include "lua_detector_api.h" +#include "lua_detector_module.h" +#include "service_plugins/service_base.h" +#include "service_plugins/service_ssl.h" static void dump_appid_stats() { diff --git a/src/network_inspectors/appid/appid_inspector.h b/src/network_inspectors/appid/appid_inspector.h index ff2d27936..9e083bb18 100644 --- a/src/network_inspectors/appid/appid_inspector.h +++ b/src/network_inspectors/appid/appid_inspector.h @@ -22,10 +22,10 @@ #ifndef APPID_INSPECTOR_H #define APPID_INSPECTOR_H -#include "main/snort_config.h" -#include "protocols/packet.h" +#include "appid_config.h" -#include "appid_module.h" +struct Packet; +struct SnortConfig; class AppIdInspector : public Inspector { diff --git a/src/network_inspectors/appid/appid_module.cc b/src/network_inspectors/appid/appid_module.cc index e3ceb64a0..daa481470 100644 --- a/src/network_inspectors/appid/appid_module.cc +++ b/src/network_inspectors/appid/appid_module.cc @@ -19,14 +19,14 @@ // appid_module.cc author davis mcpherson // Created on: May 10, 2016 -#include "appid_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "appid_module.h" #include "log/messages.h" #include "profiler/profiler.h" -#include "sfip/sf_ip.h" -#include "utils/util.h" using namespace std; diff --git a/src/network_inspectors/appid/appid_module.h b/src/network_inspectors/appid/appid_module.h index 55516f69d..34204d00e 100644 --- a/src/network_inspectors/appid/appid_module.h +++ b/src/network_inspectors/appid/appid_module.h @@ -22,7 +22,6 @@ #ifndef APPID_MODULE_H #define APPID_MODULE_H -#include "main/snort_types.h" #include "framework/module.h" #include "appid_config.h" diff --git a/src/network_inspectors/appid/appid_session.cc b/src/network_inspectors/appid/appid_session.cc index f6baaa625..621f3616b 100644 --- a/src/network_inspectors/appid/appid_session.cc +++ b/src/network_inspectors/appid/appid_session.cc @@ -18,32 +18,33 @@ //-------------------------------------------------------------------------- // appid_session.cc author Sourcefire Inc. + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "appid_session.h" #include "log/messages.h" #include "main/snort_config.h" -#include "protocols/tcp.h" #include "profiler/profiler.h" -#include "target_based/snort_protocols.h" -#include "sfip/sf_ip.h" +#include "protocols/packet.h" +#include "protocols/tcp.h" #include "stream/stream.h" +#include "target_based/snort_protocols.h" #include "time/packet_time.h" -#include "utils/util.h" +#include "app_forecast.h" #include "app_info_table.h" #include "appid_module.h" #include "appid_stats.h" -#include "app_forecast.h" -#include "host_port_app_cache.h" -#include "lua_detector_module.h" #include "appid_utils/ip_funcs.h" #include "client_plugins/client_app_base.h" -#include "detector_plugins/detector_http.h" #include "detector_plugins/detector_dns.h" +#include "detector_plugins/detector_http.h" +#include "host_port_app_cache.h" #include "service_plugins/service_base.h" #include "service_plugins/service_ssl.h" -#include "service_plugins/service_util.h" - ProfileStats tpPerfStats; ProfileStats tpLibPerfStats; diff --git a/src/network_inspectors/appid/appid_session.h b/src/network_inspectors/appid/appid_session.h index 4dd2d18a1..6ea5da465 100644 --- a/src/network_inspectors/appid/appid_session.h +++ b/src/network_inspectors/appid/appid_session.h @@ -24,17 +24,13 @@ // AppId configuration data structures and access methods -#include -#include - -#include "protocols/packet.h" #include "utils/sflsq.h" #include "appid_api.h" #include "application_ids.h" +#include "http_common.h" #include "length_app_cache.h" #include "service_state.h" -#include "http_common.h" #include "thirdparty_appid_api.h" #include "thirdparty_appid_types.h" #include "thirdparty_appid_utils.h" diff --git a/src/network_inspectors/appid/appid_stats.cc b/src/network_inspectors/appid/appid_stats.cc index bce02e282..7e6cb3261 100644 --- a/src/network_inspectors/appid/appid_stats.cc +++ b/src/network_inspectors/appid/appid_stats.cc @@ -19,22 +19,17 @@ // appid_stats.cc author Sourcefire Inc. -#include "appid_stats.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include +#include "appid_stats.h" #include "log/messages.h" #include "log/unified2.h" -#include "utils/sflsq.h" -#include "utils/util.h" -#include "appid_module.h" -#include "appid_api.h" -#include "appid_session.h" #include "app_info_table.h" +#include "appid_config.h" #include "appid_utils/fw_avltree.h" #define URLCATBUCKETS 100 diff --git a/src/network_inspectors/appid/appid_stats_counter.cc b/src/network_inspectors/appid/appid_stats_counter.cc index 098ab8424..6b35d4809 100644 --- a/src/network_inspectors/appid/appid_stats_counter.cc +++ b/src/network_inspectors/appid/appid_stats_counter.cc @@ -19,7 +19,10 @@ // appid_module.cc author Steve Chew // Created on: Auguest 18, 2016 -#include "main/thread.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "appid_module.h" THREAD_LOCAL AppIdStats appid_stats; diff --git a/src/network_inspectors/appid/appid_utils/appid_utils.cc b/src/network_inspectors/appid/appid_utils/appid_utils.cc index 295d5a6a6..d8ee993e8 100644 --- a/src/network_inspectors/appid/appid_utils/appid_utils.cc +++ b/src/network_inspectors/appid/appid_utils/appid_utils.cc @@ -19,12 +19,14 @@ // sfutil.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "appid_utils.h" #include -#include - -#include "utils/util.h" +#include int AppIdUtils::split(char* data, char** toklist, int max_toks, const char* separator) { diff --git a/src/network_inspectors/appid/appid_utils/fw_avltree.cc b/src/network_inspectors/appid/appid_utils/fw_avltree.cc index ee73bccad..0a0fada33 100644 --- a/src/network_inspectors/appid/appid_utils/fw_avltree.cc +++ b/src/network_inspectors/appid/appid_utils/fw_avltree.cc @@ -19,9 +19,11 @@ // fw_avltree.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "fw_avltree.h" -#include -#include #include "utils/util.h" diff --git a/src/network_inspectors/appid/appid_utils/fw_avltree.h b/src/network_inspectors/appid/appid_utils/fw_avltree.h index ac7853b1f..f51027c2a 100644 --- a/src/network_inspectors/appid/appid_utils/fw_avltree.h +++ b/src/network_inspectors/appid/appid_utils/fw_avltree.h @@ -22,8 +22,8 @@ #ifndef FW_AVL_TREE_H #define FW_AVL_TREE_H -#include -#include +#include +#include struct FwAvlNode { diff --git a/src/network_inspectors/appid/appid_utils/ip_funcs.cc b/src/network_inspectors/appid/appid_utils/ip_funcs.cc index d484513f6..f086f3b87 100644 --- a/src/network_inspectors/appid/appid_utils/ip_funcs.cc +++ b/src/network_inspectors/appid/appid_utils/ip_funcs.cc @@ -19,12 +19,19 @@ // ip_funcs.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ip_funcs.h" -#include "appid_utils.h" +#include + #include "log/messages.h" #include "utils/util.h" +#include "appid_utils.h" + RNAIpAddrSet* ParseIpCidr(char* ipstring, uint32_t* netmasks) { char* toks[2]; diff --git a/src/network_inspectors/appid/appid_utils/ip_funcs.h b/src/network_inspectors/appid/appid_utils/ip_funcs.h index 75c95b9d0..e593e9566 100644 --- a/src/network_inspectors/appid/appid_utils/ip_funcs.h +++ b/src/network_inspectors/appid/appid_utils/ip_funcs.h @@ -22,9 +22,11 @@ #ifndef IP_FUNCS_H #define IP_FUNCS_H -#include -#include "protocols/ipv6.h" +#include +#include + #include "sfip/sf_ip.h" + #include "network_set.h" #define IPFUNCS_EXCEPT_IP 0x01 diff --git a/src/network_inspectors/appid/appid_utils/network_set.cc b/src/network_inspectors/appid/appid_utils/network_set.cc index c93893544..9ceeff5ba 100644 --- a/src/network_inspectors/appid/appid_utils/network_set.cc +++ b/src/network_inspectors/appid/appid_utils/network_set.cc @@ -19,8 +19,14 @@ // network_set.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "network_set.h" +#include + #include "log/messages.h" #include "utils/util.h" diff --git a/src/network_inspectors/appid/appid_utils/network_set.h b/src/network_inspectors/appid/appid_utils/network_set.h index 6439ffbd0..e970700a3 100644 --- a/src/network_inspectors/appid/appid_utils/network_set.h +++ b/src/network_inspectors/appid/appid_utils/network_set.h @@ -22,16 +22,11 @@ #ifndef NETWORK_SET_H #define NETWORK_SET_H -/* System includes */ -#include -#include -#include -#include -#include +#include -#include "utils/sflsq.h" #include "hash/sfxhash.h" #include "protocols/ipv6.h" +#include "utils/sflsq.h" // network_set.h author Sourcefire Inc. diff --git a/src/network_inspectors/appid/appid_utils/sf_mlmp.cc b/src/network_inspectors/appid/appid_utils/sf_mlmp.cc index bab73b70e..048012a65 100644 --- a/src/network_inspectors/appid/appid_utils/sf_mlmp.cc +++ b/src/network_inspectors/appid/appid_utils/sf_mlmp.cc @@ -19,9 +19,11 @@ // sf_mlmp.cc author Sourcefire Inc. -#include "sf_mlmp.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "sf_mlmp.h" #include "main/snort_debug.h" #include "search_engines/search_tool.h" diff --git a/src/network_inspectors/appid/appid_utils/sf_mlmp.h b/src/network_inspectors/appid/appid_utils/sf_mlmp.h index 2cadc18ac..442af8090 100644 --- a/src/network_inspectors/appid/appid_utils/sf_mlmp.h +++ b/src/network_inspectors/appid/appid_utils/sf_mlmp.h @@ -22,8 +22,8 @@ #ifndef SF_MULTI_PART_MPSE_H #define SF_MULTI_PART_MPSE_H -#include -#include +#include +#include struct tMlmpPattern { diff --git a/src/network_inspectors/appid/appid_utils/sf_multi_mpse.cc b/src/network_inspectors/appid/appid_utils/sf_multi_mpse.cc index db6b75c45..02c749112 100644 --- a/src/network_inspectors/appid/appid_utils/sf_multi_mpse.cc +++ b/src/network_inspectors/appid/appid_utils/sf_multi_mpse.cc @@ -19,11 +19,11 @@ // sf_multi_mpse.cc author Sourcefire Inc. -#include "sf_multi_mpse.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "sf_multi_mpse.h" #include "search_engines/search_tool.h" #include "utils/util.h" diff --git a/src/network_inspectors/appid/appid_utils/sf_multi_mpse.h b/src/network_inspectors/appid/appid_utils/sf_multi_mpse.h index d67459b25..b8853de7d 100644 --- a/src/network_inspectors/appid/appid_utils/sf_multi_mpse.h +++ b/src/network_inspectors/appid/appid_utils/sf_multi_mpse.h @@ -22,8 +22,8 @@ #ifndef SF_MULTI_MPSE_H #define SF_MULTI_MPSE_H -#include -#include +#include +#include struct tMlpPattern { diff --git a/src/network_inspectors/appid/client_plugins/client_app_aim.cc b/src/network_inspectors/appid/client_plugins/client_app_aim.cc index dac48fe80..37ef356b4 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_aim.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_aim.cc @@ -19,19 +19,15 @@ // client_app_aim.cc author Sourcefire Inc. -#include "client_app_api.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "client_app_api.h" #include "main/snort_debug.h" -#include "utils/sflsq.h" #include "app_info_table.h" -#include "application_ids.h" #include "appid_module.h" #pragma pack(1) diff --git a/src/network_inspectors/appid/client_plugins/client_app_api.h b/src/network_inspectors/appid/client_plugins/client_app_api.h index 7bdbf9764..f85498439 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_api.h +++ b/src/network_inspectors/appid/client_plugins/client_app_api.h @@ -26,7 +26,6 @@ #include "appid_api.h" #include "appid_session.h" -#include "utils/util.h" struct Packet; class Detector; diff --git a/src/network_inspectors/appid/client_plugins/client_app_base.cc b/src/network_inspectors/appid/client_plugins/client_app_base.cc index c16b4a97d..2e77c588c 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_base.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_base.cc @@ -19,38 +19,26 @@ // client_app_base.cc author Ron Dempster -#include "client_app_base.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include -#include -#include -#include +#include "client_app_base.h" #include "main/snort_debug.h" #include "log/messages.h" #include "protocols/packet.h" -#include "utils/sflsq.h" -#include "utils/util.h" -#include "profiler/profiler.h" -#include "appid_api.h" -#include "appid_config.h" #include "app_info_table.h" +#include "appid_config.h" +#include "detector_plugins/detector_dns.h" +#include "detector_plugins/detector_pattern.h" +#include "detector_plugins/detector_sip.h" + +#include "client_app_aim.h" #include "client_app_api.h" -#include "client_app_base.h" #include "client_app_msn.h" -#include "client_app_aim.h" #include "client_app_ym.h" -#include "detector_plugins/detector_sip.h" -#include "lua_detector_module.h" -#include "lua_detector_api.h" -#include "http_common.h" -#include "service_plugins/service_ssl.h" -#include "detector_plugins/detector_dns.h" -#include "detector_plugins/detector_pattern.h" /*#define CLIENT_APP_DEBUG 1 */ diff --git a/src/network_inspectors/appid/client_plugins/client_app_bit.cc b/src/network_inspectors/appid/client_plugins/client_app_bit.cc index 8ddd508a3..2240efb3d 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_bit.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_bit.cc @@ -19,12 +19,15 @@ // client_app_bit.cc author Sourcefire Inc. -#include "client_app_api.h" -#include "application_ids.h" -#include "appid_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "main/snort_debug.h" -#include "utils/util.h" + +#include "appid_module.h" + +#include "client_app_api.h" static const char BIT_BANNER[] = "\023BitTorrent protocol"; diff --git a/src/network_inspectors/appid/client_plugins/client_app_bit_tracker.cc b/src/network_inspectors/appid/client_plugins/client_app_bit_tracker.cc index ce178600d..c05c29bf6 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_bit_tracker.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_bit_tracker.cc @@ -19,16 +19,16 @@ // client_app_bit_tracker.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/snort_debug.h" -#include "protocols/packet.h" -#include "utils/sflsq.h" -#include "utils/util.h" -#include "app_info_table.h" -#include "application_ids.h" -#include "client_app_api.h" #include "appid_module.h" +#include "client_app_api.h" + static const char UDP_BIT_QUERY[] = "d1:a"; static const char UDP_BIT_RESPONSE[] = "d1:r"; static const char UDP_BIT_ERROR[] = "d1:e"; diff --git a/src/network_inspectors/appid/client_plugins/client_app_config.h b/src/network_inspectors/appid/client_plugins/client_app_config.h index 999b054d0..568b88038 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_config.h +++ b/src/network_inspectors/appid/client_plugins/client_app_config.h @@ -22,8 +22,8 @@ #ifndef CLIENT_APP_CONFIG_H #define CLIENT_APP_CONFIG_H -#include "utils/sflsq.h" #include "search_engines/search_tool.h" +#include "utils/sflsq.h" struct RNAClientAppModule; struct RNAClientAppRecord; diff --git a/src/network_inspectors/appid/client_plugins/client_app_msn.cc b/src/network_inspectors/appid/client_plugins/client_app_msn.cc index 63e99f849..3068132dd 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_msn.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_msn.cc @@ -19,10 +19,15 @@ // client_app_msn.cc author Sourcefire Inc. -#include "client_app_msn.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/snort_debug.h" + +#include "client_app_msn.h" + #include "app_info_table.h" -#include "application_ids.h" #include "appid_module.h" #define MAX_VERSION_SIZE 64 diff --git a/src/network_inspectors/appid/client_plugins/client_app_rtp.cc b/src/network_inspectors/appid/client_plugins/client_app_rtp.cc index f831733c3..406721011 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_rtp.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_rtp.cc @@ -19,15 +19,16 @@ // client_app_rtp.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/snort_debug.h" -#include "protocols/packet.h" -#include "utils/sflsq.h" -#include "utils/util.h" -#include "application_ids.h" -#include "client_app_api.h" #include "appid_module.h" +#include "client_app_api.h" + enum RTPState { RTP_STATE_CONNECTION, diff --git a/src/network_inspectors/appid/client_plugins/client_app_ssh.cc b/src/network_inspectors/appid/client_plugins/client_app_ssh.cc index a2cd2ca1c..acb907a7f 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_ssh.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_ssh.cc @@ -19,16 +19,17 @@ // client_app_ssh.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/snort_debug.h" -#include "protocols/packet.h" -#include "utils/sflsq.h" -#include "utils/util.h" #include "app_info_table.h" -#include "application_ids.h" -#include "client_app_api.h" #include "appid_module.h" +#include "client_app_api.h" + static const char SSH_CLIENT_BANNER[] = "SSH-"; #define SSH_CLIENT_BANNER_LEN (sizeof(SSH_CLIENT_BANNER)-1) #define SSH_CLIENT_BANNER_MAXPOS (sizeof(SSH_CLIENT_BANNER)-2) diff --git a/src/network_inspectors/appid/client_plugins/client_app_timbuktu.cc b/src/network_inspectors/appid/client_plugins/client_app_timbuktu.cc index 1ab22f7d0..220e46f2f 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_timbuktu.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_timbuktu.cc @@ -19,13 +19,12 @@ // client_app_timbuktu.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/snort_debug.h" -#include "protocols/packet.h" -#include "utils/sflsq.h" -#include "utils/util.h" -#include "app_info_table.h" -#include "application_ids.h" #include "client_app_api.h" static const char TIMBUKTU_BANNER[] = "\000\001"; diff --git a/src/network_inspectors/appid/client_plugins/client_app_tns.cc b/src/network_inspectors/appid/client_plugins/client_app_tns.cc index 17a4092d7..dca51db14 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_tns.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_tns.cc @@ -19,16 +19,17 @@ // client_app_tns.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/snort_debug.h" -#include "protocols/packet.h" -#include "utils/sflsq.h" -#include "utils/util.h" #include "app_info_table.h" -#include "application_ids.h" -#include "client_app_api.h" #include "appid_module.h" +#include "client_app_api.h" + static const char TNS_BANNER[] = "\000\000"; #define TNS_BANNER_LEN (sizeof(TNS_BANNER)-1) diff --git a/src/network_inspectors/appid/client_plugins/client_app_vnc.cc b/src/network_inspectors/appid/client_plugins/client_app_vnc.cc index 2abe2d78b..4cf4861f5 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_vnc.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_vnc.cc @@ -19,15 +19,23 @@ // client_app_vnc.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/snort_debug.h" + +#include "app_info_table.h" +#include "appid_module.h" + +#include "client_app_api.h" + +#if 0 #include "protocols/packet.h" #include "utils/sflsq.h" #include "utils/util.h" -#include "app_info_table.h" -#include "application_ids.h" -#include "client_app_api.h" -#include "appid_module.h" +#endif static const char VNC_BANNER[] = "RFB "; static const char VNC_BANNER2[] = "."; diff --git a/src/network_inspectors/appid/client_plugins/client_app_ym.cc b/src/network_inspectors/appid/client_plugins/client_app_ym.cc index 1bf34eb73..a4d1fbc45 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_ym.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_ym.cc @@ -19,15 +19,15 @@ // client_app_ym.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "client_app_ym.h" #include "main/snort_debug.h" -#include "protocols/packet.h" -#include "utils/sflsq.h" #include "app_info_table.h" -#include "application_ids.h" -#include "client_app_api.h" #include "appid_module.h" struct YM_CLIENT_APP_CONFIG diff --git a/src/network_inspectors/appid/detector_plugins/detector_base.cc b/src/network_inspectors/appid/detector_plugins/detector_base.cc index 42f189985..c70cc7d66 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_base.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_base.cc @@ -19,13 +19,18 @@ // detector_base.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detector_base.h" -#include "client_plugins/client_app_base.h" -#include "detector_api.h" #include "log/messages.h" + +#include "client_plugins/client_app_base.h" #include "service_plugins/service_base.h" -#include "detector_plugins/detector_smtp.h" + +#include "detector_smtp.h" static void* detector_flowdata_get(AppIdSession* asd, unsigned detector_id); static int detector_flowdata_add(AppIdSession* asd, void* data, unsigned detector_id, diff --git a/src/network_inspectors/appid/detector_plugins/detector_dns.cc b/src/network_inspectors/appid/detector_plugins/detector_dns.cc index c083df75c..e3c31d3e3 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_dns.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_dns.cc @@ -19,17 +19,17 @@ // detector_dns.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detector_dns.h" #include "main/snort_debug.h" -#include "utils/util.h" -#include "appid_module.h" #include "app_info_table.h" -#include "application_ids.h" +#include "appid_module.h" #include "client_plugins/client_app_api.h" -#include "service_plugins/service_api.h" -#include "service_plugins/service_config.h" #define MAX_OPCODE 5 #define INVALID_OPCODE 3 diff --git a/src/network_inspectors/appid/detector_plugins/detector_http.cc b/src/network_inspectors/appid/detector_plugins/detector_http.cc index bb3e768d9..32873bc2d 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_http.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_http.cc @@ -19,20 +19,22 @@ // detector_http.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detector_http.h" -#include "search_engines/search_tool.h" #include "main/snort_debug.h" -#include "sfip/sf_ip.h" - -#include "service_plugins/service_api.h" -#include "service_plugins/service_util.h" -#include "appid_utils/sf_mlmp.h" -#include "utils/util.h" +#include "protocols/packet.h" +#include "search_engines/search_tool.h" #include "app_info_table.h" -#include "application_ids.h" +#include "appid_config.h" +#include "appid_utils/sf_mlmp.h" #include "client_plugins/client_app_base.h" +#include "service_plugins/service_util.h" + #include "http_url_patterns.h" /* URL line patterns for identifying client */ diff --git a/src/network_inspectors/appid/detector_plugins/detector_imap.cc b/src/network_inspectors/appid/detector_plugins/detector_imap.cc index 27c76e88d..5375a22bb 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_imap.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_imap.cc @@ -19,26 +19,20 @@ // detector_imap.cc author Sourcefire Inc. -#include -#include -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "detector_api.h" + +#include "main/snort_debug.h" +#include "search_engines/search_tool.h" + #include "app_info_table.h" -#include "application_ids.h" -#include "appid_api.h" -#include "appid_config.h" #include "appid_module.h" #include "client_plugins/client_app_api.h" #include "service_plugins/service_api.h" -#include "main/snort_debug.h" -#include "search_engines/search_tool.h" -#include "utils/util.h" - static const unsigned IMAP_USER_NAME_MAX_LEN = 32; static const unsigned IMAP_TAG_MAX_LEN = 6; static const unsigned MIN_CMDS = 3; diff --git a/src/network_inspectors/appid/detector_plugins/detector_kerberos.cc b/src/network_inspectors/appid/detector_plugins/detector_kerberos.cc index 74ebe92f1..08e846b74 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_kerberos.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_kerberos.cc @@ -19,15 +19,18 @@ // detector_kerberos.cc author Sourcefire Inc. -#include "appid_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "main/snort_debug.h" +#include "protocols/packet.h" + #include "app_info_table.h" -#include "application_ids.h" +#include "appid_module.h" #include "client_plugins/client_app_api.h" #include "service_plugins/service_api.h" -#include "main/snort_debug.h" -#include "utils/util.h" - enum KerberosState { KRB_STATE_TCP_LENGTH, diff --git a/src/network_inspectors/appid/detector_plugins/detector_pattern.cc b/src/network_inspectors/appid/detector_plugins/detector_pattern.cc index 2b621dacb..58c7c674e 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_pattern.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_pattern.cc @@ -19,14 +19,20 @@ // detector_pattern.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detector_pattern.h" -#include "app_info_table.h" -#include "client_plugins/client_app_base.h" -#include "service_plugins/service_api.h" #include "log/messages.h" #include "main/snort_debug.h" -#include "utils/util.h" +#include "protocols/packet.h" +#include "search_engines/search_tool.h" + +#include "app_info_table.h" +#include "client_plugins/client_app_base.h" +#include "service_plugins/service_api.h" static THREAD_LOCAL ServicePortPattern service_port_patterns; static THREAD_LOCAL ClientPortPattern clientPortPattern; diff --git a/src/network_inspectors/appid/detector_plugins/detector_pop3.cc b/src/network_inspectors/appid/detector_plugins/detector_pop3.cc index cd80b55fb..a226cdf64 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_pop3.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_pop3.cc @@ -19,19 +19,20 @@ // detector_pop3.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "detector_api.h" + +#include "main/snort_debug.h" +#include "search_engines/search_tool.h" + #include "app_info_table.h" -#include "application_ids.h" #include "appid_module.h" #include "client_plugins/client_app_api.h" -#include "detector_plugins/detector_api.h" -#include "service_plugins/service_api.h" #include "service_plugins/service_util.h" -#include "log/messages.h" -#include "main/snort_debug.h" -#include "search_engines/search_tool.h" -#include "utils/util.h" - /*#define DEBUG_POP3 1 */ struct POP3_CLIENT_APP_CONFIG diff --git a/src/network_inspectors/appid/detector_plugins/detector_sip.cc b/src/network_inspectors/appid/detector_plugins/detector_sip.cc index 940ff432d..659a5150d 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_sip.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_sip.cc @@ -19,29 +19,26 @@ // detector_sip.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detector_sip.h" -#include "log/messages.h" #include "main/snort_debug.h" -#include "utils/util.h" +#include "protocols/packet.h" #include "pub_sub/sip_events.h" -#include "service_inspectors/sip/sip_common.h" -#include "appid_module.h" #include "app_info_table.h" +#include "appid_module.h" +#include "appid_utils/sf_mlmp.h" #include "client_plugins/client_app_api.h" #include "service_plugins/service_base.h" + #include "http_url_patterns.h" -#include "appid_utils/sf_mlmp.h" using namespace std; -#include "app_info_table.h" -#include "client_plugins/client_app_api.h" -#include "service_plugins/service_base.h" -#include "http_url_patterns.h" -#include "appid_utils/sf_mlmp.h" - static const char SIP_REGISTER_BANNER[] = "REGISTER "; static const char SIP_INVITE_BANNER[] = "INVITE "; static const char SIP_CANCEL_BANNER[] = "CANCEL "; diff --git a/src/network_inspectors/appid/detector_plugins/detector_smtp.cc b/src/network_inspectors/appid/detector_plugins/detector_smtp.cc index c01d8525f..85cd9f5bb 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_smtp.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_smtp.cc @@ -18,20 +18,18 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "detector_smtp.h" -#include "main/snort_debug.h" -#include "utils/util.h" -#include "utils/sflsq.h" +#include "protocols/packet.h" -#include "application_ids.h" -#include "detector_api.h" -#include "client_plugins/client_app_api.h" -#include "service_plugins/service_util.h" #include "app_info_table.h" -#include "appid_api.h" #include "appid_module.h" +#include "client_plugins/client_app_api.h" +#include "service_plugins/service_util.h" enum SMTPClientState { diff --git a/src/network_inspectors/appid/detector_plugins/http_url_patterns.cc b/src/network_inspectors/appid/detector_plugins/http_url_patterns.cc index cc4ae897c..67e2545ed 100644 --- a/src/network_inspectors/appid/detector_plugins/http_url_patterns.cc +++ b/src/network_inspectors/appid/detector_plugins/http_url_patterns.cc @@ -19,17 +19,17 @@ // http_url_patterns.cc author Sourcefire Inc. -#include "http_url_patterns.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "http_url_patterns.h" #include "log/messages.h" +#include "utils/util.h" -#include "application_ids.h" -#include "http_common.h" -#include "appid_utils/sf_multi_mpse.h" #include "appid_utils/sf_mlmp.h" -#include "utils/util.h" +#include "application_ids.h" static const char* const FP_OPERATION_AND = "%&%"; static const unsigned PATTERN_PART_MAX = 10; diff --git a/src/network_inspectors/appid/detector_plugins/test/detector_smtp_test.cc b/src/network_inspectors/appid/detector_plugins/test/detector_smtp_test.cc index 2679f5026..1528f257b 100644 --- a/src/network_inspectors/appid/detector_plugins/test/detector_smtp_test.cc +++ b/src/network_inspectors/appid/detector_plugins/test/detector_smtp_test.cc @@ -19,6 +19,10 @@ // client_app_smtp_test.cc author Steve Chew // unit test for client_app_smtp +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "network_inspectors/appid/detector_plugins/detector_smtp.cc" #include diff --git a/src/network_inspectors/appid/errors.sh b/src/network_inspectors/appid/errors.sh deleted file mode 100755 index f340defc3..000000000 --- a/src/network_inspectors/appid/errors.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# run make on selected files from MANIFEST.txt - -USAGE="$0 [-h] [] []" - -if [[ $1 == -h ]]; then - echo $USAGE >&2 - exit -fi - -file_status=$1 -cisco_username=$2 -filter= - -if [[ -n "$file_status" ]]; then - filter="$filter *$file_status" -fi - -if [[ -n "$cisco_username" ]]; then - filter="$filter *$USER" -fi - -grep -v ^# MANIFEST.txt | while IFS='' read -r line || [[ -n "$line" ]]; do - echo $line | grep "$filter" >/dev/null && { - filename=$(echo $line | awk '{print $1}') - make "${filename%.*}_${filename##*.}" >/dev/null || echo $filename - } -done diff --git a/src/network_inspectors/appid/host_port_app_cache.cc b/src/network_inspectors/appid/host_port_app_cache.cc index 69671de9d..5775a5ced 100644 --- a/src/network_inspectors/appid/host_port_app_cache.cc +++ b/src/network_inspectors/appid/host_port_app_cache.cc @@ -19,13 +19,16 @@ // host_port_app_cache.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "host_port_app_cache.h" #include -#include "appid_config.h" #include "log/messages.h" -#include "sfip/sf_ip.h" +#include "utils/cpp_macros.h" PADDING_GUARD_BEGIN struct HostPortKey diff --git a/src/network_inspectors/appid/host_port_app_cache.h b/src/network_inspectors/appid/host_port_app_cache.h index f5a3d1c2b..fee1e98de 100644 --- a/src/network_inspectors/appid/host_port_app_cache.h +++ b/src/network_inspectors/appid/host_port_app_cache.h @@ -22,7 +22,6 @@ #ifndef HOST_PORT_APP_CACHE_H #define HOST_PORT_APP_CACHE_H -#include "sfip/sf_ip.h" #include "appid_api.h" struct HostPortVal diff --git a/src/network_inspectors/appid/http_common.h b/src/network_inspectors/appid/http_common.h index 5afe8df12..f7d94d46c 100644 --- a/src/network_inspectors/appid/http_common.h +++ b/src/network_inspectors/appid/http_common.h @@ -22,10 +22,11 @@ #ifndef HTTP_COMMON_H #define HTTP_COMMON_H -#include "appid_api.h" -#include "appid_utils/sf_multi_mpse.h" +#include + +#include "flow/flow.h" -#include "utils/sflsq.h" +#include "appid_utils/sf_multi_mpse.h" #define MAX_USERNAME_SIZE 64 #define MAX_URL_SIZE 65535 diff --git a/src/network_inspectors/appid/ips_appid_option.cc b/src/network_inspectors/appid/ips_appid_option.cc index c9cc81eb7..4381e3f8d 100644 --- a/src/network_inspectors/appid/ips_appid_option.cc +++ b/src/network_inspectors/appid/ips_appid_option.cc @@ -19,28 +19,20 @@ // ips_appid_option.cc author: davis mcpherson -#include // std::mismatch -#include // std::vector -#include // std::pair - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "app_info_table.h" - -#include "main/snort_debug.h" +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" -#include "detection/detect.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" -#include "log/messages.h" #include "profiler/profiler.h" -#include "stream/stream.h" +#include "protocols/packet.h" #include "utils/util.h" +#include "app_info_table.h" + //------------------------------------------------------------------------- // appid option //------------------------------------------------------------------------- diff --git a/src/network_inspectors/appid/length_app_cache.cc b/src/network_inspectors/appid/length_app_cache.cc index 2e87d42d8..3eb4564d0 100644 --- a/src/network_inspectors/appid/length_app_cache.cc +++ b/src/network_inspectors/appid/length_app_cache.cc @@ -19,12 +19,15 @@ // length_app_cache.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "length_app_cache.h" #include "hash/sfxhash.h" #include "log/messages.h" -#include "appid_config.h" #include "application_ids.h" #define HASH_NUM_ROWS (1024) diff --git a/src/network_inspectors/appid/length_app_cache.h b/src/network_inspectors/appid/length_app_cache.h index 5f415575e..c31669923 100644 --- a/src/network_inspectors/appid/length_app_cache.h +++ b/src/network_inspectors/appid/length_app_cache.h @@ -22,7 +22,7 @@ #ifndef LENGTH_APP_CACHE_H #define LENGTH_APP_CACHE_H -#include "appid_api.h" +#include "flow/flow.h" #define LENGTH_SEQUENCE_CNT_MAX (5) diff --git a/src/network_inspectors/appid/lua_detector_api.cc b/src/network_inspectors/appid/lua_detector_api.cc index 9ce654007..f3a6bd252 100644 --- a/src/network_inspectors/appid/lua_detector_api.cc +++ b/src/network_inspectors/appid/lua_detector_api.cc @@ -19,35 +19,33 @@ // lua_detector_api.cc author Sourcefire Inc. -#include "lua_detector_api.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "lua_detector_api.h" -#include #include +#include #include "hash/sfxhash.h" #include "log/messages.h" #include "main/snort_debug.h" #include "profiler/profiler.h" -#include "protocols/protocol_ids.h" -#include "sfip/sf_ip.h" -#include "utils/util.h" +#include "protocols/packet.h" -#include "appid_module.h" #include "app_forecast.h" #include "app_info_table.h" +#include "appid_module.h" +#include "client_plugins/client_app_base.h" +#include "detector_plugins/detector_dns.h" +#include "detector_plugins/detector_http.h" +#include "detector_plugins/detector_pattern.h" #include "host_port_app_cache.h" -#include "http_common.h" #include "lua_detector_flow_api.h" #include "lua_detector_module.h" #include "lua_detector_util.h" #include "service_plugins/service_base.h" -#include "service_plugins/service_ssl.h" -#include "client_plugins/client_app_base.h" -#include "detector_plugins/detector_dns.h" -#include "detector_plugins/detector_http.h" -#include "detector_plugins/detector_pattern.h" #define DETECTOR "Detector" #define OVECCOUNT 30 /* should be a multiple of 3 */ diff --git a/src/network_inspectors/appid/lua_detector_api.h b/src/network_inspectors/appid/lua_detector_api.h index bc00e0c73..ec6f2bd9e 100644 --- a/src/network_inspectors/appid/lua_detector_api.h +++ b/src/network_inspectors/appid/lua_detector_api.h @@ -24,9 +24,6 @@ // This module supports basic API towards Lua detectors. -#include -#include - #include "client_plugins/client_app_api.h" #include "service_plugins/service_api.h" diff --git a/src/network_inspectors/appid/lua_detector_flow_api.cc b/src/network_inspectors/appid/lua_detector_flow_api.cc index 3ce5837f8..fea82b26e 100644 --- a/src/network_inspectors/appid/lua_detector_flow_api.cc +++ b/src/network_inspectors/appid/lua_detector_flow_api.cc @@ -19,17 +19,16 @@ // lua_detector_flow_api.cc author Sourcefire Inc. -#include "lua_detector_flow_api.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "lua_detector_flow_api.h" #include "appid_api.h" -#include "log/messages.h" #include "lua_detector_api.h" -#include "lua_detector_util.h" #include "lua_detector_module.h" -#include "main/snort_debug.h" -#include "sfip/sf_ip.h" +#include "lua_detector_util.h" /* Lua flag bit/index to C flag value (0 for invalid). */ static const uint64_t FLAGS_TABLE_LUA_TO_C[32] diff --git a/src/network_inspectors/appid/lua_detector_module.cc b/src/network_inspectors/appid/lua_detector_module.cc index d3e7fb6eb..5a748edac 100644 --- a/src/network_inspectors/appid/lua_detector_module.cc +++ b/src/network_inspectors/appid/lua_detector_module.cc @@ -21,24 +21,25 @@ // supporting Lua detectors in core engine. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "lua_detector_module.h" -#include #include #include -#include -#include -#include "appid_config.h" -#include "client_plugins/client_app_base.h" -#include "service_plugins/service_base.h" #include "log/messages.h" #include "lua/lua.h" -#include "lua_detector_util.h" +#include "main/snort_debug.h" + +#include "appid_config.h" +#include "client_plugins/client_app_base.h" #include "lua_detector_api.h" #include "lua_detector_flow_api.h" -#include "main/snort_debug.h" -#include "utils/util.h" +#include "lua_detector_util.h" +#include "service_plugins/service_base.h" #define MAX_LUA_DETECTOR_FILENAME_LEN 1024 #define MAX_DEFAULT_NUM_LUA_TRACKERS 10000 diff --git a/src/network_inspectors/appid/lua_detector_module.h b/src/network_inspectors/appid/lua_detector_module.h index 02c1c4f07..eaa964e44 100644 --- a/src/network_inspectors/appid/lua_detector_module.h +++ b/src/network_inspectors/appid/lua_detector_module.h @@ -22,11 +22,9 @@ #ifndef LUA_DETECTOR_MODULE_H #define LUA_DETECTOR_MODULE_H +#include #include -#include "main/thread.h" -#include "utils/sflsq.h" - class AppIdConfig; class Detector; struct DetectorFlow; diff --git a/src/network_inspectors/appid/lua_detector_util.h b/src/network_inspectors/appid/lua_detector_util.h index f857a65e4..d98e4dfe8 100644 --- a/src/network_inspectors/appid/lua_detector_util.h +++ b/src/network_inspectors/appid/lua_detector_util.h @@ -24,10 +24,10 @@ // encapsulate Lua interface boilerplate to get sane, identical behavior across users -#include - #include +#include + template struct UserData { diff --git a/src/network_inspectors/appid/service_plugins/dcerpc.cc b/src/network_inspectors/appid/service_plugins/dcerpc.cc index 1f6f373ae..c66e22355 100644 --- a/src/network_inspectors/appid/service_plugins/dcerpc.cc +++ b/src/network_inspectors/appid/service_plugins/dcerpc.cc @@ -19,9 +19,13 @@ // dcerpc.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dcerpc.h" -#include +#include #define min(x,y) ((x)<(y) ? (x) : (y)) diff --git a/src/network_inspectors/appid/service_plugins/dcerpc.h b/src/network_inspectors/appid/service_plugins/dcerpc.h index 89c77632b..66ca3adb5 100644 --- a/src/network_inspectors/appid/service_plugins/dcerpc.h +++ b/src/network_inspectors/appid/service_plugins/dcerpc.h @@ -22,7 +22,7 @@ #ifndef DCERPC_H #define DCERPC_H -#include +#include int dcerpc_validate(const uint8_t* data, int size); diff --git a/src/network_inspectors/appid/service_plugins/service_base.cc b/src/network_inspectors/appid/service_plugins/service_base.cc index ea48c9c05..21f69fc43 100644 --- a/src/network_inspectors/appid/service_plugins/service_base.cc +++ b/src/network_inspectors/appid/service_plugins/service_base.cc @@ -19,13 +19,27 @@ // service_base.cc author Ron Dempster +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_base.h" -#include #include -#include + +#include "log/messages.h" +#include "main/snort_debug.h" +#include "protocols/packet.h" +#include "search_engines/search_tool.h" #include "app_info_table.h" +#include "appid_config.h" +#include "appid_utils/ip_funcs.h" +#include "detector_plugins/detector_dns.h" +#include "detector_plugins/detector_pattern.h" +#include "detector_plugins/detector_sip.h" +#include "lua_detector_api.h" + #include "service_api.h" #include "service_battle_field.h" #include "service_bgp.h" @@ -54,20 +68,6 @@ #include "service_ssl.h" #include "service_telnet.h" #include "service_tftp.h" -#include "appid_session.h" -#include "appid_config.h" -#include "lua_detector_api.h" -#include "lua_detector_module.h" -#include "appid_utils/ip_funcs.h" -#include "detector_plugins/detector_dns.h" -#include "detector_plugins/detector_pattern.h" -#include "detector_plugins/detector_sip.h" - -#include "log/messages.h" -#include "main/snort_debug.h" -#include "search_engines/search_tool.h" -#include "utils/util.h" -#include "sfip/sf_ip.h" //#define SERVICE_DEBUG 1 //#define SERVICE_DEBUG_PORT 80 diff --git a/src/network_inspectors/appid/service_plugins/service_base.h b/src/network_inspectors/appid/service_plugins/service_base.h index ec0af5fc9..917c18aba 100644 --- a/src/network_inspectors/appid/service_plugins/service_base.h +++ b/src/network_inspectors/appid/service_plugins/service_base.h @@ -22,12 +22,9 @@ #ifndef SERVICE_BASE_H #define SERVICE_BASE_H -#include - #include "appid_api.h" #include "appid_session.h" #include "service_api.h" -#include "sfip/sf_ip.h" class AppIdConfig; class AppIdSession; diff --git a/src/network_inspectors/appid/service_plugins/service_battle_field.cc b/src/network_inspectors/appid/service_plugins/service_battle_field.cc index 83f42a2fa..31939bf89 100644 --- a/src/network_inspectors/appid/service_plugins/service_battle_field.cc +++ b/src/network_inspectors/appid/service_plugins/service_battle_field.cc @@ -19,12 +19,15 @@ // service_battle_field.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_battle_field.h" -#include "appid_module.h" -#include "application_ids.h" -#include "main/snort_debug.h" -#include "utils/util.h" +#include "protocols/packet.h" + +#include "appid_module.h" enum CONNECTION_STATES { diff --git a/src/network_inspectors/appid/service_plugins/service_bgp.cc b/src/network_inspectors/appid/service_plugins/service_bgp.cc index 34d070f29..b9ff4a970 100644 --- a/src/network_inspectors/appid/service_plugins/service_bgp.cc +++ b/src/network_inspectors/appid/service_plugins/service_bgp.cc @@ -19,12 +19,15 @@ // service_bgp.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_bgp.h" -#include "appid_module.h" -#include "application_ids.h" #include "main/snort_debug.h" -#include "utils/util.h" + +#include "appid_module.h" static const unsigned BGP_PORT = 179; diff --git a/src/network_inspectors/appid/service_plugins/service_bit.cc b/src/network_inspectors/appid/service_plugins/service_bit.cc index 7dd2e3fbc..c4ef09c2b 100644 --- a/src/network_inspectors/appid/service_plugins/service_bit.cc +++ b/src/network_inspectors/appid/service_plugins/service_bit.cc @@ -19,13 +19,15 @@ // service_bit.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "main/snort_debug.h" -#include "application_ids.h" -#include "service_api.h" #include "appid_module.h" -#include "main/snort_debug.h" -#include "utils/util.h" +#include "service_api.h" static const char svc_name[] = "bt"; static const uint8_t BIT_BANNER[] = "\023BitTorrent protocol"; diff --git a/src/network_inspectors/appid/service_plugins/service_bootp.cc b/src/network_inspectors/appid/service_plugins/service_bootp.cc index c70abcac4..57971c402 100644 --- a/src/network_inspectors/appid/service_plugins/service_bootp.cc +++ b/src/network_inspectors/appid/service_plugins/service_bootp.cc @@ -19,11 +19,17 @@ // service_bootp.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_bootp.h" + #include "main/snort_debug.h" #include "protocols/eth.h" +#include "protocols/packet.h" + #include "app_info_table.h" -#include "application_ids.h" #include "appid_module.h" #define DHCP_MAGIC_COOKIE 0x63825363 diff --git a/src/network_inspectors/appid/service_plugins/service_config.h b/src/network_inspectors/appid/service_plugins/service_config.h index dae68fbfa..75dc1ec13 100644 --- a/src/network_inspectors/appid/service_plugins/service_config.h +++ b/src/network_inspectors/appid/service_plugins/service_config.h @@ -24,8 +24,6 @@ // Service detector configuration -#include - #include "service_api.h" #define RNA_SERVICE_MAX_PORT 65536 diff --git a/src/network_inspectors/appid/service_plugins/service_dcerpc.cc b/src/network_inspectors/appid/service_plugins/service_dcerpc.cc index d8ce28865..70b40db7d 100644 --- a/src/network_inspectors/appid/service_plugins/service_dcerpc.cc +++ b/src/network_inspectors/appid/service_plugins/service_dcerpc.cc @@ -19,13 +19,17 @@ // service_dcerpc.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_dcerpc.h" -#include "appid_module.h" -#include "application_ids.h" -#include "dcerpc.h" #include "main/snort_debug.h" -#include "utils/util.h" + +#include "appid_module.h" + +#include "dcerpc.h" #define DCERPC_THRESHOLD 3 diff --git a/src/network_inspectors/appid/service_plugins/service_direct_connect.cc b/src/network_inspectors/appid/service_plugins/service_direct_connect.cc index d799b713e..ce1153bee 100644 --- a/src/network_inspectors/appid/service_plugins/service_direct_connect.cc +++ b/src/network_inspectors/appid/service_plugins/service_direct_connect.cc @@ -19,11 +19,13 @@ // service_direct_connect.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_direct_connect.h" -#include "application_ids.h" #include "main/snort_debug.h" -#include "utils/util.h" #include "appid_module.h" diff --git a/src/network_inspectors/appid/service_plugins/service_flap.cc b/src/network_inspectors/appid/service_plugins/service_flap.cc index 91f502a91..04eceea7b 100644 --- a/src/network_inspectors/appid/service_plugins/service_flap.cc +++ b/src/network_inspectors/appid/service_plugins/service_flap.cc @@ -19,11 +19,13 @@ // service_flap.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_flap.h" -#include "application_ids.h" #include "main/snort_debug.h" -#include "utils/util.h" #define FLAP_PORT 5190 diff --git a/src/network_inspectors/appid/service_plugins/service_ftp.cc b/src/network_inspectors/appid/service_plugins/service_ftp.cc index fb9a566c7..cbcb94f65 100644 --- a/src/network_inspectors/appid/service_plugins/service_ftp.cc +++ b/src/network_inspectors/appid/service_plugins/service_ftp.cc @@ -19,19 +19,20 @@ // service_ftp.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_ftp.h" #include "main/snort_debug.h" -#include "sfip/sf_ip.h" -#include "utils/util.h" +#include "protocols/packet.h" #include "app_info_table.h" -#include "appid_api.h" -#include "appid_session.h" -#include "application_ids.h" +#include "appid_module.h" + #include "service_base.h" #include "service_util.h" -#include "appid_module.h" #define FTP_PORT 21 diff --git a/src/network_inspectors/appid/service_plugins/service_irc.cc b/src/network_inspectors/appid/service_plugins/service_irc.cc index 67bf44178..3e6028e41 100644 --- a/src/network_inspectors/appid/service_plugins/service_irc.cc +++ b/src/network_inspectors/appid/service_plugins/service_irc.cc @@ -19,13 +19,14 @@ // service_irc.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_irc.h" #include "main/snort_debug.h" -#include "utils/util.h" -#include "appid_session.h" -#include "application_ids.h" #include "appid_module.h" #define IRC_COUNT_THRESHOLD 10 diff --git a/src/network_inspectors/appid/service_plugins/service_lpr.cc b/src/network_inspectors/appid/service_plugins/service_lpr.cc index 6acb90e46..099bcb013 100644 --- a/src/network_inspectors/appid/service_plugins/service_lpr.cc +++ b/src/network_inspectors/appid/service_plugins/service_lpr.cc @@ -19,13 +19,14 @@ // service_lpr.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/snort_debug.h" -#include "utils/util.h" #include "appid_module.h" -#include "application_ids.h" -#include "appid_session.h" -#include "app_info_table.h" + #include "service_api.h" #define LPR_COUNT_THRESHOLD 2 diff --git a/src/network_inspectors/appid/service_plugins/service_mdns.cc b/src/network_inspectors/appid/service_plugins/service_mdns.cc index 28144785d..0e1918cba 100644 --- a/src/network_inspectors/appid/service_plugins/service_mdns.cc +++ b/src/network_inspectors/appid/service_plugins/service_mdns.cc @@ -19,26 +19,19 @@ // service_mdns.cc author Sourcefire Inc. -#include "service_mdns.h" - -#include "appid_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "appid_config.h" -#include "app_info_table.h" -#include "appid_session.h" -#include "http_common.h" -#include "lua_detector_api.h" -#include "service_api.h" -#include "service_base.h" -#include "service_ssl.h" -#include "client_plugins/client_app_base.h" -#include "detector_plugins/http_url_patterns.h" -#include "detector_plugins/detector_http.h" +#include "service_mdns.h" #include "main/snort_debug.h" -#include "utils/util.h" +#include "protocols/packet.h" #include "search_engines/search_tool.h" +#include "app_info_table.h" +#include "appid_module.h" + #define MDNS_PORT 5353 #define PATTERN_REFERENCE_PTR 3 #define PATTERN_STR_LOCAL_1 "\005local" diff --git a/src/network_inspectors/appid/service_plugins/service_mysql.cc b/src/network_inspectors/appid/service_plugins/service_mysql.cc index 2bacb599a..60da22a4c 100644 --- a/src/network_inspectors/appid/service_plugins/service_mysql.cc +++ b/src/network_inspectors/appid/service_plugins/service_mysql.cc @@ -19,15 +19,15 @@ // service_mysql.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_mysql.h" #include "main/snort_debug.h" -#include "application_ids.h" #include "app_info_table.h" -#include "appid_session.h" - -#include "service_api.h" #include "appid_module.h" #pragma pack(1) diff --git a/src/network_inspectors/appid/service_plugins/service_netbios.cc b/src/network_inspectors/appid/service_plugins/service_netbios.cc index 609e19636..594760b37 100644 --- a/src/network_inspectors/appid/service_plugins/service_netbios.cc +++ b/src/network_inspectors/appid/service_plugins/service_netbios.cc @@ -19,23 +19,19 @@ // service_netbios.cc author Sourcefire Inc. -#include "service_netbios.h" - #ifdef HAVE_CONFIG_H -#include "config.h" /* for WORDS_BIGENDIAN */ +#include "config.h" #endif -#include "log/messages.h" +#include "service_netbios.h" + #include "main/snort_debug.h" -#include "utils/util.h" +#include "protocols/packet.h" -#include "appid_module.h" #include "app_info_table.h" -#include "appid_api.h" -#include "appid_session.h" -#include "application_ids.h" +#include "appid_module.h" + #include "dcerpc.h" -#include "service_api.h" /*#define RNA_DEBUG_NETBIOS 1 */ diff --git a/src/network_inspectors/appid/service_plugins/service_nntp.cc b/src/network_inspectors/appid/service_plugins/service_nntp.cc index c796acfec..ab656fb86 100644 --- a/src/network_inspectors/appid/service_plugins/service_nntp.cc +++ b/src/network_inspectors/appid/service_plugins/service_nntp.cc @@ -19,15 +19,15 @@ // service_nntp.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_nntp.h" #include "main/snort_debug.h" -#include "utils/util.h" -#include "appid_session.h" #include "appid_module.h" -#include "application_ids.h" -#include "service_api.h" #define NNTP_PORT 119 diff --git a/src/network_inspectors/appid/service_plugins/service_ntp.cc b/src/network_inspectors/appid/service_plugins/service_ntp.cc index 2735cf9f3..49172f563 100644 --- a/src/network_inspectors/appid/service_plugins/service_ntp.cc +++ b/src/network_inspectors/appid/service_plugins/service_ntp.cc @@ -19,14 +19,15 @@ // service_ntp.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_ntp.h" #include "main/snort_debug.h" -#include "appid_session.h" #include "appid_module.h" -#include "application_ids.h" -#include "service_api.h" #pragma pack(1) diff --git a/src/network_inspectors/appid/service_plugins/service_radius.cc b/src/network_inspectors/appid/service_plugins/service_radius.cc index 806f6ae63..5ae424f92 100644 --- a/src/network_inspectors/appid/service_plugins/service_radius.cc +++ b/src/network_inspectors/appid/service_plugins/service_radius.cc @@ -19,15 +19,15 @@ // service_radius.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_radius.h" #include "main/snort_debug.h" -#include "utils/util.h" #include "app_info_table.h" -#include "appid_session.h" -#include "application_ids.h" -#include "service_api.h" #include "appid_module.h" #define RADIUS_CODE_ACCESS_REQUEST 1 diff --git a/src/network_inspectors/appid/service_plugins/service_rexec.cc b/src/network_inspectors/appid/service_plugins/service_rexec.cc index ad1bd868d..db02527dd 100644 --- a/src/network_inspectors/appid/service_plugins/service_rexec.cc +++ b/src/network_inspectors/appid/service_plugins/service_rexec.cc @@ -19,25 +19,18 @@ // service_rexec.cc author Sourcefire Inc. -#include "service_rexec.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include -#include -#include +#include "service_rexec.h" -#include "protocols/packet.h" #include "main/snort_debug.h" -#include "utils/util.h" +#include "protocols/packet.h" -#include "appid_api.h" #include "app_info_table.h" -#include "appid_session.h" #include "appid_module.h" -#include "application_ids.h" -#include "service_api.h" + #include "service_base.h" #include "service_util.h" diff --git a/src/network_inspectors/appid/service_plugins/service_rfb.cc b/src/network_inspectors/appid/service_plugins/service_rfb.cc index 37461a1fe..786140099 100644 --- a/src/network_inspectors/appid/service_plugins/service_rfb.cc +++ b/src/network_inspectors/appid/service_plugins/service_rfb.cc @@ -19,14 +19,18 @@ // service_rfb.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_rfb.h" -#include "service_api.h" +#include "main/snort_debug.h" + #include "app_info_table.h" -#include "application_ids.h" #include "appid_module.h" -#include "main/snort_debug.h" +#include "service_api.h" #define RFB_BANNER_SIZE 12 diff --git a/src/network_inspectors/appid/service_plugins/service_rlogin.cc b/src/network_inspectors/appid/service_plugins/service_rlogin.cc index 9f40866f9..ac9b4eda0 100644 --- a/src/network_inspectors/appid/service_plugins/service_rlogin.cc +++ b/src/network_inspectors/appid/service_plugins/service_rlogin.cc @@ -19,15 +19,19 @@ // service_rlogin.cc author Sourcefire Inc. -#include "service_rlogin.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "service_api.h" -#include "application_ids.h" -#include "appid_module.h" +#include "service_rlogin.h" #include "main/snort_debug.h" +#include "protocols/packet.h" #include "protocols/tcp.h" -#include "utils/util.h" + +#include "appid_module.h" + +#include "service_api.h" #define RLOGIN_PASSWORD "Password: " enum RLOGINState diff --git a/src/network_inspectors/appid/service_plugins/service_rpc.cc b/src/network_inspectors/appid/service_plugins/service_rpc.cc index 76483a44b..cbb518a99 100644 --- a/src/network_inspectors/appid/service_plugins/service_rpc.cc +++ b/src/network_inspectors/appid/service_plugins/service_rpc.cc @@ -19,12 +19,12 @@ // service_rpc.cc author Sourcefire Inc. -#include "service_rpc.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "service_rpc.h" + #include #if defined(__FreeBSD__) || defined(__OpenBSD__) @@ -33,16 +33,15 @@ #include #endif -#include "application_ids.h" -#include "service_api.h" -#include "app_info_table.h" -#include "service_util.h" - -#include "log/messages.h" #include "main/snort_debug.h" -#include "utils/util.h" +#include "protocols/packet.h" + +#include "app_info_table.h" #include "appid_module.h" +#include "service_api.h" +#include "service_util.h" + /*#define RNA_DEBUG_RPC 1 */ enum RPCState diff --git a/src/network_inspectors/appid/service_plugins/service_rshell.cc b/src/network_inspectors/appid/service_plugins/service_rshell.cc index faf280b46..c06db1b15 100644 --- a/src/network_inspectors/appid/service_plugins/service_rshell.cc +++ b/src/network_inspectors/appid/service_plugins/service_rshell.cc @@ -19,18 +19,21 @@ // service_rshell.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_rshell.h" -#include "application_ids.h" -#include "service_api.h" -#include "service_base.h" -#include "service_util.h" +#include "log/messages.h" +#include "main/snort_debug.h" +#include "protocols/packet.h" + #include "app_info_table.h" #include "appid_module.h" -#include "log/messages.h" -#include "main/snort_debug.h" -#include "utils/util.h" +#include "service_base.h" +#include "service_util.h" #define RSHELL_PORT 514 #define RSHELL_MAX_PORT_PACKET 6 diff --git a/src/network_inspectors/appid/service_plugins/service_rsync.cc b/src/network_inspectors/appid/service_plugins/service_rsync.cc index f44c4c12e..74f0a44d7 100644 --- a/src/network_inspectors/appid/service_plugins/service_rsync.cc +++ b/src/network_inspectors/appid/service_plugins/service_rsync.cc @@ -19,16 +19,17 @@ // service_rsync.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_rsync.h" -#include "application_ids.h" -#include "service_api.h" +#include "main/snort_debug.h" + #include "app_info_table.h" #include "appid_module.h" -#include "main/snort_debug.h" -#include "utils/util.h" - #define RSYNC_PORT 873 #define RSYNC_BANNER "@RSYNCD: " diff --git a/src/network_inspectors/appid/service_plugins/service_rtmp.cc b/src/network_inspectors/appid/service_plugins/service_rtmp.cc index db849da14..1f8ff32bd 100644 --- a/src/network_inspectors/appid/service_plugins/service_rtmp.cc +++ b/src/network_inspectors/appid/service_plugins/service_rtmp.cc @@ -19,16 +19,18 @@ // service_rtmp.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_rtmp.h" -#include "application_ids.h" -#include "service_api.h" +#include "main/snort_debug.h" + #include "app_info_table.h" #include "appid_module.h" -#include "log/messages.h" -#include "main/snort_debug.h" -#include "utils/util.h" +#include "service_api.h" #define RTMP_PORT 1935 diff --git a/src/network_inspectors/appid/service_plugins/service_snmp.cc b/src/network_inspectors/appid/service_plugins/service_snmp.cc index 06490bce7..1733ea3ba 100644 --- a/src/network_inspectors/appid/service_plugins/service_snmp.cc +++ b/src/network_inspectors/appid/service_plugins/service_snmp.cc @@ -19,17 +19,21 @@ // service_snmp.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_snmp.h" #include "log/messages.h" -#include "utils/util.h" +#include "main/snort_debug.h" +#include "protocols/packet.h" -#include "appid_api.h" -#include "appid_module.h" #include "app_info_table.h" +#include "appid_module.h" + #include "service_base.h" #include "service_util.h" -#include "application_ids.h" #define SNMP_PORT 161 diff --git a/src/network_inspectors/appid/service_plugins/service_ssh.cc b/src/network_inspectors/appid/service_plugins/service_ssh.cc index f6dc58a08..6dbc554ea 100644 --- a/src/network_inspectors/appid/service_plugins/service_ssh.cc +++ b/src/network_inspectors/appid/service_plugins/service_ssh.cc @@ -19,14 +19,19 @@ // service_ssh.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_ssh.h" -#include "app_info_table.h" -#include "service_base.h" -#include "application_ids.h" -#include "utils/util.h" +#include "main/snort_debug.h" + +#include "app_info_table.h" #include "appid_module.h" +#include "service_base.h" + #define SSH_PORT 22 #define SSH_BANNER "SSH-" diff --git a/src/network_inspectors/appid/service_plugins/service_ssl.cc b/src/network_inspectors/appid/service_plugins/service_ssl.cc index acb7bcd4e..3d829121a 100644 --- a/src/network_inspectors/appid/service_plugins/service_ssl.cc +++ b/src/network_inspectors/appid/service_plugins/service_ssl.cc @@ -19,24 +19,21 @@ // service_ssl.cc author Sourcefire Inc. -#include -#include -#include -#include -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "appid_module.h" -#include "app_info_table.h" -#include "appid_session.h" -#include "service_config.h" -#include "service_base.h" #include "service_ssl.h" +#include + +#include + #include "main/snort_debug.h" -#include "utils/util.h" +#include "protocols/packet.h" + +#include "app_info_table.h" +#include "appid_module.h" #define SSL_PORT 443 diff --git a/src/network_inspectors/appid/service_plugins/service_telnet.cc b/src/network_inspectors/appid/service_plugins/service_telnet.cc index 9cf8ef670..08110bb85 100644 --- a/src/network_inspectors/appid/service_plugins/service_telnet.cc +++ b/src/network_inspectors/appid/service_plugins/service_telnet.cc @@ -19,21 +19,16 @@ // service_telnet.cc author Sourcefire Inc. -#include -#include -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "main/snort_debug.h" -#include "utils/util.h" -#include "appid_session.h" -#include "application_ids.h" -#include "service_api.h" #include "appid_module.h" +#include "service_api.h" + #define TELNET_COUNT_THRESHOLD 3 #define TELNET_IAC 255 diff --git a/src/network_inspectors/appid/service_plugins/service_tftp.cc b/src/network_inspectors/appid/service_plugins/service_tftp.cc index 20578b24f..cab134ace 100644 --- a/src/network_inspectors/appid/service_plugins/service_tftp.cc +++ b/src/network_inspectors/appid/service_plugins/service_tftp.cc @@ -19,24 +19,17 @@ // service_tftp.cc author Sourcefire Inc. -#include -#include -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "main/snort_debug.h" #include "log/messages.h" -#include "target_based/snort_protocols.h" -#include "utils/util.h" +#include "main/snort_debug.h" +#include "protocols/packet.h" #include "app_info_table.h" -#include "appid_api.h" -#include "appid_session.h" #include "appid_module.h" -#include "application_ids.h" -#include "service_api.h" + #include "service_base.h" #include "service_util.h" diff --git a/src/network_inspectors/appid/service_plugins/service_timbuktu.cc b/src/network_inspectors/appid/service_plugins/service_timbuktu.cc index 13d3b1fc9..0832f4d20 100644 --- a/src/network_inspectors/appid/service_plugins/service_timbuktu.cc +++ b/src/network_inspectors/appid/service_plugins/service_timbuktu.cc @@ -19,13 +19,15 @@ // service_timbuktu.cc author Sourcefire Inc. -#include "appid_module.h" -#include "appid_session.h" -#include "application_ids.h" -#include "service_api.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "main/snort_debug.h" -#include "utils/util.h" + +#include "appid_module.h" + +#include "service_api.h" static const char svc_name[] = "timbuktu"; static char TIMBUKTU_BANNER[] = "\001\001"; diff --git a/src/network_inspectors/appid/service_plugins/service_tns.cc b/src/network_inspectors/appid/service_plugins/service_tns.cc index 7da715d4e..660635d09 100644 --- a/src/network_inspectors/appid/service_plugins/service_tns.cc +++ b/src/network_inspectors/appid/service_plugins/service_tns.cc @@ -19,14 +19,16 @@ // service_tns.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "main/snort_debug.h" + #include "app_info_table.h" -#include "appid_session.h" #include "appid_module.h" -#include "application_ids.h" -#include "service_api.h" -#include "main/snort_debug.h" -#include "utils/util.h" +#include "service_api.h" static const char svc_name[] = "oracle"; static const uint8_t TNS_BANNER[] = "\000\000"; diff --git a/src/network_inspectors/appid/service_plugins/service_util.h b/src/network_inspectors/appid/service_plugins/service_util.h index de8a0c4d1..6dcff2a3e 100644 --- a/src/network_inspectors/appid/service_plugins/service_util.h +++ b/src/network_inspectors/appid/service_plugins/service_util.h @@ -22,8 +22,6 @@ #ifndef SERVICE_UTIL_H #define SERVICE_UTIL_H -#include -#include #include #include "main/snort_config.h" diff --git a/src/network_inspectors/appid/service_plugins/test/service_rsync_test.cc b/src/network_inspectors/appid/service_plugins/test/service_rsync_test.cc index 235f69305..8b1e13e1a 100644 --- a/src/network_inspectors/appid/service_plugins/test/service_rsync_test.cc +++ b/src/network_inspectors/appid/service_plugins/test/service_rsync_test.cc @@ -19,6 +19,10 @@ // service_rsync_test.cc author Steve Chew // unit test for service_rsync +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "network_inspectors/appid/service_plugins/service_rsync.cc" #include diff --git a/src/network_inspectors/appid/service_state.cc b/src/network_inspectors/appid/service_state.cc index b4b136be6..6df1de74e 100644 --- a/src/network_inspectors/appid/service_state.cc +++ b/src/network_inspectors/appid/service_state.cc @@ -19,14 +19,18 @@ // service_state.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_state.h" #include #include "log/messages.h" -#include "service_plugins/service_base.h" -#include "sfip/sf_ip.h" -#include "utils/util.h" +#include "utils/cpp_macros.h" + +#include "service_plugins/service_api.h" //#define DEBUG_SERVICE_STATE 1 diff --git a/src/network_inspectors/appid/test/appid_http_event_test.cc b/src/network_inspectors/appid/test/appid_http_event_test.cc index 2e7ec084d..5038661d6 100644 --- a/src/network_inspectors/appid/test/appid_http_event_test.cc +++ b/src/network_inspectors/appid/test/appid_http_event_test.cc @@ -19,6 +19,10 @@ // appid_http_event_test.cc author Steve Chew // unit test for the http inspection event handler. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + // Must be included before CppUTest files to avoid compiler error. #include "network_inspectors/appid/appid_http_event_handler.cc" diff --git a/src/network_inspectors/appid/thirdparty_appid_api.h b/src/network_inspectors/appid/thirdparty_appid_api.h index 9414f9154..e00a22afa 100644 --- a/src/network_inspectors/appid/thirdparty_appid_api.h +++ b/src/network_inspectors/appid/thirdparty_appid_api.h @@ -22,11 +22,10 @@ #ifndef THIRDPARTY_APPID_API_H #define THIRDPARTY_APPID_API_H -#include "protocols/packet.h" - -#include "appid_api.h" #include "thirdparty_appid_types.h" +struct Packet; + #define THIRD_PARTY_APP_ID_API_VERSION 1 #define TP_PATH_MAX 4096 diff --git a/src/network_inspectors/appid/thirdparty_appid_types.h b/src/network_inspectors/appid/thirdparty_appid_types.h index 437b4111b..3bf01be48 100644 --- a/src/network_inspectors/appid/thirdparty_appid_types.h +++ b/src/network_inspectors/appid/thirdparty_appid_types.h @@ -22,7 +22,6 @@ #ifndef THIRDPARTY_APPID_TYPES_H #define THIRDPARTY_APPID_TYPES_H -#include #include "http_common.h" #define TP_SESSION_FLAG_DPI 0x00000001 diff --git a/src/network_inspectors/appid/thirdparty_appid_utils.cc b/src/network_inspectors/appid/thirdparty_appid_utils.cc index 8d92de14e..3de963a61 100644 --- a/src/network_inspectors/appid/thirdparty_appid_utils.cc +++ b/src/network_inspectors/appid/thirdparty_appid_utils.cc @@ -19,12 +19,17 @@ // thirdparty_appid_utils.cc author Sourcefire Inc. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "thirdparty_appid_utils.h" #include -#include "main/snort_debug.h" #include "log/messages.h" +#include "main/snort_debug.h" + #include "appid_config.h" #include "thirdparty_appid_api.h" diff --git a/src/network_inspectors/arp_spoof/arp_module.cc b/src/network_inspectors/arp_spoof/arp_module.cc index d32da07ff..5191d812e 100644 --- a/src/network_inspectors/arp_spoof/arp_module.cc +++ b/src/network_inspectors/arp_spoof/arp_module.cc @@ -18,6 +18,10 @@ // arp_module.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "arp_module.h" #define ARPSPOOF_UNICAST_ARP_REQUEST_STR \ diff --git a/src/network_inspectors/arp_spoof/arp_module.h b/src/network_inspectors/arp_spoof/arp_module.h index 0ea2841d6..971ca80aa 100644 --- a/src/network_inspectors/arp_spoof/arp_module.h +++ b/src/network_inspectors/arp_spoof/arp_module.h @@ -21,10 +21,7 @@ #ifndef ARP_SPOOF_MODULE_H #define ARP_SPOOF_MODULE_H -#include - #include "framework/module.h" -#include "main/thread.h" #define MOD_NAME "arp_spoof" #define MOD_HELP "detect ARP attacks and anomalies" diff --git a/src/network_inspectors/arp_spoof/arp_spoof.cc b/src/network_inspectors/arp_spoof/arp_spoof.cc index 579c7965d..986592694 100644 --- a/src/network_inspectors/arp_spoof/arp_spoof.cc +++ b/src/network_inspectors/arp_spoof/arp_spoof.cc @@ -66,34 +66,21 @@ */ /* I N C L U D E S ************************************************/ -#include "arp_module.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include - -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/detect.h" -#include "events/event.h" #include "events/event_queue.h" -#include "parser/parser.h" -#include "utils/util.h" +#include "log/messages.h" #include "profiler/profiler.h" -#include "framework/inspector.h" -#include "protocols/packet.h" -#include "protocols/layer.h" #include "protocols/arp.h" #include "protocols/eth.h" +#include "protocols/packet.h" #include "sfip/sf_ip.h" +#include "arp_module.h" + static const uint8_t bcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; THREAD_LOCAL ProfileStats arpPerfStats; diff --git a/src/network_inspectors/binder/bind_module.cc b/src/network_inspectors/binder/bind_module.cc index 8da71ddc5..0983d4b78 100644 --- a/src/network_inspectors/binder/bind_module.cc +++ b/src/network_inspectors/binder/bind_module.cc @@ -18,22 +18,17 @@ // bind_module.cc author Russ Combs -#include "bind_module.h" - -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "bind_module.h" -#include "binding.h" -#include "protocols/packet.h" -#include "parser/parse_ip.h" #include "log/messages.h" -#include "main/policy.h" -#include "main/snort_config.h" #include "main/shell.h" -#include "managers/module_manager.h" -#include "parser/parser.h" +#include "main/snort_config.h" +#include "parser/parse_ip.h" +#include "protocols/packet.h" using namespace std; diff --git a/src/network_inspectors/binder/bind_module.h b/src/network_inspectors/binder/bind_module.h index 7d8cc5110..7df6c4589 100644 --- a/src/network_inspectors/binder/bind_module.h +++ b/src/network_inspectors/binder/bind_module.h @@ -23,10 +23,7 @@ // binder management interface -#include - #include "framework/module.h" -#include "main/thread.h" #include "binding.h" #define BIND_NAME "binder" @@ -40,7 +37,6 @@ struct BindStats extern THREAD_LOCAL BindStats bstats; extern THREAD_LOCAL ProfileStats bindPerfStats; -struct Binding; class BinderModule : public Module { diff --git a/src/network_inspectors/binder/binder.cc b/src/network_inspectors/binder/binder.cc index 33044da0c..6bf4ac128 100644 --- a/src/network_inspectors/binder/binder.cc +++ b/src/network_inspectors/binder/binder.cc @@ -17,31 +17,26 @@ //-------------------------------------------------------------------------- // binder.cc author Russ Combs -#include "binder.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "binder.h" -#include "binding.h" -#include "bind_module.h" #include "flow/flow.h" -#include "flow/session.h" -#include "framework/inspector.h" +#include "flow/flow_key.h" +#include "log/messages.h" +#include "main/snort_config.h" #include "managers/inspector_manager.h" -#include "managers/plugin_manager.h" +#include "profiler/profiler.h" #include "protocols/packet.h" -#include "protocols/vlan.h" -#include "protocols/layer.h" +#include "stream/stream.h" #include "stream/stream_splitter.h" -#include "profiler/profiler.h" -#include "utils/stats.h" -#include "log/messages.h" -#include "main/snort_config.h" -#include "main/policy.h" -#include "parser/parser.h" -#include "target_based/sftarget_data.h" -#include "target_based/snort_protocols.h" #include "target_based/sftarget_reader.h" -#include "packet_io/active.h" +#include "target_based/snort_protocols.h" + +#include "bind_module.h" +#include "binding.h" using namespace std; diff --git a/src/network_inspectors/binder/test/binder_test.cc b/src/network_inspectors/binder/test/binder_test.cc index 1d5499c83..33f56e3c0 100644 --- a/src/network_inspectors/binder/test/binder_test.cc +++ b/src/network_inspectors/binder/test/binder_test.cc @@ -19,6 +19,10 @@ // binder_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "network_inspectors/binder/binder.cc" #include "network_inspectors/binder/bind_module.h" diff --git a/src/network_inspectors/network_inspectors.cc b/src/network_inspectors/network_inspectors.cc index 3c02009ed..805a7e42a 100644 --- a/src/network_inspectors/network_inspectors.cc +++ b/src/network_inspectors/network_inspectors.cc @@ -22,7 +22,6 @@ #include "config.h" #endif -#include "framework/inspector.h" #include "managers/plugin_manager.h" extern const BaseApi* nin_binder; diff --git a/src/network_inspectors/normalize/norm.cc b/src/network_inspectors/normalize/norm.cc index 7e2680457..3a7cf047c 100644 --- a/src/network_inspectors/normalize/norm.cc +++ b/src/network_inspectors/normalize/norm.cc @@ -17,24 +17,20 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "norm.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "norm.h" #include "main/snort_config.h" #include "packet_io/sfdaq.h" -#include "protocols/ipv4.h" +#include "protocols/icmp4.h" +#include "protocols/icmp6.h" #include "protocols/ipv4_options.h" #include "protocols/tcp.h" #include "protocols/tcp_options.h" -#include "protocols/icmp4.h" -#include "protocols/icmp6.h" #include "stream/tcp/tcp_normalizer.h" -#include "utils/stats.h" enum PegCounts { diff --git a/src/network_inspectors/normalize/norm.h b/src/network_inspectors/normalize/norm.h index 3f5fb9310..8c86667db 100644 --- a/src/network_inspectors/normalize/norm.h +++ b/src/network_inspectors/normalize/norm.h @@ -20,8 +20,8 @@ #ifndef NORM_H #define NORM_H -#include "normalize.h" #include "protocols/packet_manager.h" +#include "normalize.h" struct NormalizerConfig; struct Packet; diff --git a/src/network_inspectors/normalize/norm_module.cc b/src/network_inspectors/normalize/norm_module.cc index 273ac05a8..ac3510224 100644 --- a/src/network_inspectors/normalize/norm_module.cc +++ b/src/network_inspectors/normalize/norm_module.cc @@ -17,13 +17,13 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "norm_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include +#include "norm_module.h" +#include "main/policy.h" #include "stream/tcp/tcp_normalizer.h" using namespace std; diff --git a/src/network_inspectors/normalize/norm_module.h b/src/network_inspectors/normalize/norm_module.h index ecae99c55..a907bed4a 100644 --- a/src/network_inspectors/normalize/norm_module.h +++ b/src/network_inspectors/normalize/norm_module.h @@ -21,9 +21,6 @@ #ifndef NORM_MODULE_H #define NORM_MODULE_H -#include -#include - #include "framework/module.h" #include "norm.h" diff --git a/src/network_inspectors/normalize/normalize.cc b/src/network_inspectors/normalize/normalize.cc index 097f85639..9edf89462 100644 --- a/src/network_inspectors/normalize/normalize.cc +++ b/src/network_inspectors/normalize/normalize.cc @@ -17,19 +17,19 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "normalize.h" -#include "norm.h" -#include "norm_module.h" +#include "log/messages.h" +#include "main/policy.h" #include "packet_io/active.h" #include "packet_io/sfdaq.h" -#include "parser/parser.h" #include "profiler/profiler.h" -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "framework/inspector.h" -#include "flow/flow.h" + +#include "norm_module.h" THREAD_LOCAL ProfileStats norm_perf_stats; static THREAD_LOCAL uint32_t t_flags = 0; diff --git a/src/network_inspectors/normalize/normalize.h b/src/network_inspectors/normalize/normalize.h index a461351ef..c2ed2d47f 100644 --- a/src/network_inspectors/normalize/normalize.h +++ b/src/network_inspectors/normalize/normalize.h @@ -20,10 +20,6 @@ #ifndef NORMALIZE_H #define NORMALIZE_H -#include -#include - -#include "main/policy.h" #include "framework/counts.h" // these control protocol specific normalizations diff --git a/src/network_inspectors/packet_capture/capture_module.cc b/src/network_inspectors/packet_capture/capture_module.cc index f694c363e..a73bc7fc8 100644 --- a/src/network_inspectors/packet_capture/capture_module.cc +++ b/src/network_inspectors/packet_capture/capture_module.cc @@ -18,13 +18,17 @@ // capture_module.cc author Carter Waxman +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "capture_module.h" #include -#include "packet_capture.h" #include "profiler/profiler.h" -#include "utils/util.h" + +#include "packet_capture.h" using namespace std; diff --git a/src/network_inspectors/packet_capture/packet_capture.cc b/src/network_inspectors/packet_capture/packet_capture.cc index 4ffeb8a68..e01886e86 100644 --- a/src/network_inspectors/packet_capture/packet_capture.cc +++ b/src/network_inspectors/packet_capture/packet_capture.cc @@ -26,19 +26,17 @@ #include #include -#include #include "framework/inspector.h" #include "log/messages.h" -#include "main/snort_config.h" -#include "main/thread.h" #include "protocols/packet.h" -#include "utils/util.h" #ifdef UNIT_TEST #include "catch/catch.hpp" #endif +#include "capture_module.h" + using namespace std; #define FILE_NAME "packet_capture.pcap" diff --git a/src/network_inspectors/packet_capture/packet_capture.h b/src/network_inspectors/packet_capture/packet_capture.h index 532307405..fe7559c19 100644 --- a/src/network_inspectors/packet_capture/packet_capture.h +++ b/src/network_inspectors/packet_capture/packet_capture.h @@ -20,7 +20,7 @@ #ifndef PACKET_CAPTURE_H #define PACKET_CAPTURE_H -#include "capture_module.h" +#include void packet_capture_enable(std::string); void packet_capture_disable(); diff --git a/src/network_inspectors/perf_monitor/base_tracker.cc b/src/network_inspectors/perf_monitor/base_tracker.cc index 502f2cf7f..947be95d6 100644 --- a/src/network_inspectors/perf_monitor/base_tracker.cc +++ b/src/network_inspectors/perf_monitor/base_tracker.cc @@ -18,10 +18,11 @@ // base_tracker.cc author Carter Waxman -#include "base_tracker.h" // FIXIT-W Returning null reference (from ) -#include "perf_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "framework/module.h" +#include "base_tracker.h" // FIXIT-W Returning null reference (from ) #ifdef UNIT_TEST #include "catch/catch.hpp" diff --git a/src/network_inspectors/perf_monitor/cpu_tracker.cc b/src/network_inspectors/perf_monitor/cpu_tracker.cc index beb870dd1..e876fd62c 100644 --- a/src/network_inspectors/perf_monitor/cpu_tracker.cc +++ b/src/network_inspectors/perf_monitor/cpu_tracker.cc @@ -18,24 +18,26 @@ // cpu_tracker.cc author Carter Waxman -#include "cpu_tracker.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "utils/stats.h" -#include "utils/util.h" +#include "cpu_tracker.h" #include +#include #ifdef __APPLE__ #include #include #endif -#define CPU_FILE (PERF_NAME "_cpu.csv") - #ifdef UNIT_TEST #include "catch/catch.hpp" #endif +#define CPU_FILE (PERF_NAME "_cpu.csv") + static inline uint64_t get_microseconds(struct timeval t) { return (uint64_t)t.tv_sec * 1000000 + t.tv_usec; diff --git a/src/network_inspectors/perf_monitor/cpu_tracker.h b/src/network_inspectors/perf_monitor/cpu_tracker.h index 95b2473c7..145745d4b 100644 --- a/src/network_inspectors/perf_monitor/cpu_tracker.h +++ b/src/network_inspectors/perf_monitor/cpu_tracker.h @@ -21,11 +21,8 @@ #ifndef CPU_TRACKER_H #define CPU_TRACKER_H -#include "perf_module.h" #include "perf_tracker.h" -#include - class CPUTracker : public PerfTracker { public: diff --git a/src/network_inspectors/perf_monitor/csv_formatter.cc b/src/network_inspectors/perf_monitor/csv_formatter.cc index 1d47e4262..c65032145 100644 --- a/src/network_inspectors/perf_monitor/csv_formatter.cc +++ b/src/network_inspectors/perf_monitor/csv_formatter.cc @@ -18,6 +18,10 @@ // csv_formatter.cc author Carter Waxman +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "csv_formatter.h" #include diff --git a/src/network_inspectors/perf_monitor/flow_ip_tracker.cc b/src/network_inspectors/perf_monitor/flow_ip_tracker.cc index 6a47b2032..d68e31d86 100644 --- a/src/network_inspectors/perf_monitor/flow_ip_tracker.cc +++ b/src/network_inspectors/perf_monitor/flow_ip_tracker.cc @@ -18,14 +18,14 @@ // flow_ip_tracker.cc author Carter Waxman +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "flow_ip_tracker.h" #include "log/messages.h" -#include "sfip/sf_ip.h" -#include "utils/util.h" -#include "utils/util_net.h" - -#include "perf_module.h" +#include "protocols/packet.h" #define FLIP_FILE (PERF_NAME "_flow_ip.csv") diff --git a/src/network_inspectors/perf_monitor/flow_tracker.cc b/src/network_inspectors/perf_monitor/flow_tracker.cc index 09c487f1d..ca73a99c3 100644 --- a/src/network_inspectors/perf_monitor/flow_tracker.cc +++ b/src/network_inspectors/perf_monitor/flow_tracker.cc @@ -18,13 +18,16 @@ // flow_tracker.cc author Carter Waxman +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "flow_tracker.h" -#include "perf_module.h" #include "protocols/icmp4.h" +#include "protocols/packet.h" #include "protocols/tcp.h" #include "protocols/udp.h" -#include "utils/util.h" #ifdef UNIT_TEST #include "catch/catch.hpp" diff --git a/src/network_inspectors/perf_monitor/perf_formatter.cc b/src/network_inspectors/perf_monitor/perf_formatter.cc index dd02de49e..70b2b5c77 100644 --- a/src/network_inspectors/perf_monitor/perf_formatter.cc +++ b/src/network_inspectors/perf_monitor/perf_formatter.cc @@ -18,6 +18,10 @@ // perf_formatter.cc author Carter Waxman +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "perf_formatter.h" using namespace std; diff --git a/src/network_inspectors/perf_monitor/perf_formatter.h b/src/network_inspectors/perf_monitor/perf_formatter.h index 16bc37577..524c990a6 100644 --- a/src/network_inspectors/perf_monitor/perf_formatter.h +++ b/src/network_inspectors/perf_monitor/perf_formatter.h @@ -43,11 +43,11 @@ // ouput open. // -#include - #include #include +#include "framework/counts.h" + union FormatterValue { PegCount* pc; diff --git a/src/network_inspectors/perf_monitor/perf_module.cc b/src/network_inspectors/perf_monitor/perf_module.cc index ed93ef869..155020914 100644 --- a/src/network_inspectors/perf_monitor/perf_module.cc +++ b/src/network_inspectors/perf_monitor/perf_module.cc @@ -18,11 +18,13 @@ // perf_module.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "perf_module.h" #include "managers/module_manager.h" -#include "managers/plugin_manager.h" -#include "utils/util.h" //------------------------------------------------------------------------- // perf attributes diff --git a/src/network_inspectors/perf_monitor/perf_monitor.cc b/src/network_inspectors/perf_monitor/perf_monitor.cc index 6d1bcda23..548943f46 100644 --- a/src/network_inspectors/perf_monitor/perf_monitor.cc +++ b/src/network_inspectors/perf_monitor/perf_monitor.cc @@ -28,31 +28,16 @@ #include "config.h" #endif -#include -#include -#include -#include - -#include - #include "perf_monitor.h" -#include "perf_module.h" #include "log/messages.h" -#include "main/snort_config.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "parser/parser.h" -#include "packet_io/sfdaq.h" #include "profiler/profiler.h" -#include "framework/inspector.h" -#include "utils/stats.h" -#include "utils/util.h" +#include "protocols/packet.h" #include "base_tracker.h" #include "cpu_tracker.h" -#include "flow_tracker.h" #include "flow_ip_tracker.h" +#include "flow_tracker.h" #ifdef UNIT_TEST #include "catch/catch.hpp" diff --git a/src/network_inspectors/perf_monitor/perf_monitor.h b/src/network_inspectors/perf_monitor/perf_monitor.h index 8c59a827d..4a4986033 100644 --- a/src/network_inspectors/perf_monitor/perf_monitor.h +++ b/src/network_inspectors/perf_monitor/perf_monitor.h @@ -24,12 +24,9 @@ // These are the basic functions and structures that are needed to call // performance functions. -#include #include "perf_module.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "main/thread.h" -#include "protocols/packet.h" + +struct Packet; extern PerfConfig* perfmon_config; // FIXIT-M shouldn't be needed externally extern THREAD_LOCAL bool perfmon_rotate_perf_file; diff --git a/src/network_inspectors/perf_monitor/perf_tracker.cc b/src/network_inspectors/perf_monitor/perf_tracker.cc index e157b86c7..057149e64 100644 --- a/src/network_inspectors/perf_monitor/perf_tracker.cc +++ b/src/network_inspectors/perf_monitor/perf_tracker.cc @@ -18,20 +18,22 @@ // perf_tracker.cc author Carter Waxman -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "perf_tracker.h" -#include "csv_formatter.h" -#include "perf_module.h" -#include "text_formatter.h" +#include +#include #include "log/messages.h" #include "main/snort_config.h" -#include "main/thread.h" -#include "parser/parser.h" #include "utils/util.h" +#include "csv_formatter.h" +#include "text_formatter.h" + static inline bool check_file_size(FILE* fh, uint64_t max_file_size) { int fd; diff --git a/src/network_inspectors/perf_monitor/text_formatter.cc b/src/network_inspectors/perf_monitor/text_formatter.cc index 92429aacd..9c0f818ac 100644 --- a/src/network_inspectors/perf_monitor/text_formatter.cc +++ b/src/network_inspectors/perf_monitor/text_formatter.cc @@ -18,6 +18,10 @@ // text_formatter.cc author Carter Waxman +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "text_formatter.h" #include diff --git a/src/network_inspectors/port_scan/ipobj.cc b/src/network_inspectors/port_scan/ipobj.cc index 4cc40fa2b..83d695f1a 100644 --- a/src/network_inspectors/port_scan/ipobj.cc +++ b/src/network_inspectors/port_scan/ipobj.cc @@ -26,21 +26,14 @@ objects, and collections of IP ADDRESSes as objects */ -#include "ipobj.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "ipobj.h" #include "protocols/packet.h" #include "utils/util.h" -#include "utils/snort_bounds.h" -#include "sfip/sf_ip.h" /* IP COLLECTION INTERFACE diff --git a/src/network_inspectors/port_scan/ipobj.h b/src/network_inspectors/port_scan/ipobj.h index 2e4d94356..a3d230076 100644 --- a/src/network_inspectors/port_scan/ipobj.h +++ b/src/network_inspectors/port_scan/ipobj.h @@ -30,12 +30,8 @@ #ifndef IPOBJ_H #define IPOBJ_H -#include -#include -#include - -#include "utils/sflsq.h" #include "sfip/sf_cidr.h" +#include "utils/sflsq.h" struct PORTRANGE { diff --git a/src/network_inspectors/port_scan/port_scan.cc b/src/network_inspectors/port_scan/port_scan.cc index c00c842c2..0a113c188 100644 --- a/src/network_inspectors/port_scan/port_scan.cc +++ b/src/network_inspectors/port_scan/port_scan.cc @@ -42,31 +42,19 @@ #include "config.h" #endif -#include -#include -#include - -#include - -#include "ps_detect.h" -#include "ps_inspect.h" -#include "ps_module.h" - -#include "ipobj.h" -#include "log/messages.h" -#include "main/snort_config.h" -#include "managers/inspector_manager.h" -#include "protocols/packet_manager.h" -#include "protocols/packet.h" +#include "detection/detect.h" #include "events/event.h" #include "events/event_wrapper.h" #include "filters/sfthreshold.h" -#include "utils/util.h" -#include "utils/sfsnprintfappend.h" -#include "framework/inspector.h" +#include "log/messages.h" +#include "managers/inspector_manager.h" #include "profiler/profiler.h" -#include "time/packet_time.h" -#include "detection/detect.h" +#include "protocols/packet_manager.h" +#include "utils/sfsnprintfappend.h" +#include "utils/util.h" + +#include "ps_inspect.h" +#include "ps_module.h" #define PROTO_BUFFER_SIZE 256 diff --git a/src/network_inspectors/port_scan/ps_detect.cc b/src/network_inspectors/port_scan/ps_detect.cc index b17265bb5..e56c8098f 100644 --- a/src/network_inspectors/port_scan/ps_detect.cc +++ b/src/network_inspectors/port_scan/ps_detect.cc @@ -31,30 +31,22 @@ ** on hosts that are portscanned. This idea makes portscan a lot more ** useful for analysts. */ -#include "ps_detect.h" -#include "ps_inspect.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "ps_detect.h" -#include "ipobj.h" +#include "hash/sfxhash.h" #include "log/messages.h" -#include "main/snort_config.h" +#include "protocols/icmp4.h" #include "protocols/packet.h" -#include "time/packet_time.h" -#include "hash/sfxhash.h" #include "protocols/tcp.h" -#include "protocols/udp.h" -#include "protocols/icmp4.h" -#include "protocols/icmp6.h" -#include "protocols/eth.h" -#include "sfip/sf_ip.h" #include "stream/stream.h" +#include "time/packet_time.h" +#include "utils/cpp_macros.h" + +#include "ps_inspect.h" PADDING_GUARD_BEGIN typedef struct s_PS_HASH_KEY diff --git a/src/network_inspectors/port_scan/ps_detect.h b/src/network_inspectors/port_scan/ps_detect.h index bf8c35768..b7b85290a 100644 --- a/src/network_inspectors/port_scan/ps_detect.h +++ b/src/network_inspectors/port_scan/ps_detect.h @@ -20,11 +20,11 @@ #ifndef PS_DETECT_H #define PS_DETECT_H -#include #include +#include -#include "ipobj.h" #include "sfip/sf_ip.h" +#include "ipobj.h" #define PS_OPEN_PORTS 8 diff --git a/src/network_inspectors/port_scan/ps_inspect.h b/src/network_inspectors/port_scan/ps_inspect.h index a406f9932..be73364c9 100644 --- a/src/network_inspectors/port_scan/ps_inspect.h +++ b/src/network_inspectors/port_scan/ps_inspect.h @@ -21,9 +21,6 @@ #ifndef PS_INSPECT_H #define PS_INSPECT_H -#include -#include - #include "framework/inspector.h" #include "ps_detect.h" diff --git a/src/network_inspectors/port_scan/ps_module.cc b/src/network_inspectors/port_scan/ps_module.cc index b71179ba5..074fbd6fc 100644 --- a/src/network_inspectors/port_scan/ps_module.cc +++ b/src/network_inspectors/port_scan/ps_module.cc @@ -18,8 +18,14 @@ // ps_module.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ps_module.h" +#include + //------------------------------------------------------------------------- // port_scan tables //------------------------------------------------------------------------- diff --git a/src/network_inspectors/port_scan/ps_module.h b/src/network_inspectors/port_scan/ps_module.h index 8b0b7f5da..562579f80 100644 --- a/src/network_inspectors/port_scan/ps_module.h +++ b/src/network_inspectors/port_scan/ps_module.h @@ -23,7 +23,6 @@ #include "framework/module.h" #include "ps_detect.h" -#include "main/thread.h" #define PS_NAME "port_scan" #define PS_HELP "port scan inspector; also configure port_scan_global" diff --git a/src/network_inspectors/reputation/reputation_config.h b/src/network_inspectors/reputation/reputation_config.h index 7ec05fb3d..5f76b7e66 100644 --- a/src/network_inspectors/reputation/reputation_config.h +++ b/src/network_inspectors/reputation/reputation_config.h @@ -20,11 +20,9 @@ #ifndef REPUTATION_CONFIG_H #define REPUTATION_CONFIG_H -#include "main/snort_types.h" -#include "sfrt/sfrt_flat.h" -#include "main/snort_debug.h" #include "framework/counts.h" -#include "main/thread.h" +#include "main/snort_debug.h" +#include "sfrt/sfrt_flat.h" #define NUM_INDEX_PER_ENTRY 4 diff --git a/src/network_inspectors/reputation/reputation_inspect.cc b/src/network_inspectors/reputation/reputation_inspect.cc index e0c41b12d..930323be7 100644 --- a/src/network_inspectors/reputation/reputation_inspect.cc +++ b/src/network_inspectors/reputation/reputation_inspect.cc @@ -19,34 +19,19 @@ // reputation_inspect.cc author Hui Cao -#include "reputation_inspect.h" - -#include "reputation_module.h" -#include "reputation_parse.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "reputation_inspect.h" -#include "protocols/packet.h" -#include "sfip/sf_ip.h" +#include "detection/detect.h" #include "events/event_queue.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "profiler/profiler.h" -#include "file_api/file_api.h" -#include "parser/parser.h" -#include "framework/inspector.h" -#include "utils/sfsnprintfappend.h" -#include "target_based/snort_protocols.h" -#include "detection/detect.h" #include "packet_io/active.h" +#include "profiler/profiler.h" + +#include "reputation_module.h" THREAD_LOCAL ProfileStats reputationPerfStats; ReputationStats reputationstats; diff --git a/src/network_inspectors/reputation/reputation_inspect.h b/src/network_inspectors/reputation/reputation_inspect.h index ecadd3e58..282ef3ad0 100644 --- a/src/network_inspectors/reputation/reputation_inspect.h +++ b/src/network_inspectors/reputation/reputation_inspect.h @@ -19,7 +19,7 @@ #ifndef REPUTATION_INSPECT_H #define REPUTATION_INSPECT_H -#include "protocols/packet.h" +#include "flow/flow.h" // Per-session data block containing current state // of the Reputation preprocessor for the session. diff --git a/src/network_inspectors/reputation/reputation_module.cc b/src/network_inspectors/reputation/reputation_module.cc index 4673265d5..dbdd26a01 100644 --- a/src/network_inspectors/reputation/reputation_module.cc +++ b/src/network_inspectors/reputation/reputation_module.cc @@ -18,10 +18,13 @@ // reputation_module.cc author Bhagya Tholpady +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "reputation_module.h" -#include -#include +#include #include "log/messages.h" #include "utils/util.h" diff --git a/src/network_inspectors/reputation/reputation_module.h b/src/network_inspectors/reputation/reputation_module.h index a9e589fac..77eb8c30a 100644 --- a/src/network_inspectors/reputation/reputation_module.h +++ b/src/network_inspectors/reputation/reputation_module.h @@ -24,8 +24,6 @@ // Interface to the REPUTATION network inspector #include "framework/module.h" -#include "framework/bits.h" -#include "main/thread.h" #include "reputation_config.h" #define GID_REPUTATION 136 diff --git a/src/network_inspectors/reputation/reputation_parse.cc b/src/network_inspectors/reputation/reputation_parse.cc index 8094662a6..9fab13205 100644 --- a/src/network_inspectors/reputation/reputation_parse.cc +++ b/src/network_inspectors/reputation/reputation_parse.cc @@ -16,17 +16,20 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- // reputation_parse.cc author Hui Cao -// + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "reputation_parse.h" -#include +#include #include +#include #include #include "log/messages.h" -#include "main/snort_debug.h" #include "parser/config_file.h" #include "sfip/sf_cidr.h" #include "utils/util.h" diff --git a/src/packet_io/active.cc b/src/packet_io/active.cc index 9109bde59..41fa8f30b 100644 --- a/src/packet_io/active.cc +++ b/src/packet_io/active.cc @@ -26,12 +26,14 @@ #include "active.h" #include "log/messages.h" +#include "main/snort_config.h" #include "managers/action_manager.h" -#include "packet_io/sfdaq.h" #include "protocols/tcp.h" #include "stream/stream.h" #include "utils/dnet_header.h" +#include "sfdaq.h" + #define MAX_ATTEMPTS 20 // these can't be pkt flags because we do the handling diff --git a/src/packet_io/active.h b/src/packet_io/active.h index ded861162..4cd675a66 100644 --- a/src/packet_io/active.h +++ b/src/packet_io/active.h @@ -25,10 +25,10 @@ // manages packet processing verdicts returned to the DAQ. action (what to // do) is separate from status (whether we can actually do it or not). -#include "main/snort_config.h" #include "protocols/packet_manager.h" struct Packet; +struct SnortConfig; class SO_PUBLIC Active { diff --git a/src/packet_io/intf.cc b/src/packet_io/intf.cc index 9b200448d..86638884c 100644 --- a/src/packet_io/intf.cc +++ b/src/packet_io/intf.cc @@ -17,16 +17,16 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "intf.h" #include #include -#include #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "utils/util.h" #include "sfip/sf_ip.h" //------------------------------------------------------------------------------ diff --git a/src/packet_io/sfdaq.cc b/src/packet_io/sfdaq.cc index 189a5f831..a182c15b6 100644 --- a/src/packet_io/sfdaq.cc +++ b/src/packet_io/sfdaq.cc @@ -19,28 +19,23 @@ // sfdaq.cc author Michael Altizer -#include "sfdaq.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - -#include -#include +#include "sfdaq.h" extern "C" { #include #include } +#include + #include "log/messages.h" #include "main/snort_config.h" -#include "parser/parser.h" #include "protocols/packet.h" #include "protocols/vlan.h" -#include "utils/util.h" #include "sfdaq_config.h" diff --git a/src/packet_io/sfdaq.h b/src/packet_io/sfdaq.h index 5c3ef2835..06f53f95e 100644 --- a/src/packet_io/sfdaq.h +++ b/src/packet_io/sfdaq.h @@ -22,9 +22,7 @@ #ifndef SFDAQ_H #define SFDAQ_H -extern "C" { #include -} #include diff --git a/src/packet_io/sfdaq_config.cc b/src/packet_io/sfdaq_config.cc index 7ed3df023..71426edec 100644 --- a/src/packet_io/sfdaq_config.cc +++ b/src/packet_io/sfdaq_config.cc @@ -18,6 +18,10 @@ // sfdaq_config.cc author Michael Altizer +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sfdaq_config.h" using namespace std; diff --git a/src/packet_io/sfdaq_module.cc b/src/packet_io/sfdaq_module.cc index 7a0dc5279..c2a2b8e17 100644 --- a/src/packet_io/sfdaq_module.cc +++ b/src/packet_io/sfdaq_module.cc @@ -24,7 +24,7 @@ #include "sfdaq_module.h" -#include +#include #include "log/messages.h" #include "main/snort_config.h" diff --git a/src/packet_io/test/sfdaq_module_test.cc b/src/packet_io/test/sfdaq_module_test.cc index 44a0aff9a..bfbefec41 100644 --- a/src/packet_io/test/sfdaq_module_test.cc +++ b/src/packet_io/test/sfdaq_module_test.cc @@ -22,6 +22,10 @@ // unit tests // ----------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "catch/catch.hpp" #include "catch/unit_test.h" #include "main/snort_config.h" diff --git a/src/packet_io/trough.cc b/src/packet_io/trough.cc index ba5fbef6f..7d2a8489a 100644 --- a/src/packet_io/trough.cc +++ b/src/packet_io/trough.cc @@ -17,6 +17,10 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "trough.h" #include diff --git a/src/parser/arg_list.cc b/src/parser/arg_list.cc index ae19ae6af..59434d658 100644 --- a/src/parser/arg_list.cc +++ b/src/parser/arg_list.cc @@ -17,9 +17,13 @@ //-------------------------------------------------------------------------- // arg_list.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "arg_list.h" -#include +#include void ArgList::dump() { diff --git a/src/parser/cmd_line.cc b/src/parser/cmd_line.cc index d480f4fbd..642bf7f21 100644 --- a/src/parser/cmd_line.cc +++ b/src/parser/cmd_line.cc @@ -17,24 +17,20 @@ //-------------------------------------------------------------------------- // cmd_line.cc author Russ Combs -#include "cmd_line.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "cmd_line.h" +#include "framework/module.h" #include "log/messages.h" #include "main/help.h" -#include "main/snort_module.h" #include "main/snort_config.h" -#include "framework/module.h" -#include "framework/parameter.h" +#include "main/snort_module.h" #include "packet_io/trough.h" -#include "parser/arg_list.h" -#include "parser/parser.h" -#include "utils/util.h" + +#include "arg_list.h" using namespace std; diff --git a/src/parser/config_file.cc b/src/parser/config_file.cc index 05beda7e1..03d060565 100644 --- a/src/parser/config_file.cc +++ b/src/parser/config_file.cc @@ -17,44 +17,27 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "config_file.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "config_file.h" + #include #include #include -#include "parser.h" -#include "cmd_line.h" -#include "mstring.h" - #include "detection/detect.h" #include "log/messages.h" #include "main/snort.h" #include "main/snort_config.h" -#include "main/snort_types.h" #include "main/snort_debug.h" -#include "ips_options/ips_flowbits.h" #include "managers/event_manager.h" -#include "packet_io/sfdaq.h" -#include "packet_io/sfdaq_config.h" -#include "sfip/sf_ip.h" #include "utils/dnet_header.h" #include "utils/util.h" +#include "mstring.h" + #define LOG_NONE "none" #define LOG_DUMP "dump" #define LOG_CODECS "codecs" diff --git a/src/parser/config_file.h b/src/parser/config_file.h index bd82ff299..dc64781e9 100644 --- a/src/parser/config_file.h +++ b/src/parser/config_file.h @@ -19,9 +19,6 @@ #ifndef CONFIG_FILE_H #define CONFIG_FILE_H -#include "main/snort_types.h" -#include "main/policy.h" - struct SnortConfig; const char* get_snort_conf(); diff --git a/src/parser/mstring.cc b/src/parser/mstring.cc index 967b385c4..76d0585bf 100644 --- a/src/parser/mstring.cc +++ b/src/parser/mstring.cc @@ -18,21 +18,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "mstring.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include +#include "mstring.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/detection_util.h" #include "utils/util.h" static char* mSplitAddTok(const char*, const int, const char*, const char); diff --git a/src/parser/parse_conf.cc b/src/parser/parse_conf.cc index 19e80e492..7f3d4cde2 100644 --- a/src/parser/parse_conf.cc +++ b/src/parser/parse_conf.cc @@ -19,55 +19,28 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "parse_conf.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "parse_conf.h" + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include - -#include "parser.h" -#include "parse_stream.h" -#include "cmd_line.h" -#include "parse_rule.h" -#include "config_file.h" -#include "vars.h" +#include -#include "actions/actions.h" -#include "detection/rules.h" -#include "detection/treenodes.h" -#include "detection/signature.h" -#include "main/snort_debug.h" -#include "main/snort_config.h" -#include "utils/util.h" -#include "hash/sfghash.h" -#include "sfip/sf_ip.h" -#include "sfip/sf_vartable.h" -#include "packet_io/active.h" -#include "file_api/file_config.h" -#include "framework/ips_option.h" #include "log/messages.h" +#include "main/snort_config.h" #include "managers/action_manager.h" -#include "actions/actions.h" +#include "sfip/sf_vartable.h" #include "target_based/snort_protocols.h" +#include "utils/util.h" + +#include "config_file.h" +#include "parser.h" +#include "parse_stream.h" +#include "vars.h" struct Location { diff --git a/src/parser/parse_ip.cc b/src/parser/parse_ip.cc index cdf31a027..e3731be4d 100644 --- a/src/parser/parse_ip.cc +++ b/src/parser/parse_ip.cc @@ -16,25 +16,17 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "parse_ip.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include +#include "parse_ip.h" -#include "parser.h" #include "log/messages.h" +#include "main/policy.h" #include "main/snort_debug.h" -#include "sfip/sf_vartable.h" #include "sfip/sf_ipvar.h" +#include "sfip/sf_vartable.h" #include "utils/util.h" sfip_var_t* sfip_var_from_string(const char* addr) diff --git a/src/parser/parse_ip.h b/src/parser/parse_ip.h index b0ae466a0..26a8f4eeb 100644 --- a/src/parser/parse_ip.h +++ b/src/parser/parse_ip.h @@ -20,9 +20,6 @@ #ifndef PARSE_IP_H #define PARSE_IP_H -#include -#include "main/snort_types.h" - struct sfip_var_t; sfip_var_t* sfip_var_from_string(const char*); diff --git a/src/parser/parse_ports.cc b/src/parser/parse_ports.cc index a3e4f5ed8..6d170129c 100644 --- a/src/parser/parse_ports.cc +++ b/src/parser/parse_ports.cc @@ -17,11 +17,14 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "parse_ports.h" -#include "protocols/packet.h" -#include "ports/port_table.h" + #include "main/snort_debug.h" -#include "utils/snort_bounds.h" +#include "protocols/packet.h" #include "utils/util.h" static int POParserInit(POParser* pop, const char* s, PortVarTable* pvTable) diff --git a/src/parser/parse_ports.h b/src/parser/parse_ports.h index 761856ade..fbf521248 100644 --- a/src/parser/parse_ports.h +++ b/src/parser/parse_ports.h @@ -23,7 +23,6 @@ #define PARSE_PORTS_H #include "ports/port_var_table.h" -#include "utils/sflsq.h" //------------------------------------------------------------------------- // parser diff --git a/src/parser/parse_rule.cc b/src/parser/parse_rule.cc index d2fbf9192..ea4ed0449 100644 --- a/src/parser/parse_rule.cc +++ b/src/parser/parse_rule.cc @@ -17,65 +17,32 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "parse_rule.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "parser.h" -#include "cmd_line.h" -#include "config_file.h" -#include "parse_conf.h" -#include "parse_ports.h" +#include "parse_rule.h" -#include "detection/rules.h" -#include "detection/treenodes.h" #include "detection/detect.h" -#include "detection/tag.h" -#include "detection/signature.h" #include "detection/fp_config.h" -#include "detection/fp_create.h" #include "detection/fp_utils.h" -#include "detection/pattern_match_data.h" -#include "detection/sfrim.h" -#include "main/snort_debug.h" +#include "detection/treenodes.h" +#include "framework/decode_data.h" +#include "log/messages.h" #include "main/snort_config.h" +#include "main/snort_debug.h" #include "main/thread_config.h" -#include "ports/port_object.h" -#include "ports/rule_port_tables.h" -#include "protocols/packet.h" -#include "filters/sfthreshold.h" -#include "filters/sfthd.h" -#include "hash/sfghash.h" -#include "sfip/sf_vartable.h" -#include "sfip/sf_ip.h" -#include "sfip/sf_ipvar.h" -#include "utils/sflsq.h" -#include "utils/util.h" -#include "filters/rate_filter.h" -#include "filters/detection_filter.h" -#include "packet_io/active.h" -#include "file_api/file_config.h" -#include "framework/ips_option.h" -#include "log/messages.h" #include "managers/ips_manager.h" #include "managers/so_manager.h" +#include "ports/rule_port_tables.h" +#include "sfip/sf_ipvar.h" +#include "sfip/sf_vartable.h" #include "target_based/snort_protocols.h" +#include "utils/util.h" + +#include "parser.h" +#include "parse_conf.h" +#include "parse_ports.h" #define SRC 0 #define DST 1 diff --git a/src/parser/parse_stream.cc b/src/parser/parse_stream.cc index 1e1d0497c..476740198 100644 --- a/src/parser/parse_stream.cc +++ b/src/parser/parse_stream.cc @@ -17,22 +17,20 @@ //-------------------------------------------------------------------------- // parse_stream.cc author Russ Combs -#include "parse_stream.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "parse_stream.h" -#include #include -#include + +#include "log/messages.h" +#include "managers/ips_manager.h" #include "parser.h" #include "parse_conf.h" #include "parse_rule.h" -#include "detection/treenodes.h" -#include "log/messages.h" -#include "managers/ips_manager.h" using namespace std; diff --git a/src/parser/parse_utils.cc b/src/parser/parse_utils.cc index dc171c682..4cd74698e 100644 --- a/src/parser/parse_utils.cc +++ b/src/parser/parse_utils.cc @@ -17,14 +17,14 @@ //-------------------------------------------------------------------------- // parse_uitls.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "parse_utils.h" -#include -#include -#include -#include +#include -#include "parser.h" #include "log/messages.h" #include "utils/util.h" diff --git a/src/parser/parser.cc b/src/parser/parser.cc index ac8cd6cdf..f24884771 100644 --- a/src/parser/parser.cc +++ b/src/parser/parser.cc @@ -17,69 +17,40 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "parser.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "parser.h" + #include -#include -#include -#include +#include #include -#include - -#include "cmd_line.h" -#include "mstring.h" -#include "config_file.h" -#include "parse_conf.h" -#include "parse_rule.h" -#include "parse_stream.h" -#include "vars.h" -#include "utils/util.h" -#include "utils/sflsq.h" -#include "ports/port_object.h" -#include "ports/port_table.h" -#include "ports/port_utils.h" -#include "ports/rule_port_tables.h" -#include "main/snort_config.h" -#include "main/shell.h" -#include "main/snort_debug.h" -#include "detection/signature.h" -#include "detection/treenodes.h" -#include "detection/rules.h" -#include "detection/detect.h" #include "detection/fp_config.h" -#include "detection/tag.h" #include "detection/sfrim.h" -#include "protocols/packet.h" -#include "filters/sfthreshold.h" -#include "filters/sfthd.h" -#include "filters/rate_filter.h" #include "filters/detection_filter.h" -#include "hash/sfghash.h" -#include "sfip/sf_vartable.h" -#include "sfip/sf_ip.h" -#include "sfip/sf_ipvar.h" -#include "packet_io/active.h" -#include "file_api/file_config.h" -#include "actions/actions.h" +#include "filters/rate_filter.h" +#include "filters/sfthreshold.h" #include "log/messages.h" +#include "main/shell.h" +#include "main/snort_config.h" #include "managers/event_manager.h" #include "managers/module_manager.h" +#include "ports/port_object.h" +#include "ports/port_table.h" +#include "ports/rule_port_tables.h" +#include "sfip/sf_ipvar.h" #include "target_based/snort_protocols.h" +#include "utils/util.h" + +#include "config_file.h" +#include "mstring.h" +#include "parse_conf.h" +#include "parse_rule.h" +#include "parse_stream.h" +#include "vars.h" static struct rule_index_map_t* ruleIndexMap = nullptr; diff --git a/src/parser/parser.h b/src/parser/parser.h index 9a2fde712..7435b3cb8 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -20,14 +20,7 @@ #ifndef PARSER_H #define PARSER_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include - #include "detection/rules.h" -#include "detection/sfrim.h" #include "detection/treenodes.h" #include "main/policy.h" diff --git a/src/parser/vars.cc b/src/parser/vars.cc index 850c6c4b0..9ce386f7b 100644 --- a/src/parser/vars.cc +++ b/src/parser/vars.cc @@ -17,55 +17,19 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "vars.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "config_file.h" -#include "parser/parser.h" -#include "cmd_line.h" -#include "parse_ports.h" +#include "vars.h" #include "log/messages.h" -#include "main/snort_debug.h" #include "main/snort_config.h" -#include "detection/rules.h" -#include "detection/treenodes.h" -#include "detection/detect.h" -#include "detection/tag.h" -#include "detection/signature.h" -#include "detection/sfrim.h" -#include "utils/util.h" -#include "utils/sflsq.h" -#include "ports/port_object.h" -#include "protocols/packet.h" -#include "filters/sfthreshold.h" -#include "filters/sfthd.h" -#include "filters/rate_filter.h" -#include "filters/detection_filter.h" -#include "hash/sfghash.h" -#include "sfip/sf_vartable.h" -#include "sfip/sf_ip.h" +#include "main/snort_debug.h" #include "sfip/sf_ipvar.h" -#include "packet_io/active.h" -#include "file_api/file_config.h" -#include "framework/ips_option.h" +#include "utils/util.h" + +#include "parse_ports.h" #ifdef UNIT_TEST #include "catch/catch.hpp" diff --git a/src/parser/vars.h b/src/parser/vars.h index e9f613fab..0971c7303 100644 --- a/src/parser/vars.h +++ b/src/parser/vars.h @@ -20,7 +20,8 @@ #ifndef VARS_H #define VARS_H -#include "main/snort_types.h" +#include + #include "sfip/sf_vartable.h" struct SnortConfig; diff --git a/src/piglet/piglet.cc b/src/piglet/piglet.cc index 02efcb098..d0e7d9a3e 100644 --- a/src/piglet/piglet.cc +++ b/src/piglet/piglet.cc @@ -17,16 +17,19 @@ //-------------------------------------------------------------------------- // piglet.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "piglet.h" #include #include #include "main/snort_config.h" -#include "piglet_manager.h" + #include "piglet_output.h" #include "piglet_runner.h" -#include "piglet_utils.h" namespace Piglet { diff --git a/src/piglet/piglet_api.h b/src/piglet/piglet_api.h index efe9e5d33..dd9acd54e 100644 --- a/src/piglet/piglet_api.h +++ b/src/piglet/piglet_api.h @@ -23,7 +23,6 @@ // Piglet plugin API #include -#include #include "framework/base_api.h" #include "log/messages.h" diff --git a/src/piglet/piglet_manager.cc b/src/piglet/piglet_manager.cc index 1a1532e46..b66bd7e28 100644 --- a/src/piglet/piglet_manager.cc +++ b/src/piglet/piglet_manager.cc @@ -17,19 +17,21 @@ //-------------------------------------------------------------------------- // piglet_manager.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "piglet_manager.h" -#include -#include -#include -#include +#include #include "log/messages.h" #include "main/snort_config.h" #include "managers/module_manager.h" #include "managers/plugin_manager.h" -#include "piglet_utils.h" + #include "piglet_api.h" +#include "piglet_utils.h" #define PLUGIN_KEY_SEP "::" diff --git a/src/piglet/piglet_output.cc b/src/piglet/piglet_output.cc index 0c3b5d484..1ad75235f 100644 --- a/src/piglet/piglet_output.cc +++ b/src/piglet/piglet_output.cc @@ -17,13 +17,11 @@ //-------------------------------------------------------------------------- // piglet_output.cc author Joel Cornett -#include "piglet_output.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include -#include +#include "piglet_output.h" #include "piglet_runner.h" #include "piglet_utils.h" diff --git a/src/piglet/piglet_runner.cc b/src/piglet/piglet_runner.cc index f759d355d..ca1276332 100644 --- a/src/piglet/piglet_runner.cc +++ b/src/piglet/piglet_runner.cc @@ -17,14 +17,18 @@ //-------------------------------------------------------------------------- // piglet_runner.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "piglet_runner.h" -#include -#include -#include +#include +#include "lua/lua.h" #include "lua/lua_table.h" #include "lua/lua_util.h" + #include "piglet_api.h" #include "piglet_manager.h" #include "piglet_output.h" diff --git a/src/piglet/piglet_utils.cc b/src/piglet/piglet_utils.cc index 496b1be22..a4a105ca2 100644 --- a/src/piglet/piglet_utils.cc +++ b/src/piglet/piglet_utils.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // piglet_utils.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "piglet_utils.h" namespace Piglet diff --git a/src/piglet_plugins/piglet_plugins.cc b/src/piglet_plugins/piglet_plugins.cc index d1c520267..339b810d6 100644 --- a/src/piglet_plugins/piglet_plugins.cc +++ b/src/piglet_plugins/piglet_plugins.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // piglet_plugins.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "piglet_plugins.h" #include "managers/plugin_manager.h" diff --git a/src/piglet_plugins/pp_buffer_iface.cc b/src/piglet_plugins/pp_buffer_iface.cc index b2a89dd85..8ed095643 100644 --- a/src/piglet_plugins/pp_buffer_iface.cc +++ b/src/piglet_plugins/pp_buffer_iface.cc @@ -17,13 +17,15 @@ //-------------------------------------------------------------------------- // pp_buffer_iface.cc author Joel Cornett -#include "pp_buffer_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "pp_buffer_iface.h" #include "framework/codec.h" #include "lua/lua_arg.h" -#include "lua/lua_ref.h" + #include "pp_raw_buffer_iface.h" static const luaL_Reg methods[] = diff --git a/src/piglet_plugins/pp_codec.cc b/src/piglet_plugins/pp_codec.cc index f701d869d..7bd382100 100644 --- a/src/piglet_plugins/pp_codec.cc +++ b/src/piglet_plugins/pp_codec.cc @@ -17,23 +17,21 @@ //-------------------------------------------------------------------------- // pp_codec.cc author Joel Cornett -#include "piglet_plugins.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include - -#include "lua/lua_iface.h" #include "managers/codec_manager.h" #include "piglet/piglet_api.h" #include "pp_buffer_iface.h" -#include "pp_daq_pkthdr_iface.h" #include "pp_codec_data_iface.h" +#include "pp_codec_iface.h" +#include "pp_daq_pkthdr_iface.h" #include "pp_decode_data_iface.h" #include "pp_enc_state_iface.h" #include "pp_raw_buffer_iface.h" -#include "pp_codec_iface.h" - class CodecPiglet : public Piglet::BasePlugin { public: diff --git a/src/piglet_plugins/pp_codec_data_iface.cc b/src/piglet_plugins/pp_codec_data_iface.cc index 534a0ab67..d10b7cbe3 100644 --- a/src/piglet_plugins/pp_codec_data_iface.cc +++ b/src/piglet_plugins/pp_codec_data_iface.cc @@ -17,13 +17,13 @@ //-------------------------------------------------------------------------- // pp_codec_data_iface.cc author Joel Cornett -#include "pp_codec_data_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "pp_codec_data_iface.h" #include "framework/codec.h" -#include "lua/lua_table.h" #include "lua/lua_arg.h" static void set_fields(lua_State* L, int tindex, CodecData& self) diff --git a/src/piglet_plugins/pp_codec_iface.cc b/src/piglet_plugins/pp_codec_iface.cc index c21294b8d..22be7f6c6 100644 --- a/src/piglet_plugins/pp_codec_iface.cc +++ b/src/piglet_plugins/pp_codec_iface.cc @@ -17,17 +17,14 @@ //-------------------------------------------------------------------------- // pp_codec_iface.cc author Joel Cornett -#include "pp_codec_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include +#include "pp_codec_iface.h" #include "framework/codec.h" #include "lua/lua_arg.h" -#include "lua/lua_table.h" -#include "protocols/ip.h" #include "log/text_log.h" #include "pp_buffer_iface.h" @@ -35,9 +32,9 @@ #include "pp_daq_pkthdr_iface.h" #include "pp_decode_data_iface.h" #include "pp_enc_state_iface.h" +#include "pp_flow_iface.h" #include "pp_ip_api_iface.h" #include "pp_raw_buffer_iface.h" -#include "pp_flow_iface.h" // FIXIT-M delete this, and make the IpApi arg in codec.update required static const ip::IpApi default_ip_api {}; diff --git a/src/piglet_plugins/pp_cursor_iface.cc b/src/piglet_plugins/pp_cursor_iface.cc index 9309ff17f..77baccfbe 100644 --- a/src/piglet_plugins/pp_cursor_iface.cc +++ b/src/piglet_plugins/pp_cursor_iface.cc @@ -17,14 +17,16 @@ //-------------------------------------------------------------------------- // pp_cursor_iface.cc author Joel Cornett -#include "pp_cursor_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "pp_cursor_iface.h" #include "framework/cursor.h" #include "lua/lua_arg.h" -#include "lua/lua_ref.h" #include "protocols/packet.h" + #include "pp_packet_iface.h" #include "pp_raw_buffer_iface.h" diff --git a/src/piglet_plugins/pp_daq_pkthdr_iface.cc b/src/piglet_plugins/pp_daq_pkthdr_iface.cc index 94993f960..ee6f5afda 100644 --- a/src/piglet_plugins/pp_daq_pkthdr_iface.cc +++ b/src/piglet_plugins/pp_daq_pkthdr_iface.cc @@ -17,22 +17,17 @@ //-------------------------------------------------------------------------- // pp_codec_data_iface.cc author Joel Cornett -#include "pp_daq_pkthdr_iface.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include +#include "pp_daq_pkthdr_iface.h" -extern "C" { #include -} -#include "lua/lua_arg.h" -#include "lua/lua_table.h" +#include +#include "lua/lua_arg.h" static void set_fields(lua_State* L, int tindex, struct _daq_pkthdr& self) { diff --git a/src/piglet_plugins/pp_decode_data_iface.cc b/src/piglet_plugins/pp_decode_data_iface.cc index b26c3ad86..b41e3eea3 100644 --- a/src/piglet_plugins/pp_decode_data_iface.cc +++ b/src/piglet_plugins/pp_decode_data_iface.cc @@ -17,15 +17,14 @@ //-------------------------------------------------------------------------- // pp_decode_data_iface.cc author Joel Cornett -#include "pp_decode_data_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "pp_decode_data_iface.h" #include "framework/decode_data.h" #include "lua/lua_arg.h" -#include "lua/lua_table.h" -#include "protocols/ipv4.h" #include "pp_ip_api_iface.h" #include "pp_raw_buffer_iface.h" diff --git a/src/piglet_plugins/pp_enc_state_iface.cc b/src/piglet_plugins/pp_enc_state_iface.cc index acccf90ad..5ed94c056 100644 --- a/src/piglet_plugins/pp_enc_state_iface.cc +++ b/src/piglet_plugins/pp_enc_state_iface.cc @@ -17,13 +17,14 @@ //-------------------------------------------------------------------------- // pp_enc_state_iface.cc author Joel Cornett -#include "pp_enc_state_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "pp_enc_state_iface.h" #include "framework/codec.h" #include "lua/lua_arg.h" -#include "protocols/ip.h" // FIXIT-M ip_api should also be its own object (copyable) static const class ip::IpApi ip_api {}; diff --git a/src/piglet_plugins/pp_event_iface.cc b/src/piglet_plugins/pp_event_iface.cc index b8883d47d..7b9c7ff9f 100644 --- a/src/piglet_plugins/pp_event_iface.cc +++ b/src/piglet_plugins/pp_event_iface.cc @@ -17,16 +17,18 @@ //-------------------------------------------------------------------------- // pp_event_iface.cc author Joel Cornett -#include "pp_event_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "pp_event_iface.h" -#include +#include #include "detection/signature.h" #include "events/event.h" #include "lua/lua_arg.h" -#include "lua/lua_table.h" + #include "pp_raw_buffer_iface.h" static struct SigInfo* create_sig_info() diff --git a/src/piglet_plugins/pp_flow_iface.cc b/src/piglet_plugins/pp_flow_iface.cc index b8d5ef8a3..d1d7a6350 100644 --- a/src/piglet_plugins/pp_flow_iface.cc +++ b/src/piglet_plugins/pp_flow_iface.cc @@ -17,10 +17,11 @@ //-------------------------------------------------------------------------- // pp_flow_iface.cc author Joel Cornett -#include "pp_flow_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "pp_flow_iface.h" #include "flow/flow.h" #include "lua/lua_arg.h" diff --git a/src/piglet_plugins/pp_inspector.cc b/src/piglet_plugins/pp_inspector.cc index 00f898ada..e5b682ae6 100644 --- a/src/piglet_plugins/pp_inspector.cc +++ b/src/piglet_plugins/pp_inspector.cc @@ -17,26 +17,22 @@ //-------------------------------------------------------------------------- // pp_inspector.cc author Joel Cornett -#include "piglet_plugins.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include - -#include "log/messages.h" -#include "lua/lua_iface.h" #include "managers/inspector_manager.h" #include "piglet/piglet_api.h" #include "stream/flush_bucket.h" #include "pp_decode_data_iface.h" #include "pp_flow_iface.h" +#include "pp_inspector_iface.h" #include "pp_ip_api_iface.h" #include "pp_packet_iface.h" #include "pp_raw_buffer_iface.h" #include "pp_stream_splitter_iface.h" -#include "pp_inspector_iface.h" - class InspectorPiglet : public Piglet::BasePlugin { public: diff --git a/src/piglet_plugins/pp_inspector_iface.cc b/src/piglet_plugins/pp_inspector_iface.cc index 21d1a4467..ce0f5641c 100644 --- a/src/piglet_plugins/pp_inspector_iface.cc +++ b/src/piglet_plugins/pp_inspector_iface.cc @@ -17,16 +17,16 @@ //-------------------------------------------------------------------------- // pp_inspector_iface.cc author Joel Cornett -#include "pp_inspector_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include +#include "pp_inspector_iface.h" #include "framework/inspector.h" #include "lua/lua_arg.h" #include "main/snort_config.h" + #include "pp_packet_iface.h" #include "pp_raw_buffer_iface.h" #include "pp_stream_splitter_iface.h" diff --git a/src/piglet_plugins/pp_ip_api_iface.cc b/src/piglet_plugins/pp_ip_api_iface.cc index f8c42e9be..07f2f1f1f 100644 --- a/src/piglet_plugins/pp_ip_api_iface.cc +++ b/src/piglet_plugins/pp_ip_api_iface.cc @@ -17,15 +17,14 @@ //-------------------------------------------------------------------------- // pp_ip_api_iface.cc author Joel Cornett -#include "pp_ip_api_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "pp_ip_api_iface.h" #include "lua/lua_arg.h" #include "protocols/ip.h" -#include "protocols/ipv4.h" -#include "protocols/ipv6.h" #include "pp_raw_buffer_iface.h" diff --git a/src/piglet_plugins/pp_ips_action.cc b/src/piglet_plugins/pp_ips_action.cc index f9c3457a0..ba7327799 100644 --- a/src/piglet_plugins/pp_ips_action.cc +++ b/src/piglet_plugins/pp_ips_action.cc @@ -17,21 +17,17 @@ //-------------------------------------------------------------------------- // pp_ips_action.cc author Joel Cornett -#include "piglet_plugins.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "lua/lua_iface.h" #include "managers/action_manager.h" #include "piglet/piglet_api.h" +#include "pp_ips_action_iface.h" #include "pp_packet_iface.h" #include "pp_raw_buffer_iface.h" -#include "pp_ips_action_iface.h" - class IpsActionPiglet : public Piglet::BasePlugin { public: diff --git a/src/piglet_plugins/pp_ips_action_iface.cc b/src/piglet_plugins/pp_ips_action_iface.cc index 823d47381..58b5204db 100644 --- a/src/piglet_plugins/pp_ips_action_iface.cc +++ b/src/piglet_plugins/pp_ips_action_iface.cc @@ -17,11 +17,14 @@ //-------------------------------------------------------------------------- // pp_ips_action_iface.cc author Joel Cornett -#include "pp_ips_action_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "pp_ips_action_iface.h" #include "framework/ips_action.h" + #include "pp_packet_iface.h" static const luaL_Reg methods[] = diff --git a/src/piglet_plugins/pp_ips_option.cc b/src/piglet_plugins/pp_ips_option.cc index d470f4c81..394d10d0f 100644 --- a/src/piglet_plugins/pp_ips_option.cc +++ b/src/piglet_plugins/pp_ips_option.cc @@ -17,25 +17,19 @@ //-------------------------------------------------------------------------- // pp_ips_option.cc author Joel Cornett -#include "piglet_plugins.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - #include "detection/treenodes.h" -#include "lua/lua_iface.h" #include "managers/ips_manager.h" #include "piglet/piglet_api.h" #include "pp_cursor_iface.h" +#include "pp_ips_option_iface.h" #include "pp_packet_iface.h" #include "pp_raw_buffer_iface.h" -#include "pp_ips_option_iface.h" - class IpsOptionPiglet : public Piglet::BasePlugin { public: diff --git a/src/piglet_plugins/pp_ips_option_iface.cc b/src/piglet_plugins/pp_ips_option_iface.cc index 25784859d..bf2482ff7 100644 --- a/src/piglet_plugins/pp_ips_option_iface.cc +++ b/src/piglet_plugins/pp_ips_option_iface.cc @@ -17,12 +17,15 @@ //-------------------------------------------------------------------------- // pp_ips_option_iface.cc author Joel Cornett -#include "pp_ips_option_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "pp_ips_option_iface.h" #include "framework/ips_option.h" #include "lua/lua_stack.h" + #include "pp_packet_iface.h" #include "pp_cursor_iface.h" diff --git a/src/piglet_plugins/pp_logger.cc b/src/piglet_plugins/pp_logger.cc index e4bee256f..3b8346338 100644 --- a/src/piglet_plugins/pp_logger.cc +++ b/src/piglet_plugins/pp_logger.cc @@ -17,24 +17,20 @@ //-------------------------------------------------------------------------- // pp_logger.cc author Joel Cornett -#include "piglet_plugins.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "lua/lua_iface.h" #include "managers/event_manager.h" #include "piglet/piglet_api.h" #include "pp_decode_data_iface.h" #include "pp_event_iface.h" #include "pp_ip_api_iface.h" +#include "pp_logger_iface.h" #include "pp_packet_iface.h" #include "pp_raw_buffer_iface.h" -#include "pp_logger_iface.h" - class LoggerPiglet : public Piglet::BasePlugin { public: diff --git a/src/piglet_plugins/pp_logger_iface.cc b/src/piglet_plugins/pp_logger_iface.cc index 2823d99f5..9f1969c39 100644 --- a/src/piglet_plugins/pp_logger_iface.cc +++ b/src/piglet_plugins/pp_logger_iface.cc @@ -17,13 +17,15 @@ //-------------------------------------------------------------------------- // pp_logger_iface.cc author Joel Cornett -#include "pp_logger_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "pp_logger_iface.h" #include "framework/logger.h" #include "lua/lua_arg.h" -#include "lua/lua_stack.h" + #include "pp_event_iface.h" #include "pp_packet_iface.h" diff --git a/src/piglet_plugins/pp_packet_iface.cc b/src/piglet_plugins/pp_packet_iface.cc index 6de26306c..dfd92193f 100644 --- a/src/piglet_plugins/pp_packet_iface.cc +++ b/src/piglet_plugins/pp_packet_iface.cc @@ -17,18 +17,19 @@ //-------------------------------------------------------------------------- // pp_packet_iface.cc author Joel Cornett -#include "pp_packet_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "pp_packet_iface.h" #include "lua/lua_arg.h" -#include "lua/lua_table.h" #include "protocols/packet.h" + +#include "pp_daq_pkthdr_iface.h" #include "pp_decode_data_iface.h" #include "pp_flow_iface.h" #include "pp_raw_buffer_iface.h" -#include "pp_daq_pkthdr_iface.h" static void set_fields(lua_State* L, int tindex, Packet& self) { diff --git a/src/piglet_plugins/pp_raw_buffer_iface.cc b/src/piglet_plugins/pp_raw_buffer_iface.cc index 57834aefb..30bc721c8 100644 --- a/src/piglet_plugins/pp_raw_buffer_iface.cc +++ b/src/piglet_plugins/pp_raw_buffer_iface.cc @@ -17,10 +17,13 @@ //-------------------------------------------------------------------------- // pp_raw_buffer_iface.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "pp_raw_buffer_iface.h" #include "lua/lua_arg.h" -#include "lua/lua_stack.h" // FIXIT-H a lot of users keep references to this data. Need to prevent // Lua's garbage collection from destroying RawBuffer while other C++ types diff --git a/src/piglet_plugins/pp_search_engine.cc b/src/piglet_plugins/pp_search_engine.cc index 0ef946675..c7f58cd13 100644 --- a/src/piglet_plugins/pp_search_engine.cc +++ b/src/piglet_plugins/pp_search_engine.cc @@ -17,15 +17,10 @@ //-------------------------------------------------------------------------- // pp_search_engine.cc author Joel Cornett -#include "piglet_plugins.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - -#include "lua/lua_iface.h" #include "managers/mpse_manager.h" #include "piglet/piglet_api.h" diff --git a/src/piglet_plugins/pp_search_engine_iface.cc b/src/piglet_plugins/pp_search_engine_iface.cc index a8ed8ad07..f636ecf06 100644 --- a/src/piglet_plugins/pp_search_engine_iface.cc +++ b/src/piglet_plugins/pp_search_engine_iface.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // pp_search_engine_iface.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "pp_search_engine_iface.h" #include "framework/mpse.h" diff --git a/src/piglet_plugins/pp_so_rule.cc b/src/piglet_plugins/pp_so_rule.cc index 9279d1f09..0b8a6acdd 100644 --- a/src/piglet_plugins/pp_so_rule.cc +++ b/src/piglet_plugins/pp_so_rule.cc @@ -17,15 +17,12 @@ //-------------------------------------------------------------------------- // pp_so_rule.cc author Joel Cornett -#include "piglet_plugins.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "piglet_plugins.h" -#include "lua/lua_iface.h" #include "managers/so_manager.h" #include "piglet/piglet_api.h" diff --git a/src/piglet_plugins/pp_so_rule_iface.cc b/src/piglet_plugins/pp_so_rule_iface.cc index cfb8ca9ae..84e72213b 100644 --- a/src/piglet_plugins/pp_so_rule_iface.cc +++ b/src/piglet_plugins/pp_so_rule_iface.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // pp_so_rule_iface.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "pp_so_rule_iface.h" #include "framework/so_rule.h" diff --git a/src/piglet_plugins/pp_stream_splitter_iface.cc b/src/piglet_plugins/pp_stream_splitter_iface.cc index a488c6359..6e4794adb 100644 --- a/src/piglet_plugins/pp_stream_splitter_iface.cc +++ b/src/piglet_plugins/pp_stream_splitter_iface.cc @@ -17,14 +17,15 @@ //-------------------------------------------------------------------------- // pp_stream_splitter_iface.cc author Joel Cornett -#include "pp_stream_splitter_iface.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "pp_stream_splitter_iface.h" #include "lua/lua_arg.h" -#include "lua/lua_stack.h" #include "stream/stream_splitter.h" + #include "pp_flow_iface.h" #include "pp_raw_buffer_iface.h" diff --git a/src/piglet_plugins/pp_test.cc b/src/piglet_plugins/pp_test.cc index 8b795cda9..ffdfa2031 100644 --- a/src/piglet_plugins/pp_test.cc +++ b/src/piglet_plugins/pp_test.cc @@ -17,15 +17,10 @@ //-------------------------------------------------------------------------- // pp_test.cc author Joel Cornett -#include "piglet_plugins.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - -#include "lua/lua_iface.h" #include "piglet/piglet_api.h" #include "pp_buffer_iface.h" diff --git a/src/ports/port_group.cc b/src/ports/port_group.cc index f64e9f253..0c3baa8e3 100644 --- a/src/ports/port_group.cc +++ b/src/ports/port_group.cc @@ -17,9 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "port_group.h" -#include #include "utils/util.h" void PortGroup::add_rule() diff --git a/src/ports/port_item.cc b/src/ports/port_item.cc index 1a61fe5d7..3666347b8 100644 --- a/src/ports/port_item.cc +++ b/src/ports/port_item.cc @@ -19,9 +19,12 @@ // port_item.cc derived from sfportobject.h by Marc Noron +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "port_item.h" -#include #include "utils/util.h" /* diff --git a/src/ports/port_item.h b/src/ports/port_item.h index e92d12159..b89032982 100644 --- a/src/ports/port_item.h +++ b/src/ports/port_item.h @@ -22,8 +22,7 @@ #ifndef PORT_ITEM_H #define PORT_ITEM_H -#include "framework/bits.h" -#include "utils/sflsq.h" +#include #define SFPO_MAX_LPORTS 500 #define SFPO_MAX_PORTS 65536 diff --git a/src/ports/port_object.cc b/src/ports/port_object.cc index 43876734e..9c753047c 100644 --- a/src/ports/port_object.cc +++ b/src/ports/port_object.cc @@ -17,26 +17,19 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "port_object.h" - -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "port_object.h" -#include "port_item.h" -#include "port_utils.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_config.h" #include "main/snort_debug.h" -#include "detection/sfrim.h" #include "parser/parser.h" #include "utils/util.h" -#include "utils/snort_bounds.h" -#include "hash/sfhashfcn.h" + +#include "port_item.h" +#include "port_utils.h" //------------------------------------------------------------------------- // PortObject - public diff --git a/src/ports/port_object.h b/src/ports/port_object.h index 525e3239d..3f1f569b4 100644 --- a/src/ports/port_object.h +++ b/src/ports/port_object.h @@ -22,7 +22,6 @@ #ifndef PORT_OBJECT_H #define PORT_OBJECT_H -#include "framework/bits.h" #include "utils/sflsq.h" //------------------------------------------------------------------------- diff --git a/src/ports/port_object2.cc b/src/ports/port_object2.cc index 511383051..e10b3417e 100644 --- a/src/ports/port_object2.cc +++ b/src/ports/port_object2.cc @@ -17,32 +17,21 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "port_object2.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include - -#include - -#include "port_object.h" -#include "port_item.h" -#include "port_table.h" -#include "port_utils.h" +#include "port_object2.h" +#include "hash/sfhashfcn.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_config.h" #include "main/snort_debug.h" -#include "detection/sfrim.h" #include "parser/parser.h" #include "utils/util.h" -#include "hash/sfhashfcn.h" + +#include "port_item.h" +#include "port_object.h" +#include "port_utils.h" #define PO_EXTRA_RULE_CNT 25 diff --git a/src/ports/port_table.cc b/src/ports/port_table.cc index ef9b3c7e5..72058973d 100644 --- a/src/ports/port_table.cc +++ b/src/ports/port_table.cc @@ -17,32 +17,20 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "port_table.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "port_table.h" #include -#include "port_item.h" -#include "port_object.h" -#include "port_object2.h" -#include "port_utils.h" - +#include "hash/sfhashfcn.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_config.h" #include "main/snort_debug.h" -#include "detection/sfrim.h" -#include "parser/parser.h" #include "utils/util.h" -#include "hash/sfhashfcn.h" + +#include "port_utils.h" #define PTBL_LRC_DEFAULT 10 #define PO_INIT_ID 1000000 diff --git a/src/ports/port_table.h b/src/ports/port_table.h index ad662eea1..615e58b62 100644 --- a/src/ports/port_table.h +++ b/src/ports/port_table.h @@ -23,10 +23,10 @@ #define PORT_TABLE_H #include "hash/sfghash.h" -#include "utils/sflsq.h" #include "ports/port_item.h" #include "ports/port_object.h" #include "ports/port_object2.h" +#include "utils/sflsq.h" //------------------------------------------------------------------------- // PortTable - provides support to analyze the Port List objects defined by diff --git a/src/ports/port_utils.cc b/src/ports/port_utils.cc index 73ea2879f..23abda321 100644 --- a/src/ports/port_utils.cc +++ b/src/ports/port_utils.cc @@ -17,26 +17,16 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "port_utils.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include +#include "port_utils.h" -#include +#include "utils/util.h" #include "port_item.h" #include "port_object.h" -#include "port_table.h" - -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" -#include "detection/sfrim.h" -#include "parser/parser.h" -#include "utils/snort_bounds.h" -#include "utils/util.h" //------------------------------------------------------------------------- // bitset conversions diff --git a/src/ports/port_utils.h b/src/ports/port_utils.h index d74771aed..55f48cd3e 100644 --- a/src/ports/port_utils.h +++ b/src/ports/port_utils.h @@ -25,7 +25,6 @@ #include "framework/bits.h" #include "protocols/packet.h" #include "utils/sflsq.h" -#include "utils/snort_bounds.h" struct PortObject; struct PortObjectItem; diff --git a/src/ports/port_var_table.cc b/src/ports/port_var_table.cc index 9b67f8f22..e3ee9b42b 100644 --- a/src/ports/port_var_table.cc +++ b/src/ports/port_var_table.cc @@ -17,6 +17,10 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "port_var_table.h" //------------------------------------------------------------------------- diff --git a/src/ports/port_var_table.h b/src/ports/port_var_table.h index d69db6734..336a53bba 100644 --- a/src/ports/port_var_table.h +++ b/src/ports/port_var_table.h @@ -25,7 +25,6 @@ #include "hash/sfghash.h" #include "ports/port_object.h" #include "ports/port_table.h" -#include "utils/sflsq.h" //------------------------------------------------------------------------- // PortVarTable diff --git a/src/ports/rule_port_tables.cc b/src/ports/rule_port_tables.cc index 9eda7a30f..d40218d9b 100644 --- a/src/ports/rule_port_tables.cc +++ b/src/ports/rule_port_tables.cc @@ -17,13 +17,16 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "rule_port_tables.h" +#include "log/messages.h" + #include "port_object.h" #include "port_table.h" -#include "log/messages.h" -#include "parser/parser.h" -#include "utils/util.h" #define DEFAULT_LARGE_RULE_GROUP 9 diff --git a/src/profiler/Makefile.am b/src/profiler/Makefile.am index 3b82f0154..7ff717a5f 100644 --- a/src/profiler/Makefile.am +++ b/src/profiler/Makefile.am @@ -6,7 +6,6 @@ x_include_HEADERS = \ memory_defs.h \ memory_context.h \ memory_profiler_defs.h \ -memory_profiler_active_context.h \ profiler.h \ profiler_defs.h \ rule_profiler_defs.h \ @@ -17,6 +16,7 @@ active_context.h \ memory_context.cc \ memory_profiler.cc \ memory_profiler.h \ +memory_profiler_active_context.h \ profiler.cc \ profiler_printer.h \ profiler_stats_table.cc \ diff --git a/src/profiler/memory_context.cc b/src/profiler/memory_context.cc index 57b8fea98..cfc0a600b 100644 --- a/src/profiler/memory_context.cc +++ b/src/profiler/memory_context.cc @@ -18,14 +18,12 @@ // memory_context.cc author Joel Cornett -#include "memory_context.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include +#include "memory_context.h" + #include #include diff --git a/src/profiler/memory_context.h b/src/profiler/memory_context.h index ce70b6a91..6f6c5be55 100644 --- a/src/profiler/memory_context.h +++ b/src/profiler/memory_context.h @@ -21,8 +21,6 @@ #ifndef MEMORY_CONTEXT_H #define MEMORY_CONTEXT_H -#include "main/thread.h" - struct CombinedMemoryStats; class MemoryProfiler diff --git a/src/profiler/memory_defs.h b/src/profiler/memory_defs.h index ebfbb2e38..25d9b09ea 100644 --- a/src/profiler/memory_defs.h +++ b/src/profiler/memory_defs.h @@ -21,8 +21,7 @@ #ifndef MEMORY_DEFS_H #define MEMORY_DEFS_H -#include "main/snort_types.h" -#include "memory_context.h" +#include "main/thread.h" struct MemoryStats { diff --git a/src/profiler/memory_profiler.cc b/src/profiler/memory_profiler.cc index d75f05f81..fbdc55540 100644 --- a/src/profiler/memory_profiler.cc +++ b/src/profiler/memory_profiler.cc @@ -18,18 +18,14 @@ // memory_profiler.cc author Joel Cornett -#include "memory_profiler.h" - #if HAVE_CONFIG_H #include "config.h" #endif -#include +#include "memory_profiler.h" -#include "profiler_tree_builder.h" #include "profiler_nodes.h" #include "profiler_printer.h" -#include "profiler_stats_table.h" #include "memory_defs.h" #ifdef UNIT_TEST diff --git a/src/profiler/profiler.cc b/src/profiler/profiler.cc index 4c9563a18..49b1de050 100644 --- a/src/profiler/profiler.cc +++ b/src/profiler/profiler.cc @@ -18,23 +18,22 @@ // profiler.cc author Joel Cornett -#include "profiler.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "profiler.h" + #include -#include #include "framework/module.h" #include "main/snort_config.h" -#include "profiler_nodes.h" #include "memory_context.h" #include "memory_profiler.h" -#include "time_profiler.h" +#include "profiler_nodes.h" #include "rule_profiler.h" +#include "time_profiler.h" #ifdef UNIT_TEST #include "catch/catch.hpp" diff --git a/src/profiler/profiler_nodes.cc b/src/profiler/profiler_nodes.cc index 2349a59f7..a2fd5ac72 100644 --- a/src/profiler/profiler_nodes.cc +++ b/src/profiler/profiler_nodes.cc @@ -18,16 +18,17 @@ // profiler_nodes.cc author Joel Cornett -#include "profiler_nodes.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "profiler_nodes.h" + #include #include #include "framework/module.h" + #include "profiler_defs.h" #ifdef UNIT_TEST diff --git a/src/profiler/profiler_printer.h b/src/profiler/profiler_printer.h index e2388496a..962c03f1d 100644 --- a/src/profiler/profiler_printer.h +++ b/src/profiler/profiler_printer.h @@ -21,8 +21,8 @@ #ifndef PROFILER_PRINTER_H #define PROFILER_PRINTER_H -#include #include +#include #include #include #include diff --git a/src/profiler/profiler_stats_table.cc b/src/profiler/profiler_stats_table.cc index f1dff874f..ab46a371f 100644 --- a/src/profiler/profiler_stats_table.cc +++ b/src/profiler/profiler_stats_table.cc @@ -18,12 +18,12 @@ // profiler_stats_table.cc author Joel Cornett -#include "profiler_stats_table.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "profiler_stats_table.h" + #include #include #include diff --git a/src/profiler/rule_profiler.cc b/src/profiler/rule_profiler.cc index acd3f0de0..f97e6c83b 100644 --- a/src/profiler/rule_profiler.cc +++ b/src/profiler/rule_profiler.cc @@ -18,17 +18,17 @@ // rule_profiler.cc author Joel Cornett -#include "rule_profiler.h" - #if HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include +#include "rule_profiler.h" + +//#include +//#include +//#include +//#include +//#include // this include eventually leads to possible issues with std::chrono: // 1. Undefined or garbage value returned to caller (rep count()) @@ -37,7 +37,6 @@ #include "detection/detection_options.h" // ... FIXIT-W #include "detection/treenodes.h" -#include "hash/sfghash.h" #include "main/snort_config.h" #include "main/thread_config.h" #include "parser/parser.h" diff --git a/src/profiler/rule_profiler_defs.h b/src/profiler/rule_profiler_defs.h index 515dca833..295cb0cb2 100644 --- a/src/profiler/rule_profiler_defs.h +++ b/src/profiler/rule_profiler_defs.h @@ -21,8 +21,8 @@ #ifndef RULE_PROFILER_DEFS_H #define RULE_PROFILER_DEFS_H -#include "detection/treenodes.h" -#include "time_profiler_defs.h" +#include "time/clock_defs.h" +#include "time/stopwatch.h" struct dot_node_state_t; diff --git a/src/profiler/time_profiler.cc b/src/profiler/time_profiler.cc index 292967180..d86567bc4 100644 --- a/src/profiler/time_profiler.cc +++ b/src/profiler/time_profiler.cc @@ -18,15 +18,11 @@ // time_profiler.cc author Joel Cornett -#include "time_profiler.h" - #if HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "time_profiler.h" #include "profiler_nodes.h" #include "profiler_tree_builder.h" diff --git a/src/protocols/ip.cc b/src/protocols/ip.cc index 19483cb28..46c08a5ef 100644 --- a/src/protocols/ip.cc +++ b/src/protocols/ip.cc @@ -17,10 +17,13 @@ //-------------------------------------------------------------------------- // ip.cc author Josh Rosenbaum -#include -#include "protocols/ip.h" -#include "protocols/packet.h" -#include "sfip/sf_ip.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ip.h" + +#include "layer.h" namespace ip { diff --git a/src/protocols/ip.h b/src/protocols/ip.h index e651da3af..2826a2cc4 100644 --- a/src/protocols/ip.h +++ b/src/protocols/ip.h @@ -20,13 +20,6 @@ #ifndef PROTOCOLS_IP_H #define PROTOCOLS_IP_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include #include #include "main/snort_types.h" diff --git a/src/protocols/ipv4.h b/src/protocols/ipv4.h index 9db897758..dbe6d6c7e 100644 --- a/src/protocols/ipv4.h +++ b/src/protocols/ipv4.h @@ -20,15 +20,7 @@ #ifndef PROTOCOLS_IPV4_H #define PROTOCOLS_IPV4_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include #include -#include -#include -#include #include "protocols/protocol_ids.h" // include ipv4 protocol numbers diff --git a/src/protocols/ipv4_options.cc b/src/protocols/ipv4_options.cc index 32d7f1aa2..9ae3407d2 100644 --- a/src/protocols/ipv4_options.cc +++ b/src/protocols/ipv4_options.cc @@ -17,10 +17,13 @@ //-------------------------------------------------------------------------- // ipv4_options.cc author Josh Rosenbaum -#include "protocols/ipv4_options.h" -#include "protocols/ipv4.h" -#include "protocols/layer.h" -#include "protocols/packet.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ipv4_options.h" + +#include "packet.h" namespace ip { diff --git a/src/protocols/ipv4_options.h b/src/protocols/ipv4_options.h index 5437eb5e7..355c04781 100644 --- a/src/protocols/ipv4_options.h +++ b/src/protocols/ipv4_options.h @@ -20,7 +20,6 @@ #ifndef PROTOCOLS_IP_OPTIONS_H #define PROTOCOLS_IP_OPTIONS_H -#include #include "main/snort_types.h" struct Packet; diff --git a/src/protocols/ipv6.h b/src/protocols/ipv6.h index e6f7e7596..6bf648342 100644 --- a/src/protocols/ipv6.h +++ b/src/protocols/ipv6.h @@ -20,15 +20,7 @@ #ifndef PROTOCOLS_IPV6_H #define PROTOCOLS_IPV6_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include #include -#include -#include -#include #include "protocols/protocol_ids.h" diff --git a/src/protocols/layer.cc b/src/protocols/layer.cc index f56d34de2..51b52a1e5 100644 --- a/src/protocols/layer.cc +++ b/src/protocols/layer.cc @@ -17,16 +17,13 @@ //-------------------------------------------------------------------------- // layer.cc author Josh Rosenbaum +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "layer.h" -#include -#include "protocols/layer.h" -#include "protocols/protocol_ids.h" -#include "protocols/packet.h" -#include "protocols/ipv4.h" -#include "protocols/ipv6.h" -#include "protocols/ip.h" -#include "main/thread.h" +#include "packet.h" namespace layer { diff --git a/src/protocols/layer.h b/src/protocols/layer.h index d117f4eb8..b22930776 100644 --- a/src/protocols/layer.h +++ b/src/protocols/layer.h @@ -20,9 +20,8 @@ #ifndef PROTOCOLS_LAYER_H #define PROTOCOLS_LAYER_H -#include #include "main/snort_types.h" -#include "protocol_ids.h" +#include "protocols/protocol_ids.h" struct Layer { diff --git a/src/protocols/packet.cc b/src/protocols/packet.cc index 7a127f568..6aad39d31 100644 --- a/src/protocols/packet.cc +++ b/src/protocols/packet.cc @@ -17,15 +17,16 @@ //-------------------------------------------------------------------------- // packet.cc author Josh Rosenbaum -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "packet.h" -#include "protocols/packet.h" -#include "protocols/packet_manager.h" -#include "protocols/protocol_ids.h" #include "log/obfuscator.h" -#include "log/messages.h" #include "managers/codec_manager.h" -#include "utils/util.h" + +#include "packet_manager.h" Packet::Packet(bool packet_data) { diff --git a/src/protocols/packet.h b/src/protocols/packet.h index d0bebea44..b02d6a795 100644 --- a/src/protocols/packet.h +++ b/src/protocols/packet.h @@ -20,25 +20,11 @@ #ifndef PROTOCOLS_PACKET_H #define PROTOCOLS_PACKET_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include - -extern "C" { #include -} -#include "main/snort_types.h" -#include "framework/decode_data.h" #include "flow/flow.h" -#include "protocols/layer.h" -#include "framework/endianness.h" +#include "framework/decode_data.h" +#include "main/snort_types.h" /* packet status flags */ #define PKT_REBUILT_FRAG 0x00000001 /* is a rebuilt fragment */ diff --git a/src/protocols/packet_manager.cc b/src/protocols/packet_manager.cc index 5a6e26d94..2d6704893 100644 --- a/src/protocols/packet_manager.cc +++ b/src/protocols/packet_manager.cc @@ -17,39 +17,28 @@ //-------------------------------------------------------------------------- // packet_manager.cc author Josh Rosenbaum -#include "protocols/packet_manager.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include -#include -#include // static_assert +#include "packet_manager.h" -#include "framework/codec.h" -#include "managers/codec_manager.h" -#include "main/snort_config.h" -#include "main/thread.h" -#include "log/messages.h" -#include "detection/fp_detect.h" - -#include "protocols/packet.h" -#include "protocols/protocol_ids.h" -#include "protocols/eth.h" -#include "protocols/icmp4.h" -#include "protocols/icmp6.h" -#include "profiler/profiler.h" -#include "parser/parser.h" +#include #include "codecs/codec_module.h" #include "codecs/ip/checksum.h" -#include "utils/stats.h" #include "log/text_log.h" +#include "main/snort_config.h" #include "main/snort_debug.h" -#include "packet_io/sfdaq.h" #include "packet_io/active.h" +#include "packet_io/sfdaq.h" +#include "profiler/profiler_defs.h" #include "stream/stream.h" +#include "eth.h" +#include "icmp4.h" +#include "icmp6.h" + THREAD_LOCAL ProfileStats decodePerfStats; // Decoding statistics diff --git a/src/protocols/packet_manager.h b/src/protocols/packet_manager.h index 8870f36f6..b1fca5b98 100644 --- a/src/protocols/packet_manager.h +++ b/src/protocols/packet_manager.h @@ -23,15 +23,14 @@ // PacketManager provides decode and encode services by leveraging Codecs. #include -#include -#include "main/snort_types.h" -#include "protocols/packet.h" -#include "framework/counts.h" #include "framework/codec.h" +#include "framework/counts.h" +#include "main/snort_types.h" #include "managers/codec_manager.h" +#include "protocols/packet.h" -struct _daq_pkthdr; +struct Packet; struct TextLog; enum class TcpResponse diff --git a/src/protocols/protocol_ids.h b/src/protocols/protocol_ids.h index dd06d2166..cdf4cc9c8 100644 --- a/src/protocols/protocol_ids.h +++ b/src/protocols/protocol_ids.h @@ -20,10 +20,10 @@ #ifndef PROTOCOLS_PROTOCOL_IDS_H #define PROTOCOLS_PROTOCOL_IDS_H -#include +#include #include -#include #include +#include /***************************************************************** ***** NOTE: Protocols are only included in this file when **** diff --git a/src/protocols/ssl.cc b/src/protocols/ssl.cc index 12ee4486e..f28c1569e 100644 --- a/src/protocols/ssl.cc +++ b/src/protocols/ssl.cc @@ -19,18 +19,13 @@ // ssl.h author Adam Keeton -#include "ssl.h" - #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include +#include "ssl.h" -#include "protocols/packet.h" +#include "packet.h" #define THREE_BYTE_LEN(x) (x[2] | x[1] << 8 | x[0] << 16) diff --git a/src/protocols/ssl.h b/src/protocols/ssl.h index 2f040263e..aa6f92ee5 100644 --- a/src/protocols/ssl.h +++ b/src/protocols/ssl.h @@ -22,14 +22,6 @@ #ifndef SSL_H #define SSL_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - #include "main/snort_types.h" #define SSL_NO_FLAG 0x00000000 diff --git a/src/protocols/tcp.h b/src/protocols/tcp.h index 01408cbed..10526ec45 100644 --- a/src/protocols/tcp.h +++ b/src/protocols/tcp.h @@ -20,9 +20,10 @@ #ifndef PROTOCOLS_TCP_H #define PROTOCOLS_TCP_H -#include #include +#include + // these are bits in th_flags: #define TH_FIN 0x01 #define TH_SYN 0x02 diff --git a/src/protocols/tcp_options.cc b/src/protocols/tcp_options.cc index 4f87394de..b0f5b82a3 100644 --- a/src/protocols/tcp_options.cc +++ b/src/protocols/tcp_options.cc @@ -17,10 +17,14 @@ //-------------------------------------------------------------------------- // tcp_options.cc author Josh Rosenbaum -#include "protocols/tcp_options.h" -#include "protocols/tcp.h" -#include "protocols/layer.h" -#include "protocols/packet.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tcp_options.h" + +#include "packet.h" +#include "tcp.h" namespace tcp { diff --git a/src/protocols/tcp_options.h b/src/protocols/tcp_options.h index 17d63295f..3a39e1ae6 100644 --- a/src/protocols/tcp_options.h +++ b/src/protocols/tcp_options.h @@ -20,7 +20,6 @@ #ifndef PROTOCOLS_TCP_OPTIONS_H #define PROTOCOLS_TCP_OPTIONS_H -#include #include "main/snort_types.h" struct Packet; diff --git a/src/protocols/token_ring.h b/src/protocols/token_ring.h index 2a5908db8..f727429e0 100644 --- a/src/protocols/token_ring.h +++ b/src/protocols/token_ring.h @@ -20,8 +20,8 @@ #ifndef PROTOCOLS_TOKEN_RING_H #define PROTOCOLS_TOKEN_RING_H -#include #include + #include "protocols/protocol_ids.h" namespace token_ring diff --git a/src/protocols/udp.h b/src/protocols/udp.h index 4c79534d6..d4e11b509 100644 --- a/src/protocols/udp.h +++ b/src/protocols/udp.h @@ -20,7 +20,6 @@ #ifndef PROTOCOLS_UDP_H #define PROTOCOLS_UDP_H -#include #include namespace udp diff --git a/src/pub_sub/http_events.cc b/src/pub_sub/http_events.cc index 0cff64975..f1cace0a2 100644 --- a/src/pub_sub/http_events.cc +++ b/src/pub_sub/http_events.cc @@ -20,7 +20,12 @@ // Inspection events published by the Http Inspector. Modules can subscribe // to receive the events. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "http_events.h" + #include "service_inspectors/http_inspect/http_msg_header.h" const uint8_t* HttpEvent::get_header(unsigned id, uint64_t sub_id, int32_t& length) diff --git a/src/pub_sub/sip_events.cc b/src/pub_sub/sip_events.cc index 7c8d48e18..4e84eb12c 100644 --- a/src/pub_sub/sip_events.cc +++ b/src/pub_sub/sip_events.cc @@ -17,9 +17,12 @@ //-------------------------------------------------------------------------- // sip_events.cc author Carter Waxman +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sip_events.h" -#include "service_inspectors/sip/sip_common.h" #include "service_inspectors/sip/sip_dialog.h" using namespace std; diff --git a/src/pub_sub/sip_events.h b/src/pub_sub/sip_events.h index 7cd2bcc20..7da27952f 100644 --- a/src/pub_sub/sip_events.h +++ b/src/pub_sub/sip_events.h @@ -26,7 +26,6 @@ #include #include "framework/data_bus.h" -#include "protocols/packet.h" #define SIP_EVENT_TYPE_SIP_DIALOG_KEY "sip_event_type_sip_dialog" @@ -35,6 +34,8 @@ enum SipEventType SIP_EVENT_TYPE_SIP_DIALOG }; +struct Packet; +struct SfIp; struct SIPMsg; struct SIP_DialogData; struct SIP_MediaSession; diff --git a/src/search_engines/CMakeLists.txt b/src/search_engines/CMakeLists.txt index 06ed9d009..fe3648a31 100644 --- a/src/search_engines/CMakeLists.txt +++ b/src/search_engines/CMakeLists.txt @@ -1,6 +1,5 @@ set (SEARCH_ENGINE_INCLUDES - pat_stats.h search_common.h search_tool.h ) @@ -44,6 +43,7 @@ if ( HAVE_HYPERSCAN ) endif () set (SEARCH_ENGINE_SOURCES + pat_stats.h search_engines.cc search_engines.h search_tool.cc diff --git a/src/search_engines/Makefile.am b/src/search_engines/Makefile.am index 2ca19c128..371078831 100644 --- a/src/search_engines/Makefile.am +++ b/src/search_engines/Makefile.am @@ -4,7 +4,6 @@ noinst_LIBRARIES = libsearch_engines.a x_includedir = $(pkgincludedir)/search_engines x_include_HEADERS = \ -pat_stats.h \ search_common.h \ search_tool.h @@ -46,6 +45,7 @@ $(acsmx2_sources) \ $(intel_sources) libsearch_engines_a_SOURCES = \ +pat_stats.h \ search_engines.cc \ search_engines.h \ search_tool.cc \ diff --git a/src/search_engines/ac_banded.cc b/src/search_engines/ac_banded.cc index 2e4ddddbf..855db5369 100644 --- a/src/search_engines/ac_banded.cc +++ b/src/search_engines/ac_banded.cc @@ -17,14 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "framework/mpse.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "profiler/profiler.h" -#include "utils/util.h" -#include "acsmx.h" #include "acsmx2.h" //------------------------------------------------------------------------- diff --git a/src/search_engines/ac_bnfa.cc b/src/search_engines/ac_bnfa.cc index f0c56f3cb..1fa53ad4c 100644 --- a/src/search_engines/ac_bnfa.cc +++ b/src/search_engines/ac_bnfa.cc @@ -26,12 +26,11 @@ * 3/06 - Added AC_BNFA search */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "framework/mpse.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "profiler/profiler.h" -#include "utils/util.h" #include "bnfa_search.h" diff --git a/src/search_engines/ac_full.cc b/src/search_engines/ac_full.cc index 3264ce4ed..7f9f452ee 100644 --- a/src/search_engines/ac_full.cc +++ b/src/search_engines/ac_full.cc @@ -17,14 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "framework/mpse.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "profiler/profiler.h" -#include "utils/util.h" -#include "acsmx.h" #include "acsmx2.h" //------------------------------------------------------------------------- diff --git a/src/search_engines/ac_sparse.cc b/src/search_engines/ac_sparse.cc index ab104a051..56f7ab882 100644 --- a/src/search_engines/ac_sparse.cc +++ b/src/search_engines/ac_sparse.cc @@ -17,14 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "framework/mpse.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "profiler/profiler.h" -#include "utils/util.h" -#include "acsmx.h" #include "acsmx2.h" //------------------------------------------------------------------------- diff --git a/src/search_engines/ac_sparse_bands.cc b/src/search_engines/ac_sparse_bands.cc index 97ebebcb6..65d39c832 100644 --- a/src/search_engines/ac_sparse_bands.cc +++ b/src/search_engines/ac_sparse_bands.cc @@ -17,14 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "framework/mpse.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "profiler/profiler.h" -#include "utils/util.h" -#include "acsmx.h" #include "acsmx2.h" //------------------------------------------------------------------------- diff --git a/src/search_engines/ac_std.cc b/src/search_engines/ac_std.cc index c8384f1e1..c63715b93 100644 --- a/src/search_engines/ac_std.cc +++ b/src/search_engines/ac_std.cc @@ -22,14 +22,8 @@ #endif #include "framework/mpse.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "main/snort_config.h" -#include "profiler/profiler.h" -#include "utils/util.h" #include "acsmx.h" -#include "acsmx2.h" //------------------------------------------------------------------------- // "ac_std" diff --git a/src/search_engines/acsmx.cc b/src/search_engines/acsmx.cc index c53c8b0a3..566594779 100644 --- a/src/search_engines/acsmx.cc +++ b/src/search_engines/acsmx.cc @@ -49,20 +49,14 @@ ** Nov 2,2002: Fixed queue_init() , added count=0 */ -#include "acsmx.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "acsmx.h" #include -#include "main/snort_debug.h" #include "main/thread.h" #include "utils/util.h" diff --git a/src/search_engines/acsmx.h b/src/search_engines/acsmx.h index f7c2e55fc..b088c95a7 100644 --- a/src/search_engines/acsmx.h +++ b/src/search_engines/acsmx.h @@ -25,15 +25,8 @@ // version 1 -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include +#include -#include "main/snort_types.h" #include "search_common.h" #define ALPHABET_SIZE 256 diff --git a/src/search_engines/acsmx2.cc b/src/search_engines/acsmx2.cc index 577329011..3394415fe 100644 --- a/src/search_engines/acsmx2.cc +++ b/src/search_engines/acsmx2.cc @@ -111,28 +111,15 @@ ** SparseBands changed ps increment to 2+n to increment between bands. */ -#include "acsmx2.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "acsmx2.h" #include -#define ACSMX2_TRACK_Q - -#ifdef ACSMX2_TRACK_Q -#include "main/snort_config.h" -#endif - #include "log/messages.h" -#include "main/snort_debug.h" -#include "main/snort_types.h" #include "utils/stats.h" #include "utils/util.h" diff --git a/src/search_engines/acsmx2.h b/src/search_engines/acsmx2.h index c525107bf..866da3533 100644 --- a/src/search_engines/acsmx2.h +++ b/src/search_engines/acsmx2.h @@ -24,10 +24,7 @@ // Version 2.0 -#include -#include -#include -#include +#include #include "search_common.h" diff --git a/src/search_engines/acsmx2_api.cc b/src/search_engines/acsmx2_api.cc index 6b65cf911..9d3159039 100644 --- a/src/search_engines/acsmx2_api.cc +++ b/src/search_engines/acsmx2_api.cc @@ -21,7 +21,8 @@ #include "config.h" #endif -#include "framework/mpse.h" +#include "main/snort_types.h" + #include "search_engines.h" extern const BaseApi* se_ac_banded; diff --git a/src/search_engines/bnfa_search.cc b/src/search_engines/bnfa_search.cc index 0ea284925..18595bff6 100644 --- a/src/search_engines/bnfa_search.cc +++ b/src/search_engines/bnfa_search.cc @@ -139,24 +139,16 @@ ** queue ops is optional, as this can impose a modest ** performance hit of a few percent. */ -#include "bnfa_search.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include +#include "bnfa_search.h" #include -#include "search_common.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "utils/stats.h" #include "utils/util.h" diff --git a/src/search_engines/bnfa_search.h b/src/search_engines/bnfa_search.h index f0167032e..862ccce1a 100644 --- a/src/search_engines/bnfa_search.h +++ b/src/search_engines/bnfa_search.h @@ -30,10 +30,7 @@ ** date: 12/21/05 */ -#include -#include -#include -#include +#include #include "search_common.h" diff --git a/src/search_engines/hyperscan.cc b/src/search_engines/hyperscan.cc index 7349ff9bb..cd522e07a 100644 --- a/src/search_engines/hyperscan.cc +++ b/src/search_engines/hyperscan.cc @@ -18,18 +18,18 @@ // hyperscan.cc author Russ Combs -#include "hyperscan.h" - -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "hyperscan.h" #include #include +#include +#include + #include "framework/mpse.h" #include "log/messages.h" #include "main/snort_config.h" diff --git a/src/search_engines/intel_cpm.cc b/src/search_engines/intel_cpm.cc index 13179bdb7..f301db053 100644 --- a/src/search_engines/intel_cpm.cc +++ b/src/search_engines/intel_cpm.cc @@ -17,13 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#ifdef INTEL_SOFT_CPM -#include "intel_soft_cpm.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "intel_soft_cpm.h" + #include "framework/mpse.h" #include "main/snort_debug.h" #include "main/snort_types.h" @@ -157,5 +156,3 @@ const BaseApi* se_intel_cpm[] = nullptr }; -#endif - diff --git a/src/search_engines/intel_soft_cpm.cc b/src/search_engines/intel_soft_cpm.cc index 365eb9321..88983d77d 100644 --- a/src/search_engines/intel_soft_cpm.cc +++ b/src/search_engines/intel_soft_cpm.cc @@ -17,6 +17,10 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "intel_soft_cpm.h" #include diff --git a/src/search_engines/search_engines.cc b/src/search_engines/search_engines.cc index a758a7d42..4bc707385 100644 --- a/src/search_engines/search_engines.cc +++ b/src/search_engines/search_engines.cc @@ -16,12 +16,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "search_engines.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "search_engines.h" + #include "managers/plugin_manager.h" struct BaseApi; diff --git a/src/search_engines/search_tool.cc b/src/search_engines/search_tool.cc index 9594edec1..93a4214bc 100644 --- a/src/search_engines/search_tool.cc +++ b/src/search_engines/search_tool.cc @@ -17,14 +17,12 @@ //-------------------------------------------------------------------------- // search_tool.cc author Russ Combs -#include "search_tool.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "search_tool.h" -#include "main/thread.h" -#include "framework/mpse.h" #include "managers/mpse_manager.h" SearchTool::SearchTool() : SearchTool("ac_bnfa") diff --git a/src/search_engines/test/hyperscan_test.cc b/src/search_engines/test/hyperscan_test.cc index 30365279a..a162e7baa 100644 --- a/src/search_engines/test/hyperscan_test.cc +++ b/src/search_engines/test/hyperscan_test.cc @@ -18,6 +18,10 @@ // hyperscan_test.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "search_engines/hyperscan.h" #include diff --git a/src/search_engines/test/search_tool_test.cc b/src/search_engines/test/search_tool_test.cc index a82c5db71..1d5ec449f 100644 --- a/src/search_engines/test/search_tool_test.cc +++ b/src/search_engines/test/search_tool_test.cc @@ -18,6 +18,10 @@ // search_tool_test.cc author Steve Chew +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + // Change private to public to give access to private members. #define private public #include "search_engines/search_tool.h" @@ -70,7 +74,7 @@ FileVerdict FilePolicy::signature_lookup(Flow*, FileContext*) FileVerdict FilePolicy::signature_lookup(Flow*, FileInfo*) { return FILE_VERDICT_UNKNOWN; } -void LogValue(const char*, const char*, FILE* = stdout) +void LogValue(const char*, const char*, FILE*) { } @@ -86,7 +90,7 @@ void FatalError(const char*,...) void LogCount(char const*, uint64_t, FILE*) { } -void LogStat(const char*, double, FILE* = stdout) +void LogStat(const char*, double, FILE*) {} static void* s_tree = (void*)"tree"; diff --git a/src/service_inspectors/back_orifice/back_orifice.cc b/src/service_inspectors/back_orifice/back_orifice.cc index 4b25f7a9f..ffd104167 100644 --- a/src/service_inspectors/back_orifice/back_orifice.cc +++ b/src/service_inspectors/back_orifice/back_orifice.cc @@ -109,25 +109,11 @@ #include "config.h" #endif -#include -#include -#include -#include -#include - -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/detect.h" -#include "events/event.h" #include "events/event_queue.h" -#include "parser/parser.h" -#include "utils/util.h" -#include "profiler/profiler.h" #include "framework/inspector.h" #include "framework/module.h" -#include "protocols/udp.h" +#include "log/messages.h" +#include "profiler/profiler.h" #include "protocols/packet.h" #define BO_DEFAULT_KEY 31337 diff --git a/src/service_inspectors/dce_rpc/dce_co.cc b/src/service_inspectors/dce_rpc/dce_co.cc index 45ed502e0..855a2b922 100644 --- a/src/service_inspectors/dce_rpc/dce_co.cc +++ b/src/service_inspectors/dce_rpc/dce_co.cc @@ -19,6 +19,10 @@ // dce_co.cc author Rashmi Pitre // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_co.h" #include "main/snort_debug.h" @@ -26,9 +30,9 @@ #include "dce_smb.h" #include "dce_smb_module.h" +#include "dce_smb_utils.h" #include "dce_tcp.h" #include "dce_tcp_module.h" -#include "dce_smb_utils.h" THREAD_LOCAL int co_reassembled = 0; diff --git a/src/service_inspectors/dce_rpc/dce_common.cc b/src/service_inspectors/dce_rpc/dce_common.cc index c51a31b04..4ef5fa2bc 100644 --- a/src/service_inspectors/dce_rpc/dce_common.cc +++ b/src/service_inspectors/dce_rpc/dce_common.cc @@ -18,6 +18,10 @@ // dce_common.cc author Rashmi Pitre +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_common.h" #include "detection/detect.h" diff --git a/src/service_inspectors/dce_rpc/dce_common.h b/src/service_inspectors/dce_rpc/dce_common.h index f868a3d98..32143b6e3 100644 --- a/src/service_inspectors/dce_rpc/dce_common.h +++ b/src/service_inspectors/dce_rpc/dce_common.h @@ -23,6 +23,7 @@ #include "events/event_queue.h" #include "framework/counts.h" +#include "framework/endianness.h" #include "framework/value.h" #include "protocols/packet.h" #include diff --git a/src/service_inspectors/dce_rpc/dce_list.cc b/src/service_inspectors/dce_rpc/dce_list.cc index b7adaaee1..0f74bc81d 100644 --- a/src/service_inspectors/dce_rpc/dce_list.cc +++ b/src/service_inspectors/dce_rpc/dce_list.cc @@ -25,6 +25,10 @@ * ****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_list.h" #include "main/snort_debug.h" diff --git a/src/service_inspectors/dce_rpc/dce_smb.cc b/src/service_inspectors/dce_rpc/dce_smb.cc index 43ad89b6e..619d0808b 100644 --- a/src/service_inspectors/dce_rpc/dce_smb.cc +++ b/src/service_inspectors/dce_rpc/dce_smb.cc @@ -18,6 +18,10 @@ // dce_smb.cc author Rashmi Pitre +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb.h" #include "detection/detect.h" @@ -26,11 +30,11 @@ #include "utils/util.h" #include "packet_io/active.h" +#include "dce_smb_commands.h" #include "dce_smb_module.h" -#include "dce_smb_utils.h" #include "dce_smb_paf.h" -#include "dce_smb_commands.h" #include "dce_smb_transaction.h" +#include "dce_smb_utils.h" #include "dce_smb2.h" THREAD_LOCAL int dce2_smb_inspector_instances = 0; diff --git a/src/service_inspectors/dce_rpc/dce_smb2.cc b/src/service_inspectors/dce_rpc/dce_smb2.cc index 4d79d44cb..a2171fde1 100644 --- a/src/service_inspectors/dce_rpc/dce_smb2.cc +++ b/src/service_inspectors/dce_rpc/dce_smb2.cc @@ -19,6 +19,10 @@ // SMB2 file processing // Author(s): Hui Cao +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb2.h" #include "detection/detection_util.h" diff --git a/src/service_inspectors/dce_rpc/dce_smb_commands.cc b/src/service_inspectors/dce_rpc/dce_smb_commands.cc index 526929dd3..7471f6fe2 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_commands.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_commands.cc @@ -21,6 +21,10 @@ // Smb commands processing +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb_commands.h" #include "main/snort_debug.h" diff --git a/src/service_inspectors/dce_rpc/dce_smb_module.cc b/src/service_inspectors/dce_rpc/dce_smb_module.cc index 9c68fca06..57a782687 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_module.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_module.cc @@ -18,6 +18,10 @@ // dce_smb_module.cc author Rashmi Pitre +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb_module.h" #include "log/messages.h" diff --git a/src/service_inspectors/dce_rpc/dce_smb_paf.cc b/src/service_inspectors/dce_rpc/dce_smb_paf.cc index c604ce06f..0f5daf17b 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_paf.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_paf.cc @@ -19,6 +19,10 @@ // dce_smb_paf.cc author Rashmi Pitre // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb_paf.h" #include "main/snort_debug.h" diff --git a/src/service_inspectors/dce_rpc/dce_smb_transaction.cc b/src/service_inspectors/dce_rpc/dce_smb_transaction.cc index bb76165b2..9b8c46926 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_transaction.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_transaction.cc @@ -21,6 +21,10 @@ // Smb transaction commands processing +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb_transaction.h" #include "main/snort_debug.h" diff --git a/src/service_inspectors/dce_rpc/dce_smb_transaction_utils.cc b/src/service_inspectors/dce_rpc/dce_smb_transaction_utils.cc index cd4dcf5b9..c20144f89 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_transaction_utils.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_transaction_utils.cc @@ -21,6 +21,10 @@ // Smb transaction commands utils +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb_transaction_utils.h" #include "main/snort_debug.h" diff --git a/src/service_inspectors/dce_rpc/dce_smb_utils.cc b/src/service_inspectors/dce_rpc/dce_smb_utils.cc index 02d0ef24c..ffd6d1773 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_utils.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_utils.cc @@ -19,12 +19,17 @@ // dce_smb_utils.cc author Maya Dagon // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb_utils.h" +#include "detection/detect.h" #include "detection/detection_util.h" -#include "utils/util.h" -#include "packet_io/active.h" #include "main/snort.h" +#include "packet_io/active.h" +#include "utils/util.h" #include "dce_smb_module.h" @@ -1478,7 +1483,7 @@ void DCE2_SmbAbortFileAPI(DCE2_SmbSsnData* ssd) ssd->fapi_ftracker = nullptr; } -FileContext* DCE2_get_main_file_context(DCE2_SmbSsnData* ssd) +static FileContext* DCE2_get_main_file_context(DCE2_SmbSsnData* ssd) { assert(ssd->sd.wire_pkt); FileFlows* file_flows = FileFlows::get_file_flows((ssd->sd.wire_pkt)->flow); diff --git a/src/service_inspectors/dce_rpc/dce_tcp.cc b/src/service_inspectors/dce_rpc/dce_tcp.cc index 6c68db098..fc4d33ca0 100644 --- a/src/service_inspectors/dce_rpc/dce_tcp.cc +++ b/src/service_inspectors/dce_rpc/dce_tcp.cc @@ -19,6 +19,10 @@ // dce_tcp.cc author Rashmi Pitre // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_tcp.h" #include "detection/detect.h" diff --git a/src/service_inspectors/dce_rpc/dce_tcp_module.cc b/src/service_inspectors/dce_rpc/dce_tcp_module.cc index c34a2ff23..928d2470c 100644 --- a/src/service_inspectors/dce_rpc/dce_tcp_module.cc +++ b/src/service_inspectors/dce_rpc/dce_tcp_module.cc @@ -18,6 +18,10 @@ // dce_tcp_module.cc author Rashmi Pitre +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_tcp_module.h" #include "log/messages.h" diff --git a/src/service_inspectors/dce_rpc/dce_tcp_paf.cc b/src/service_inspectors/dce_rpc/dce_tcp_paf.cc index e2c045406..d120b683f 100644 --- a/src/service_inspectors/dce_rpc/dce_tcp_paf.cc +++ b/src/service_inspectors/dce_rpc/dce_tcp_paf.cc @@ -19,6 +19,10 @@ // dce_tcp_paf.cc author Rashmi Pitre // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_tcp_paf.h" #include "main/snort_debug.h" diff --git a/src/service_inspectors/dce_rpc/dce_udp.cc b/src/service_inspectors/dce_rpc/dce_udp.cc index 4097e0f0e..04ba694b7 100644 --- a/src/service_inspectors/dce_rpc/dce_udp.cc +++ b/src/service_inspectors/dce_rpc/dce_udp.cc @@ -19,6 +19,10 @@ // dce_udp.cc author Maya Dagon // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_udp.h" #include "detection/detect.h" diff --git a/src/service_inspectors/dce_rpc/dce_udp_module.cc b/src/service_inspectors/dce_rpc/dce_udp_module.cc index 14057b2a8..222bb1257 100644 --- a/src/service_inspectors/dce_rpc/dce_udp_module.cc +++ b/src/service_inspectors/dce_rpc/dce_udp_module.cc @@ -18,6 +18,10 @@ // dce_udp_module.cc author Maya Dagon +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_udp_module.h" #include "log/messages.h" diff --git a/src/service_inspectors/dce_rpc/dce_udp_processing.cc b/src/service_inspectors/dce_rpc/dce_udp_processing.cc index 87acb1420..9c8c4458c 100644 --- a/src/service_inspectors/dce_rpc/dce_udp_processing.cc +++ b/src/service_inspectors/dce_rpc/dce_udp_processing.cc @@ -26,6 +26,10 @@ // within each activity. Also sets appropriate data for use with // preprocessor rule options. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_udp.h" #include "flow/session.h" diff --git a/src/service_inspectors/dce_rpc/dce_utils.cc b/src/service_inspectors/dce_rpc/dce_utils.cc index e971dd65c..d3a0fc4f2 100644 --- a/src/service_inspectors/dce_rpc/dce_utils.cc +++ b/src/service_inspectors/dce_rpc/dce_utils.cc @@ -17,11 +17,15 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_utils.h" #include "main/snort_debug.h" -#include "utils/util.h" #include "utils/safec.h" +#include "utils/util.h" /******************************************************************** * Function: DCE2_GetValue() diff --git a/src/service_inspectors/dce_rpc/ips_dce_iface.cc b/src/service_inspectors/dce_rpc/ips_dce_iface.cc index a6a0cef92..d6771ce47 100644 --- a/src/service_inspectors/dce_rpc/ips_dce_iface.cc +++ b/src/service_inspectors/dce_rpc/ips_dce_iface.cc @@ -19,6 +19,10 @@ // ips_dce_iface.cc author Maya Dagon // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include "detection/detection_defines.h" diff --git a/src/service_inspectors/dce_rpc/ips_dce_opnum.cc b/src/service_inspectors/dce_rpc/ips_dce_opnum.cc index a64c247a7..f25e02883 100644 --- a/src/service_inspectors/dce_rpc/ips_dce_opnum.cc +++ b/src/service_inspectors/dce_rpc/ips_dce_opnum.cc @@ -19,6 +19,10 @@ // ips_dce_opnum.cc author Maya Dagon // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" diff --git a/src/service_inspectors/dce_rpc/ips_dce_stub_data.cc b/src/service_inspectors/dce_rpc/ips_dce_stub_data.cc index c21ed1d44..7f687b054 100644 --- a/src/service_inspectors/dce_rpc/ips_dce_stub_data.cc +++ b/src/service_inspectors/dce_rpc/ips_dce_stub_data.cc @@ -19,6 +19,10 @@ // ips_dce_stub_data.cc author Maya Dagon // based on work by Todd Wease +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detection/detection_defines.h" #include "framework/cursor.h" #include "framework/ips_option.h" diff --git a/src/service_inspectors/dce_rpc/smb_message.cc b/src/service_inspectors/dce_rpc/smb_message.cc index ae27b4482..7c8fe5d7a 100644 --- a/src/service_inspectors/dce_rpc/smb_message.cc +++ b/src/service_inspectors/dce_rpc/smb_message.cc @@ -18,6 +18,10 @@ // smb_message.cc author Rashmi Pitre +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dce_smb.h" #include "detection/detect.h" @@ -26,13 +30,13 @@ #include "utils/util.h" #include "packet_io/active.h" +#include "dce_smb.h" +#include "dce_smb_commands.h" #include "dce_smb_module.h" -#include "dce_smb_utils.h" #include "dce_smb_paf.h" -#include "dce_smb_commands.h" #include "dce_smb_transaction.h" +#include "dce_smb_utils.h" #include "dce_smb2.h" -#include "dce_smb.h" /******************************************************************** * Global variables diff --git a/src/service_inspectors/dnp3/dnp3.cc b/src/service_inspectors/dnp3/dnp3.cc index e145bc27d..9ef66fae1 100644 --- a/src/service_inspectors/dnp3/dnp3.cc +++ b/src/service_inspectors/dnp3/dnp3.cc @@ -19,11 +19,17 @@ // dnp3.cc author Rashmi Pitre // based on work by Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dnp3.h" -#include "dnp3_paf.h" -#include "dnp3_reassembly.h" #include "events/event_queue.h" +#include "protocols/packet.h" + +#include "dnp3_paf.h" +#include "dnp3_reassembly.h" THREAD_LOCAL Dnp3Stats dnp3_stats; THREAD_LOCAL ProfileStats dnp3_perf_stats; diff --git a/src/service_inspectors/dnp3/dnp3.h b/src/service_inspectors/dnp3/dnp3.h index 1a9d2e483..e9f281cb1 100644 --- a/src/service_inspectors/dnp3/dnp3.h +++ b/src/service_inspectors/dnp3/dnp3.h @@ -22,9 +22,9 @@ #ifndef DNP3_H #define DNP3_H -#include "protocols/packet.h" -#include "profiler/profiler.h" +#include "flow/flow.h" #include "framework/counts.h" +#include "profiler/profiler_defs.h" #define DNP3_NAME "dnp3" #define DNP3_HELP "dnp3 inspection" diff --git a/src/service_inspectors/dnp3/dnp3_map.cc b/src/service_inspectors/dnp3/dnp3_map.cc index 41e7d51f8..0e78e14b9 100644 --- a/src/service_inspectors/dnp3/dnp3_map.cc +++ b/src/service_inspectors/dnp3/dnp3_map.cc @@ -19,9 +19,14 @@ // dnp3_map.cc author Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dnp3_map.h" -#include -#include + +#include +#include /* Name/value pair struct */ struct dnp3_map_t diff --git a/src/service_inspectors/dnp3/dnp3_map.h b/src/service_inspectors/dnp3/dnp3_map.h index 8a70c1cf8..b7366a90b 100644 --- a/src/service_inspectors/dnp3/dnp3_map.h +++ b/src/service_inspectors/dnp3/dnp3_map.h @@ -22,7 +22,7 @@ #ifndef DNP3_MAP__H #define DNP3_MAP__H -#include +#include /* Check if "code" is in the function map. * diff --git a/src/service_inspectors/dnp3/dnp3_module.cc b/src/service_inspectors/dnp3/dnp3_module.cc index b49643b87..a24153402 100644 --- a/src/service_inspectors/dnp3/dnp3_module.cc +++ b/src/service_inspectors/dnp3/dnp3_module.cc @@ -18,10 +18,15 @@ // dnp3_module.cc author Rashmi Pitre +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dnp3_module.h" -#include "dnp3.h" + #include "log/messages.h" -#include "main/snort_config.h" + +#include "dnp3.h" using namespace std; diff --git a/src/service_inspectors/dnp3/dnp3_paf.cc b/src/service_inspectors/dnp3/dnp3_paf.cc index a224a667b..1e2ab3ace 100644 --- a/src/service_inspectors/dnp3/dnp3_paf.cc +++ b/src/service_inspectors/dnp3/dnp3_paf.cc @@ -19,7 +19,12 @@ // dnp3_paf.cc author Rashmi Pitre // based on work by Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dnp3_paf.h" + #include "dnp3.h" /* Function: dnp3_paf() diff --git a/src/service_inspectors/dnp3/dnp3_paf.h b/src/service_inspectors/dnp3/dnp3_paf.h index 6ef0533c1..efe04418e 100644 --- a/src/service_inspectors/dnp3/dnp3_paf.h +++ b/src/service_inspectors/dnp3/dnp3_paf.h @@ -24,7 +24,6 @@ // Protocol aware flushing for DNP3. -#include "main/snort_types.h" #include "stream/stream_splitter.h" enum dnp3_paf_state diff --git a/src/service_inspectors/dnp3/dnp3_reassembly.cc b/src/service_inspectors/dnp3/dnp3_reassembly.cc index ad4074e3a..917a9968d 100644 --- a/src/service_inspectors/dnp3/dnp3_reassembly.cc +++ b/src/service_inspectors/dnp3/dnp3_reassembly.cc @@ -20,12 +20,17 @@ // dnp3_reassembly.cc author Ryan Jordan // modifications for snort3 by Rashmi Pitre +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dnp3_reassembly.h" -#include "events/event_queue.h" + #include "detection/detect.h" +#include "events/event_queue.h" +#include "protocols/packet.h" + #include "dnp3_map.h" -#include "dnp3.h" -#include "dnp3_module.h" /* CRC look-up table, for computeCRC() below */ static uint16_t crcLookUpTable[256] = diff --git a/src/service_inspectors/dnp3/ips_dnp3_data.cc b/src/service_inspectors/dnp3/ips_dnp3_data.cc index 277181dea..c30957b5c 100644 --- a/src/service_inspectors/dnp3/ips_dnp3_data.cc +++ b/src/service_inspectors/dnp3/ips_dnp3_data.cc @@ -19,6 +19,10 @@ // ips_dnp3_data.cc author Maya Dagon // based on work by Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detection/detection_defines.h" #include "framework/cursor.h" #include "framework/ips_option.h" diff --git a/src/service_inspectors/dnp3/ips_dnp3_func.cc b/src/service_inspectors/dnp3/ips_dnp3_func.cc index 00fa7e247..cb104d56d 100644 --- a/src/service_inspectors/dnp3/ips_dnp3_func.cc +++ b/src/service_inspectors/dnp3/ips_dnp3_func.cc @@ -19,12 +19,16 @@ // ips_dnp3_func.cc author Maya Dagon // based on work by Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" #include "profiler/profiler.h" +#include "protocols/packet.h" #include "dnp3.h" #include "dnp3_map.h" diff --git a/src/service_inspectors/dnp3/ips_dnp3_ind.cc b/src/service_inspectors/dnp3/ips_dnp3_ind.cc index 276944f77..f51d20092 100644 --- a/src/service_inspectors/dnp3/ips_dnp3_ind.cc +++ b/src/service_inspectors/dnp3/ips_dnp3_ind.cc @@ -19,12 +19,16 @@ // ips_dnp3_ind.cc author Maya Dagon // based on work by Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" #include "profiler/profiler.h" +#include "protocols/packet.h" #include "dnp3.h" #include "dnp3_map.h" diff --git a/src/service_inspectors/dnp3/ips_dnp3_obj.cc b/src/service_inspectors/dnp3/ips_dnp3_obj.cc index 3ed919c02..75eede649 100644 --- a/src/service_inspectors/dnp3/ips_dnp3_obj.cc +++ b/src/service_inspectors/dnp3/ips_dnp3_obj.cc @@ -19,13 +19,16 @@ // ips_dnp3_obj.cc author Maya Dagon // based on work by Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" -#include "detection/detect.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" #include "profiler/profiler.h" +#include "protocols/packet.h" #include "dnp3.h" diff --git a/src/service_inspectors/dns/dns.cc b/src/service_inspectors/dns/dns.cc index 14dc1cd88..7868b2588 100644 --- a/src/service_inspectors/dns/dns.cc +++ b/src/service_inspectors/dns/dns.cc @@ -21,26 +21,17 @@ // Alert for DNS client rdata buffer overflow. // Alert for Obsolete or Experimental RData types (per RFC 1035) -#include "dns.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "dns.h" #include "events/event_queue.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "profiler/profiler.h" -#include "parser/parser.h" -#include "framework/inspector.h" +#include "protocols/packet.h" #include "stream/stream.h" -#include "utils/sfsnprintfappend.h" #include "dns_module.h" diff --git a/src/service_inspectors/dns/dns.h b/src/service_inspectors/dns/dns.h index 0eae5dcf6..7e56eddc6 100644 --- a/src/service_inspectors/dns/dns.h +++ b/src/service_inspectors/dns/dns.h @@ -22,7 +22,7 @@ #ifndef DNS_H #define DNS_H -#include "protocols/packet.h" +#include "flow/flow.h" // Implementation header with definitions, datatypes and flowdata class for // DNS service inspector. diff --git a/src/service_inspectors/dns/dns_module.cc b/src/service_inspectors/dns/dns_module.cc index 7817a6bec..3c5961f67 100644 --- a/src/service_inspectors/dns/dns_module.cc +++ b/src/service_inspectors/dns/dns_module.cc @@ -18,9 +18,11 @@ // dns_module.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dns_module.h" -#include -#include using namespace std; diff --git a/src/service_inspectors/dns/dns_module.h b/src/service_inspectors/dns/dns_module.h index d17f3081a..49a100837 100644 --- a/src/service_inspectors/dns/dns_module.h +++ b/src/service_inspectors/dns/dns_module.h @@ -22,8 +22,8 @@ #define DNS_MODULE_H //Interface to the DNS service inspector -#include "framework/module.h" #include "framework/bits.h" +#include "framework/module.h" #include "main/thread.h" #define GID_DNS 131 diff --git a/src/service_inspectors/ftp_telnet/ft_main.cc b/src/service_inspectors/ftp_telnet/ft_main.cc index 4632a7c92..732ae7d99 100644 --- a/src/service_inspectors/ftp_telnet/ft_main.cc +++ b/src/service_inspectors/ftp_telnet/ft_main.cc @@ -38,21 +38,21 @@ * of the external network. */ -#include "ft_main.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "ftpp_return_codes.h" -#include "ftp_cmd_lookup.h" -#include "ftp_bounce_lookup.h" +#include "ft_main.h" #include "detection/detect.h" #include "framework/data_bus.h" #include "log/messages.h" #include "utils/util.h" +#include "ftp_cmd_lookup.h" +#include "ftp_bounce_lookup.h" +#include "ftpp_return_codes.h" + void CleanupFTPCMDConf(void* ftpCmd) { FTP_CMD_CONF* FTPCmd = (FTP_CMD_CONF*)ftpCmd; diff --git a/src/service_inspectors/ftp_telnet/ft_main.h b/src/service_inspectors/ftp_telnet/ft_main.h index 61ee0f8fa..691c775d9 100644 --- a/src/service_inspectors/ftp_telnet/ft_main.h +++ b/src/service_inspectors/ftp_telnet/ft_main.h @@ -32,16 +32,13 @@ #ifndef FT_MAIN_H #define FT_MAIN_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "ftpp_ui_config.h" -#include "protocols/packet.h" #define BUF_SIZE 1024 +struct Packet; struct ProfileStats; +struct SnortConfig; extern int16_t ftp_data_app_id; diff --git a/src/service_inspectors/ftp_telnet/ftp.cc b/src/service_inspectors/ftp_telnet/ftp.cc index 6cd1e7975..816ee13e1 100644 --- a/src/service_inspectors/ftp_telnet/ftp.cc +++ b/src/service_inspectors/ftp_telnet/ftp.cc @@ -21,25 +21,26 @@ #include "config.h" #endif -#include "ftp_module.h" -#include "ftpp_si.h" -#include "ftpp_return_codes.h" -#include "ftp_cmd_lookup.h" +#include "main/snort_config.h" +#include "managers/inspector_manager.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" +#include "stream/stream.h" +#include "target_based/snort_protocols.h" +#include "utils/util.h" + #include "ft_main.h" +#include "ftp_cmd_lookup.h" +#include "ftp_data.h" +#include "ftp_module.h" #include "ftp_parse.h" #include "ftp_print.h" #include "ftp_splitter.h" +#include "ftpp_return_codes.h" +#include "ftpp_si.h" #include "pp_ftp.h" -#include "ftp_data.h" #include "telnet.h" -#include "main/snort_config.h" -#include "main/snort_types.h" -#include "managers/inspector_manager.h" -#include "profiler/profiler.h" -#include "target_based/snort_protocols.h" -#include "utils/util.h" - int16_t ftp_data_app_id = SFTARGET_UNKNOWN_PROTOCOL; #define client_key "ftp_client" diff --git a/src/service_inspectors/ftp_telnet/ftp_bounce_lookup.cc b/src/service_inspectors/ftp_telnet/ftp_bounce_lookup.cc index eb43d2793..17fffea54 100644 --- a/src/service_inspectors/ftp_telnet/ftp_bounce_lookup.cc +++ b/src/service_inspectors/ftp_telnet/ftp_bounce_lookup.cc @@ -35,10 +35,14 @@ * Kevin Liu */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ftp_bounce_lookup.h" -#include "ftpp_return_codes.h" #include "ft_main.h" +#include "ftpp_return_codes.h" /* * Function: ftp_bounce_lookup_init(BOUNCE_LOOKUP **BounceLookup) diff --git a/src/service_inspectors/ftp_telnet/ftp_cmd_lookup.cc b/src/service_inspectors/ftp_telnet/ftp_cmd_lookup.cc index 9279413a6..d7d76edd8 100644 --- a/src/service_inspectors/ftp_telnet/ftp_cmd_lookup.cc +++ b/src/service_inspectors/ftp_telnet/ftp_cmd_lookup.cc @@ -34,10 +34,14 @@ * Kevin Liu */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ftp_cmd_lookup.h" -#include "ftpp_return_codes.h" #include "ft_main.h" +#include "ftpp_return_codes.h" /* * Function: ftp_cmd_lookup_init(CMD_LOOKUP **CmdLookup) diff --git a/src/service_inspectors/ftp_telnet/ftp_data.cc b/src/service_inspectors/ftp_telnet/ftp_data.cc index f9adb2c9d..9eaa1f81e 100644 --- a/src/service_inspectors/ftp_telnet/ftp_data.cc +++ b/src/service_inspectors/ftp_telnet/ftp_data.cc @@ -17,21 +17,22 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "ftp_data.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "ftp_module.h" -#include "ftpp_si.h" +#include "ftp_data.h" #include "detection/detection_util.h" -#include "file_api/file_service.h" #include "file_api/file_flows.h" +#include "file_api/file_service.h" +#include "packet_io/active.h" #include "profiler/profiler.h" +#include "stream/stream.h" #include "utils/util.h" -#include "packet_io/active.h" + +#include "ftp_module.h" +#include "ftpp_si.h" #define s_name "ftp_data" diff --git a/src/service_inspectors/ftp_telnet/ftp_module.cc b/src/service_inspectors/ftp_telnet/ftp_module.cc index 7bbd43a16..6acdb01e0 100644 --- a/src/service_inspectors/ftp_telnet/ftp_module.cc +++ b/src/service_inspectors/ftp_telnet/ftp_module.cc @@ -18,9 +18,11 @@ // ftp_module.cc author Russ Combs -#include "ftp_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "ftp_module.h" #include "log/messages.h" diff --git a/src/service_inspectors/ftp_telnet/ftp_module.h b/src/service_inspectors/ftp_telnet/ftp_module.h index 73cda43f7..a7f535efd 100644 --- a/src/service_inspectors/ftp_telnet/ftp_module.h +++ b/src/service_inspectors/ftp_telnet/ftp_module.h @@ -21,12 +21,8 @@ #ifndef FTP_MODULE_H #define FTP_MODULE_H -#include -#include - -#include "ftpp_ui_config.h" #include "framework/module.h" -#include "main/thread.h" +#include "ftpp_ui_config.h" #define GID_FTP 125 diff --git a/src/service_inspectors/ftp_telnet/ftp_parse.cc b/src/service_inspectors/ftp_telnet/ftp_parse.cc index 7f91d3290..c42a7c981 100644 --- a/src/service_inspectors/ftp_telnet/ftp_parse.cc +++ b/src/service_inspectors/ftp_telnet/ftp_parse.cc @@ -23,18 +23,21 @@ * Marc A. Norton */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ftp_parse.h" -#include +#include + +#include "log/messages.h" +#include "utils/util.h" #include "ftp_bounce_lookup.h" #include "ftp_cmd_lookup.h" #include "ftpp_return_codes.h" -#include "log/messages.h" -#include "sfip/sf_ip.h" -#include "utils/util.h" - #define CONF_SEPARATORS " \n" #define ALLOW_BOUNCE "bounce_to" diff --git a/src/service_inspectors/ftp_telnet/ftp_parse.h b/src/service_inspectors/ftp_telnet/ftp_parse.h index 053c63ab4..9edfc0740 100644 --- a/src/service_inspectors/ftp_telnet/ftp_parse.h +++ b/src/service_inspectors/ftp_telnet/ftp_parse.h @@ -26,8 +26,6 @@ #define FTP_PARSE_H #include "ftpp_ui_config.h" -#include "protocols/packet.h" -#include "framework/bits.h" /* * These are the definitions of the parser section delimiting diff --git a/src/service_inspectors/ftp_telnet/ftp_print.cc b/src/service_inspectors/ftp_telnet/ftp_print.cc index a74bfcc42..5d0e16bda 100644 --- a/src/service_inspectors/ftp_telnet/ftp_print.cc +++ b/src/service_inspectors/ftp_telnet/ftp_print.cc @@ -23,21 +23,23 @@ * Marc A. Norton */ -#include "ftp_print.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "ftp_print.h" + +#include + +#include "log/messages.h" +#include "utils/sfsnprintfappend.h" + #include "ft_main.h" -#include "ftp_cmd_lookup.h" #include "ftp_bounce_lookup.h" +#include "ftp_cmd_lookup.h" #include "ftp_parse.h" #include "ftpp_return_codes.h" -#include "log/messages.h" -#include "utils/sfsnprintfappend.h" - int PrintConfOpt(bool on, const char* Option) { LogMessage(" %s: %s\n", Option, on ? "ON" : "OFF"); diff --git a/src/service_inspectors/ftp_telnet/ftp_splitter.cc b/src/service_inspectors/ftp_telnet/ftp_splitter.cc index 020de9cc8..fd2eac1f8 100644 --- a/src/service_inspectors/ftp_telnet/ftp_splitter.cc +++ b/src/service_inspectors/ftp_telnet/ftp_splitter.cc @@ -17,9 +17,13 @@ //-------------------------------------------------------------------------- // ftp_splitter.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ftp_splitter.h" -#include +#include FtpSplitter::FtpSplitter(bool c2s) : StreamSplitter(c2s) { } FtpSplitter::~FtpSplitter() { } diff --git a/src/service_inspectors/ftp_telnet/ftpp_si.cc b/src/service_inspectors/ftp_telnet/ftpp_si.cc index 53a40a748..197421cef 100644 --- a/src/service_inspectors/ftp_telnet/ftpp_si.cc +++ b/src/service_inspectors/ftp_telnet/ftpp_si.cc @@ -42,15 +42,20 @@ * Marc A. Norton * Kevin Liu */ -#include "ftpp_si.h" -#include "ft_main.h" -#include "ftpp_return_codes.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ftpp_si.h" -#include "sfip/sf_ip.h" +#include "protocols/packet.h" #include "stream/stream.h" #include "utils/util.h" +#include "ft_main.h" +#include "ftpp_return_codes.h" + unsigned FtpFlowData::flow_id = 0; unsigned TelnetFlowData::flow_id = 0; diff --git a/src/service_inspectors/ftp_telnet/ftpp_si.h b/src/service_inspectors/ftp_telnet/ftpp_si.h index 8b832b128..4bf344726 100644 --- a/src/service_inspectors/ftp_telnet/ftpp_si.h +++ b/src/service_inspectors/ftp_telnet/ftpp_si.h @@ -36,15 +36,13 @@ #ifndef FTPP_SI_H #define FTPP_SI_H -#include +#include "file_api/file_api.h" +#include "flow/flow.h" +#include "flow/flow_key.h" -#include "ftpp_ui_config.h" #include "ftp_client.h" #include "ftp_server.h" -#include "protocols/packet.h" -#include "file_api/file_api.h" -#include "flow/flow.h" -#include "stream/stream.h" +#include "ftpp_ui_config.h" /* * These are the defines for the different types of diff --git a/src/service_inspectors/ftp_telnet/ftpp_ui_config.cc b/src/service_inspectors/ftp_telnet/ftpp_ui_config.cc index 3d030eaf1..cfe0c6115 100644 --- a/src/service_inspectors/ftp_telnet/ftpp_ui_config.cc +++ b/src/service_inspectors/ftp_telnet/ftpp_ui_config.cc @@ -31,14 +31,19 @@ * Daniel J. Roelker * Marc A. Norton */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ftpp_ui_config.h" +#include "utils/util.h" + #include "ftp_bounce_lookup.h" #include "ftp_cmd_lookup.h" #include "ftpp_return_codes.h" -#include "utils/util.h" - FTP_CLIENT_PROTO_CONF::FTP_CLIENT_PROTO_CONF() { memset(this, 0, sizeof(*this)); diff --git a/src/service_inspectors/ftp_telnet/ftpp_ui_config.h b/src/service_inspectors/ftp_telnet/ftpp_ui_config.h index f40cccd63..7e0e40b50 100644 --- a/src/service_inspectors/ftp_telnet/ftpp_ui_config.h +++ b/src/service_inspectors/ftp_telnet/ftpp_ui_config.h @@ -38,9 +38,7 @@ #ifndef FTPP_UI_CONFIG_H #define FTPP_UI_CONFIG_H -#include "framework/bits.h" #include "sfip/sf_ip.h" -#include "sfrt/sfrt.h" #include "utils/kmap.h" /* diff --git a/src/service_inspectors/ftp_telnet/pp_ftp.cc b/src/service_inspectors/ftp_telnet/pp_ftp.cc index 3a8f0667a..b310a13e5 100644 --- a/src/service_inspectors/ftp_telnet/pp_ftp.cc +++ b/src/service_inspectors/ftp_telnet/pp_ftp.cc @@ -34,15 +34,16 @@ /* your preprocessor header file goes here */ -#include "pp_ftp.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "pp_ftp.h" + #include "detection/detection_util.h" #include "file_api/file_service.h" -#include "sfip/sf_ip.h" +#include "protocols/packet.h" +#include "stream/stream.h" #include "utils/util.h" #include "ft_main.h" diff --git a/src/service_inspectors/ftp_telnet/pp_ftp.h b/src/service_inspectors/ftp_telnet/pp_ftp.h index e30021456..3e7be9137 100644 --- a/src/service_inspectors/ftp_telnet/pp_ftp.h +++ b/src/service_inspectors/ftp_telnet/pp_ftp.h @@ -24,9 +24,6 @@ // declares the ftp checking functions -#include - -#include "ftpp_ui_config.h" #include "ftpp_si.h" /* list of function prototypes for this preprocessor */ diff --git a/src/service_inspectors/ftp_telnet/pp_telnet.cc b/src/service_inspectors/ftp_telnet/pp_telnet.cc index fa7aec791..8158fc7f3 100644 --- a/src/service_inspectors/ftp_telnet/pp_telnet.cc +++ b/src/service_inspectors/ftp_telnet/pp_telnet.cc @@ -41,16 +41,18 @@ /* your preprocessor header file goes here */ -#include "pp_telnet.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "ftpp_return_codes.h" -#include "telnet_module.h" +#include "pp_telnet.h" #include "detection/detection_util.h" +#include "protocols/packet.h" +#include "stream/stream.h" + +#include "ftpp_return_codes.h" +#include "telnet_module.h" #define NUL 0x00 #define CR 0x0d diff --git a/src/service_inspectors/ftp_telnet/pp_telnet.h b/src/service_inspectors/ftp_telnet/pp_telnet.h index e3e2498c5..195c12950 100644 --- a/src/service_inspectors/ftp_telnet/pp_telnet.h +++ b/src/service_inspectors/ftp_telnet/pp_telnet.h @@ -24,18 +24,11 @@ // declares the telnet checking functions -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - /* RFC 885 defines an End of Record telnet option */ #define RFC885 /* RFC 1184 defines Abort, Suspend, and End of File telnet optinos */ #define RFC1184 -#include "ftpp_ui_config.h" #include "ftpp_si.h" /* define the telnet negotiation codes (TNC) that we're interested in */ diff --git a/src/service_inspectors/ftp_telnet/telnet.cc b/src/service_inspectors/ftp_telnet/telnet.cc index b3f6816e0..0be5463c1 100644 --- a/src/service_inspectors/ftp_telnet/telnet.cc +++ b/src/service_inspectors/ftp_telnet/telnet.cc @@ -17,12 +17,16 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "telnet.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "telnet.h" + +#include "log/messages.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" + #include "ft_main.h" #include "ftp_print.h" #include "ftpp_return_codes.h" @@ -31,9 +35,6 @@ #include "pp_telnet.h" #include "telnet_module.h" -#include "log/messages.h" -#include "profiler/profiler.h" - THREAD_LOCAL ProfileStats telnetPerfStats; THREAD_LOCAL SimpleStats tnstats; diff --git a/src/service_inspectors/ftp_telnet/telnet_module.cc b/src/service_inspectors/ftp_telnet/telnet_module.cc index 68f6440cd..5e8bace6f 100644 --- a/src/service_inspectors/ftp_telnet/telnet_module.cc +++ b/src/service_inspectors/ftp_telnet/telnet_module.cc @@ -18,8 +18,14 @@ // telnet_module.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "telnet_module.h" +#include + using namespace std; //------------------------------------------------------------------------- diff --git a/src/service_inspectors/ftp_telnet/telnet_module.h b/src/service_inspectors/ftp_telnet/telnet_module.h index ff9b23608..35f714a21 100644 --- a/src/service_inspectors/ftp_telnet/telnet_module.h +++ b/src/service_inspectors/ftp_telnet/telnet_module.h @@ -21,9 +21,8 @@ #ifndef TELNET_MODULE_H #define TELNET_MODULE_H -#include "ftpp_ui_config.h" #include "framework/module.h" -#include "main/thread.h" +#include "ftpp_ui_config.h" #define GID_TELNET 126 diff --git a/src/service_inspectors/gtp/gtp.cc b/src/service_inspectors/gtp/gtp.cc index 10fe59ca8..efa89a135 100644 --- a/src/service_inspectors/gtp/gtp.cc +++ b/src/service_inspectors/gtp/gtp.cc @@ -26,23 +26,10 @@ #include "gtp.h" -#include -#include -#include -#include -#include -#include -#include -#include - #include "main/snort_debug.h" -#include "main/snort_types.h" #include "protocols/packet.h" -#include "profiler/profiler.h" -#include "gtp.h" #include "gtp_inspect.h" -#include "gtp_parser.h" #define GTPMSG_ZERO_LEN offsetof(GTPMsg, msg_id) diff --git a/src/service_inspectors/gtp/gtp.h b/src/service_inspectors/gtp/gtp.h index 68e940031..cd45069f8 100644 --- a/src/service_inspectors/gtp/gtp.h +++ b/src/service_inspectors/gtp/gtp.h @@ -25,8 +25,9 @@ // Provides convenience functions for parsing and querying configuration. #include -#include "main/thread.h" + #include "framework/counts.h" +#include "main/thread.h" #define MIN_GTP_VERSION_CODE (0) #define MAX_GTP_VERSION_CODE (2) diff --git a/src/service_inspectors/gtp/gtp_inspect.cc b/src/service_inspectors/gtp/gtp_inspect.cc index 6d4115e28..5afb1ec02 100644 --- a/src/service_inspectors/gtp/gtp_inspect.cc +++ b/src/service_inspectors/gtp/gtp_inspect.cc @@ -19,15 +19,15 @@ // gtp_inspect.cc author Russ Combs // adapt 2x preprocessor code to 3x inspector -#include "gtp_inspect.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "gtp_inspect.h" + #include "managers/inspector_manager.h" -#include "protocols/packet.h" #include "profiler/profiler.h" +#include "protocols/packet.h" #include "gtp.h" #include "gtp_module.h" diff --git a/src/service_inspectors/gtp/gtp_inspect.h b/src/service_inspectors/gtp/gtp_inspect.h index 31c56e3c5..366f7bf0e 100644 --- a/src/service_inspectors/gtp/gtp_inspect.h +++ b/src/service_inspectors/gtp/gtp_inspect.h @@ -22,6 +22,7 @@ #define GTP_INSPECT_H #include "flow/flow.h" + #include "gtp_parser.h" // FIXIT-M why store per packet on flow? diff --git a/src/service_inspectors/gtp/gtp_module.cc b/src/service_inspectors/gtp/gtp_module.cc index 25edc8329..0a9201e99 100644 --- a/src/service_inspectors/gtp/gtp_module.cc +++ b/src/service_inspectors/gtp/gtp_module.cc @@ -18,13 +18,18 @@ // gtp_module.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "gtp_module.h" #include -#include "gtp.h" #include "profiler/profiler.h" +#include "gtp.h" + THREAD_LOCAL ProfileStats gtp_inspect_prof; #define GTP_EVENT_BAD_MSG_LEN_STR "message length is invalid" diff --git a/src/service_inspectors/gtp/gtp_module.h b/src/service_inspectors/gtp/gtp_module.h index 424659788..3b07dfb86 100644 --- a/src/service_inspectors/gtp/gtp_module.h +++ b/src/service_inspectors/gtp/gtp_module.h @@ -21,11 +21,7 @@ #ifndef GTP_MODULE_H #define GTP_MODULE_H -#include -#include - #include "framework/module.h" -#include "main/thread.h" #define GID_GTP 143 diff --git a/src/service_inspectors/gtp/gtp_parser.cc b/src/service_inspectors/gtp/gtp_parser.cc index c4d8a8021..08f2ea911 100644 --- a/src/service_inspectors/gtp/gtp_parser.cc +++ b/src/service_inspectors/gtp/gtp_parser.cc @@ -26,13 +26,10 @@ #include "gtp_parser.h" -#include +#include -#include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "events/event_queue.h" -#include "protocols/packet.h" +#include "log/messages.h" #include "gtp.h" #include "gtp_module.h" diff --git a/src/service_inspectors/gtp/gtp_parser.h b/src/service_inspectors/gtp/gtp_parser.h index 2431a8e91..90823bd74 100644 --- a/src/service_inspectors/gtp/gtp_parser.h +++ b/src/service_inspectors/gtp/gtp_parser.h @@ -22,7 +22,7 @@ #ifndef GTP_PARSER_H #define GTP_PARSER_H -#include "main/snort_types.h" +#include struct GTP_IEData { diff --git a/src/service_inspectors/gtp/ips_gtp_info.cc b/src/service_inspectors/gtp/ips_gtp_info.cc index fe78c5831..de1cd3fcb 100644 --- a/src/service_inspectors/gtp/ips_gtp_info.cc +++ b/src/service_inspectors/gtp/ips_gtp_info.cc @@ -24,15 +24,13 @@ // gtp_info rule option implementation -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "detection/detection_defines.h" +#include "hash/sfhashfcn.h" #include "framework/cursor.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "hash/sfhashfcn.h" -#include "protocols/packet.h" #include "profiler/profiler.h" +#include "protocols/packet.h" #include "gtp.h" #include "gtp_inspect.h" diff --git a/src/service_inspectors/gtp/ips_gtp_type.cc b/src/service_inspectors/gtp/ips_gtp_type.cc index b02c9228e..4be3d81ef 100644 --- a/src/service_inspectors/gtp/ips_gtp_type.cc +++ b/src/service_inspectors/gtp/ips_gtp_type.cc @@ -24,10 +24,7 @@ // gtp_type rule option implementation -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "detection/detection_defines.h" -#include "framework/bits.h" #include "framework/ips_option.h" #include "framework/module.h" #include "hash/sfhashfcn.h" diff --git a/src/service_inspectors/gtp/ips_gtp_version.cc b/src/service_inspectors/gtp/ips_gtp_version.cc index b4388cf76..61deb5637 100644 --- a/src/service_inspectors/gtp/ips_gtp_version.cc +++ b/src/service_inspectors/gtp/ips_gtp_version.cc @@ -24,8 +24,6 @@ // gtp_version rule option implementation -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" diff --git a/src/service_inspectors/http_inspect/http_api.cc b/src/service_inspectors/http_inspect/http_api.cc index fcfb0c8a1..66548c977 100644 --- a/src/service_inspectors/http_inspect/http_api.cc +++ b/src/service_inspectors/http_inspect/http_api.cc @@ -17,13 +17,14 @@ //-------------------------------------------------------------------------- // http_api.cc author Tom Peters -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" -#include "http_inspect.h" #include "http_api.h" +#include "http_inspect.h" + const char* HttpApi::http_my_name = HTTP_NAME; const char* HttpApi::http_help = "the new HTTP inspector!"; diff --git a/src/service_inspectors/http_inspect/http_api.h b/src/service_inspectors/http_inspect/http_api.h index 8dd821f92..e5836973d 100644 --- a/src/service_inspectors/http_inspect/http_api.h +++ b/src/service_inspectors/http_inspect/http_api.h @@ -20,12 +20,11 @@ #ifndef HTTP_API_H #define HTTP_API_H -#include "framework/parameter.h" -#include "framework/module.h" #include "framework/inspector.h" +#include "framework/module.h" -#include "http_module.h" #include "http_flow_data.h" +#include "http_module.h" class HttpApi { diff --git a/src/service_inspectors/http_inspect/http_cutter.cc b/src/service_inspectors/http_inspect/http_cutter.cc index 3ecb951a5..e53202cb4 100644 --- a/src/service_inspectors/http_inspect/http_cutter.cc +++ b/src/service_inspectors/http_inspect/http_cutter.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // http_cutter.cc author Tom Peters +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "http_cutter.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_cutter.h b/src/service_inspectors/http_inspect/http_cutter.h index 15fd30f9e..c5175b6ce 100644 --- a/src/service_inspectors/http_inspect/http_cutter.h +++ b/src/service_inspectors/http_inspect/http_cutter.h @@ -23,8 +23,8 @@ #include #include "http_enum.h" -#include "http_infractions.h" #include "http_event_gen.h" +#include "http_infractions.h" //------------------------------------------------------------------------- // HttpCutter class and subclasses diff --git a/src/service_inspectors/http_inspect/http_enum.h b/src/service_inspectors/http_inspect/http_enum.h index ca21a6280..2c1dc5b9b 100644 --- a/src/service_inspectors/http_inspect/http_enum.h +++ b/src/service_inspectors/http_inspect/http_enum.h @@ -20,7 +20,7 @@ #ifndef HTTP_ENUM_H #define HTTP_ENUM_H -#include +#include namespace HttpEnums { diff --git a/src/service_inspectors/http_inspect/http_event_gen.h b/src/service_inspectors/http_inspect/http_event_gen.h index 7943377fd..454516539 100644 --- a/src/service_inspectors/http_inspect/http_event_gen.h +++ b/src/service_inspectors/http_inspect/http_event_gen.h @@ -20,13 +20,13 @@ #ifndef HTTP_EVENT_GEN_H #define HTTP_EVENT_GEN_H -#include #include +#include #include "events/event_queue.h" +#include "utils/util.h" #include "http_enum.h" -#include "utils/util.h" //------------------------------------------------------------------------- // Event generator class diff --git a/src/service_inspectors/http_inspect/http_field.cc b/src/service_inspectors/http_inspect/http_field.cc index e3dfcf642..580e37c29 100644 --- a/src/service_inspectors/http_inspect/http_field.cc +++ b/src/service_inspectors/http_inspect/http_field.cc @@ -17,14 +17,13 @@ //-------------------------------------------------------------------------- // http_field.cc author Tom Peters -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "main/snort_types.h" +#include "http_field.h" -#include "http_enum.h" #include "http_test_manager.h" -#include "http_field.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_flow_data.cc b/src/service_inspectors/http_inspect/http_flow_data.cc index fdbfc5785..b01189310 100644 --- a/src/service_inspectors/http_inspect/http_flow_data.cc +++ b/src/service_inspectors/http_inspect/http_flow_data.cc @@ -17,11 +17,14 @@ //-------------------------------------------------------------------------- // http_flow_data.cc author Tom Peters -#include "http_enum.h" -#include "http_test_manager.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "http_flow_data.h" + +#include "http_test_manager.h" #include "http_transaction.h" -#include "http_js_norm.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_head_norm.cc b/src/service_inspectors/http_inspect/http_head_norm.cc index ff5925edc..dd99ad286 100644 --- a/src/service_inspectors/http_inspect/http_head_norm.cc +++ b/src/service_inspectors/http_inspect/http_head_norm.cc @@ -17,14 +17,10 @@ //-------------------------------------------------------------------------- // http_head_norm.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "main/snort_types.h" - -#include "http_enum.h" -#include "http_str_to_code.h" #include "http_head_norm.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_inspect.cc b/src/service_inspectors/http_inspect/http_inspect.cc index 18d83ab59..3156e9432 100644 --- a/src/service_inspectors/http_inspect/http_inspect.cc +++ b/src/service_inspectors/http_inspect/http_inspect.cc @@ -17,24 +17,22 @@ //-------------------------------------------------------------------------- // http_inspect.cc author Tom Peters -#include "http_inspect.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "http_inspect.h" -#include "main/snort_types.h" +#include "protocols/packet.h" -#include "http_enum.h" -#include "http_msg_request.h" -#include "http_msg_status.h" -#include "http_msg_header.h" #include "http_msg_body.h" #include "http_msg_body_chunk.h" #include "http_msg_body_cl.h" #include "http_msg_body_old.h" +#include "http_msg_header.h" +#include "http_msg_request.h" +#include "http_msg_status.h" #include "http_msg_trailer.h" -#include "http_test_manager.h" -#include "http_field.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_js_norm.cc b/src/service_inspectors/http_inspect/http_js_norm.cc index f65525a5c..761a751f4 100644 --- a/src/service_inspectors/http_inspect/http_js_norm.cc +++ b/src/service_inspectors/http_inspect/http_js_norm.cc @@ -17,11 +17,14 @@ //-------------------------------------------------------------------------- // http_js_norm.cc author Tom Peters +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "http_js_norm.h" + #include "utils/util_jsnorm.h" -#include "utils/util.h" #include "utils/safec.h" -#include "http_enum.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_module.cc b/src/service_inspectors/http_inspect/http_module.cc index cb3d4da80..a7ab1219c 100644 --- a/src/service_inspectors/http_inspect/http_module.cc +++ b/src/service_inspectors/http_inspect/http_module.cc @@ -17,14 +17,16 @@ //-------------------------------------------------------------------------- // http_module.cc author Tom Peters -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "http_module.h" #include "log/messages.h" -#include "http_uri_norm.h" #include "http_js_norm.h" -#include "http_module.h" +#include "http_uri_norm.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_body.cc b/src/service_inspectors/http_inspect/http_msg_body.cc index d0353c965..61ee1466a 100644 --- a/src/service_inspectors/http_inspect/http_msg_body.cc +++ b/src/service_inspectors/http_inspect/http_msg_body.cc @@ -17,20 +17,17 @@ //-------------------------------------------------------------------------- // http_msg_body.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "http_msg_body.h" -#include "detection/detection_util.h" -#include "file_api/file_api.h" #include "file_api/file_flows.h" -#include "mime/file_mime_process.h" -#include "http_enum.h" #include "http_api.h" -#include "http_msg_request.h" -#include "http_msg_body.h" #include "http_js_norm.h" +#include "http_msg_request.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_body_chunk.cc b/src/service_inspectors/http_inspect/http_msg_body_chunk.cc index 7e2a4a5cb..7ba04c536 100644 --- a/src/service_inspectors/http_inspect/http_msg_body_chunk.cc +++ b/src/service_inspectors/http_inspect/http_msg_body_chunk.cc @@ -17,13 +17,10 @@ //-------------------------------------------------------------------------- // http_msg_body_chunk.cc author Tom Peters -#include -#include -#include - -#include "mime/file_mime_process.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" #include "http_msg_body_chunk.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_body_cl.cc b/src/service_inspectors/http_inspect/http_msg_body_cl.cc index 1e98b3e17..74718683f 100644 --- a/src/service_inspectors/http_inspect/http_msg_body_cl.cc +++ b/src/service_inspectors/http_inspect/http_msg_body_cl.cc @@ -17,17 +17,10 @@ //-------------------------------------------------------------------------- // http_msg_body_cl.cc author Tom Peters -#include -#include -#include - -#include "detection/detection_util.h" -#include "file_api/file_api.h" -#include "file_api/file_flows.h" -#include "mime/file_mime_process.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" -#include "http_msg_request.h" #include "http_msg_body_cl.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_body_old.cc b/src/service_inspectors/http_inspect/http_msg_body_old.cc index 2846da782..ac4132fba 100644 --- a/src/service_inspectors/http_inspect/http_msg_body_old.cc +++ b/src/service_inspectors/http_inspect/http_msg_body_old.cc @@ -17,17 +17,10 @@ //-------------------------------------------------------------------------- // http_msg_body_old.cc author Tom Peters -#include -#include -#include - -#include "detection/detection_util.h" -#include "file_api/file_api.h" -#include "file_api/file_flows.h" -#include "mime/file_mime_process.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" -#include "http_msg_request.h" #include "http_msg_body_old.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_head_shared.cc b/src/service_inspectors/http_inspect/http_msg_head_shared.cc index 89287a5f5..d1e653129 100644 --- a/src/service_inspectors/http_inspect/http_msg_head_shared.cc +++ b/src/service_inspectors/http_inspect/http_msg_head_shared.cc @@ -17,13 +17,10 @@ //-------------------------------------------------------------------------- // http_msg_head_shared.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" -#include "http_normalizers.h" -#include "http_uri_norm.h" #include "http_msg_head_shared.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_head_shared_util.cc b/src/service_inspectors/http_inspect/http_msg_head_shared_util.cc index f48f83d16..bc1fb3667 100644 --- a/src/service_inspectors/http_inspect/http_msg_head_shared_util.cc +++ b/src/service_inspectors/http_inspect/http_msg_head_shared_util.cc @@ -17,8 +17,11 @@ //-------------------------------------------------------------------------- // http_msg_head_shared_util.cc author Tom Peters +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "http_msg_head_shared.h" -#include int32_t HttpMsgHeadShared::get_next_code(const Field& field, int32_t& offset, const StrCode table[]) diff --git a/src/service_inspectors/http_inspect/http_msg_header.cc b/src/service_inspectors/http_inspect/http_msg_header.cc index 5adeda033..23a8f97b8 100644 --- a/src/service_inspectors/http_inspect/http_msg_header.cc +++ b/src/service_inspectors/http_inspect/http_msg_header.cc @@ -17,21 +17,18 @@ //-------------------------------------------------------------------------- // http_msg_header.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "http_msg_header.h" -#include "utils/util.h" -#include "detection/detection_util.h" -#include "file_api/file_service.h" #include "file_api/file_flows.h" +#include "file_api/file_service.h" +#include "pub_sub/http_events.h" -#include "http_module.h" #include "http_api.h" -#include "http_normalizers.h" #include "http_msg_request.h" -#include "http_msg_header.h" -#include "pub_sub/http_events.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_request.cc b/src/service_inspectors/http_inspect/http_msg_request.cc index 75b0b2604..9d58087a1 100644 --- a/src/service_inspectors/http_inspect/http_msg_request.cc +++ b/src/service_inspectors/http_inspect/http_msg_request.cc @@ -17,16 +17,13 @@ //-------------------------------------------------------------------------- // http_msg_request.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "detection/detection_util.h" +#include "http_msg_request.h" -#include "http_enum.h" #include "http_api.h" -#include "http_msg_request.h" -#include "http_msg_header.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_section.cc b/src/service_inspectors/http_inspect/http_msg_section.cc index 5ab442d1c..3cbc7e02e 100644 --- a/src/service_inspectors/http_inspect/http_msg_section.cc +++ b/src/service_inspectors/http_inspect/http_msg_section.cc @@ -17,20 +17,19 @@ //-------------------------------------------------------------------------- // http_msg_section.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" -#include "http_transaction.h" -#include "http_test_manager.h" #include "http_msg_section.h" -#include "http_msg_request.h" -#include "http_msg_status.h" + +#include "http_msg_body.h" #include "http_msg_head_shared.h" #include "http_msg_header.h" +#include "http_msg_request.h" +#include "http_msg_status.h" #include "http_msg_trailer.h" -#include "http_msg_body.h" +#include "http_test_manager.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_start.cc b/src/service_inspectors/http_inspect/http_msg_start.cc index 2742cb5aa..45003a9b4 100644 --- a/src/service_inspectors/http_inspect/http_msg_start.cc +++ b/src/service_inspectors/http_inspect/http_msg_start.cc @@ -17,11 +17,10 @@ //-------------------------------------------------------------------------- // http_msg_start.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" #include "http_msg_start.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_status.cc b/src/service_inspectors/http_inspect/http_msg_status.cc index 28cbe86f4..08429dfe5 100644 --- a/src/service_inspectors/http_inspect/http_msg_status.cc +++ b/src/service_inspectors/http_inspect/http_msg_status.cc @@ -17,16 +17,13 @@ //-------------------------------------------------------------------------- // http_msg_status.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "detection/detection_util.h" +#include "http_msg_status.h" -#include "http_enum.h" #include "http_api.h" -#include "http_msg_status.h" -#include "http_msg_header.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_msg_trailer.cc b/src/service_inspectors/http_inspect/http_msg_trailer.cc index e72ca3056..d423fb4fb 100644 --- a/src/service_inspectors/http_inspect/http_msg_trailer.cc +++ b/src/service_inspectors/http_inspect/http_msg_trailer.cc @@ -17,15 +17,13 @@ //-------------------------------------------------------------------------- // http_msg_trailer.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "detection/detection_util.h" +#include "http_msg_trailer.h" -#include "http_enum.h" #include "http_api.h" -#include "http_msg_trailer.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_normalizers.cc b/src/service_inspectors/http_inspect/http_normalizers.cc index 1750e3112..93d4e1e2d 100644 --- a/src/service_inspectors/http_inspect/http_normalizers.cc +++ b/src/service_inspectors/http_inspect/http_normalizers.cc @@ -17,11 +17,10 @@ //-------------------------------------------------------------------------- // http_normalizers.cc author Tom Peters -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" -#include "http_str_to_code.h" #include "http_normalizers.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_str_to_code.cc b/src/service_inspectors/http_inspect/http_str_to_code.cc index b77379fd8..cf829ebce 100644 --- a/src/service_inspectors/http_inspect/http_str_to_code.cc +++ b/src/service_inspectors/http_inspect/http_str_to_code.cc @@ -17,12 +17,15 @@ //-------------------------------------------------------------------------- // http_str_to_code.cc author Tom Peters -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "main/snort_types.h" +#include "http_str_to_code.h" + +#include #include "http_enum.h" -#include "http_str_to_code.h" // Need to replace this simple algorithm for better performance FIXIT-P int32_t str_to_code(const uint8_t* text, const int32_t text_len, const StrCode table[]) diff --git a/src/service_inspectors/http_inspect/http_str_to_code.h b/src/service_inspectors/http_inspect/http_str_to_code.h index 66a23e925..f504c5b81 100644 --- a/src/service_inspectors/http_inspect/http_str_to_code.h +++ b/src/service_inspectors/http_inspect/http_str_to_code.h @@ -20,6 +20,8 @@ #ifndef HTTP_STR_TO_CODE_H #define HTTP_STR_TO_CODE_H +#include + struct StrCode { int32_t code; diff --git a/src/service_inspectors/http_inspect/http_stream_splitter_reassemble.cc b/src/service_inspectors/http_inspect/http_stream_splitter_reassemble.cc index 2b8a8782b..15846116e 100644 --- a/src/service_inspectors/http_inspect/http_stream_splitter_reassemble.cc +++ b/src/service_inspectors/http_inspect/http_stream_splitter_reassemble.cc @@ -17,16 +17,15 @@ //-------------------------------------------------------------------------- // http_stream_splitter_reassemble.cc author Tom Peters -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "protocols/packet.h" -#include "file_api/file_flows.h" -#include "http_enum.h" -#include "http_field.h" -#include "http_test_manager.h" -#include "http_test_input.h" #include "http_inspect.h" #include "http_stream_splitter.h" +#include "http_test_input.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_stream_splitter_scan.cc b/src/service_inspectors/http_inspect/http_stream_splitter_scan.cc index d861fb8d3..ca17a7c62 100644 --- a/src/service_inspectors/http_inspect/http_stream_splitter_scan.cc +++ b/src/service_inspectors/http_inspect/http_stream_splitter_scan.cc @@ -17,18 +17,16 @@ //-------------------------------------------------------------------------- // http_stream_splitter_scan.cc author Tom Peters -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "file_api/file_flows.h" -#include "http_enum.h" -#include "http_field.h" -#include "http_msg_request.h" -#include "http_test_manager.h" -#include "http_test_input.h" -#include "http_cutter.h" + #include "http_inspect.h" +#include "http_msg_request.h" #include "http_stream_splitter.h" +#include "http_test_input.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_tables.cc b/src/service_inspectors/http_inspect/http_tables.cc index 3c6c1c082..7a720dd5a 100644 --- a/src/service_inspectors/http_inspect/http_tables.cc +++ b/src/service_inspectors/http_inspect/http_tables.cc @@ -21,23 +21,8 @@ #include "config.h" #endif -#include -#include - -#include "framework/module.h" -#include "framework/counts.h" - -#include "utils/util_utf.h" - -#include "http_enum.h" -#include "http_str_to_code.h" -#include "http_normalizers.h" -#include "http_head_norm.h" -#include "http_msg_request.h" #include "http_msg_header.h" -#include "http_module.h" -#include "http_uri_norm.h" -#include "http_cutter.h" +#include "http_msg_request.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_test_input.cc b/src/service_inspectors/http_inspect/http_test_input.cc index 7fdabf6b3..5234c6795 100644 --- a/src/service_inspectors/http_inspect/http_test_input.cc +++ b/src/service_inspectors/http_inspect/http_test_input.cc @@ -17,14 +17,16 @@ //-------------------------------------------------------------------------- // http_test_input.cc author Tom Peters +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef REG_TEST -#include -#include +#include "http_test_input.h" #include "http_module.h" #include "http_test_manager.h" -#include "http_test_input.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_test_manager.cc b/src/service_inspectors/http_inspect/http_test_manager.cc index c0f93715e..f9745cbc0 100644 --- a/src/service_inspectors/http_inspect/http_test_manager.cc +++ b/src/service_inspectors/http_inspect/http_test_manager.cc @@ -17,11 +17,14 @@ //-------------------------------------------------------------------------- // http_test_manager.cc author Tom Peters -#ifdef REG_TEST +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#ifdef REG_TEST #include "http_test_manager.h" + #include "http_test_input.h" bool HttpTestManager::test_input = false; diff --git a/src/service_inspectors/http_inspect/http_transaction.cc b/src/service_inspectors/http_inspect/http_transaction.cc index 9baafede5..df864411e 100644 --- a/src/service_inspectors/http_inspect/http_transaction.cc +++ b/src/service_inspectors/http_inspect/http_transaction.cc @@ -17,15 +17,17 @@ //-------------------------------------------------------------------------- // http_transaction.cc author Tom Peters -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" #include "http_transaction.h" + +#include "http_msg_body.h" +#include "http_msg_header.h" #include "http_msg_request.h" #include "http_msg_status.h" -#include "http_msg_header.h" #include "http_msg_trailer.h" -#include "http_msg_body.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/http_uri.cc b/src/service_inspectors/http_inspect/http_uri.cc index 48a939f04..15e2eb31c 100644 --- a/src/service_inspectors/http_inspect/http_uri.cc +++ b/src/service_inspectors/http_inspect/http_uri.cc @@ -17,13 +17,10 @@ //-------------------------------------------------------------------------- // http_uri.cc author Tom Peters -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "http_enum.h" -#include "http_module.h" #include "http_uri.h" #include "hash/sfhashfcn.h" diff --git a/src/service_inspectors/http_inspect/http_uri_norm.cc b/src/service_inspectors/http_inspect/http_uri_norm.cc index 93f05b0eb..a740b69b8 100644 --- a/src/service_inspectors/http_inspect/http_uri_norm.cc +++ b/src/service_inspectors/http_inspect/http_uri_norm.cc @@ -17,17 +17,16 @@ //-------------------------------------------------------------------------- // http_uri_norm.cc author Tom Peters -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "http_uri_norm.h" + #include -#include #include "log/messages.h" -#include "http_enum.h" -#include "http_uri_norm.h" - using namespace HttpEnums; void UriNormalizer::normalize(const Field& input, Field& result, bool do_path, uint8_t* buffer, diff --git a/src/service_inspectors/http_inspect/ips_http.cc b/src/service_inspectors/http_inspect/ips_http.cc index 9f3a3be79..181c6ab2b 100644 --- a/src/service_inspectors/http_inspect/ips_http.cc +++ b/src/service_inspectors/http_inspect/ips_http.cc @@ -17,18 +17,20 @@ //-------------------------------------------------------------------------- // ips_http.cc author Tom Peters -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ips_http.h" -#include "protocols/packet.h" -#include "flow/flow.h" #include "detection/detection_defines.h" #include "framework/cursor.h" #include "hash/sfhashfcn.h" #include "log/messages.h" +#include "protocols/packet.h" #include "http_inspect.h" #include "http_msg_head_shared.h" -#include "ips_http.h" using namespace HttpEnums; diff --git a/src/service_inspectors/http_inspect/ips_http.h b/src/service_inspectors/http_inspect/ips_http.h index 7d79c80a8..2193480d8 100644 --- a/src/service_inspectors/http_inspect/ips_http.h +++ b/src/service_inspectors/http_inspect/ips_http.h @@ -20,14 +20,8 @@ #ifndef IPS_HTTP_H #define IPS_HTTP_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include #include -#include "main/snort_types.h" #include "profiler/profiler.h" #include "framework/ips_option.h" #include "framework/module.h" diff --git a/src/service_inspectors/http_inspect/test/http_module_test.cc b/src/service_inspectors/http_inspect/test/http_module_test.cc index cc46d4d68..38c434311 100644 --- a/src/service_inspectors/http_inspect/test/http_module_test.cc +++ b/src/service_inspectors/http_inspect/test/http_module_test.cc @@ -19,6 +19,10 @@ // http_module_test.cc author Tom Peters // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "log/messages.h" #include "events/event_queue.h" diff --git a/src/service_inspectors/http_inspect/test/http_msg_head_shared_util_test.cc b/src/service_inspectors/http_inspect/test/http_msg_head_shared_util_test.cc index f4f64052f..fe72cc1af 100644 --- a/src/service_inspectors/http_inspect/test/http_msg_head_shared_util_test.cc +++ b/src/service_inspectors/http_inspect/test/http_msg_head_shared_util_test.cc @@ -19,6 +19,10 @@ // http_msg_head_shared_util_test.cc author Tom Peters // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_inspectors/http_inspect/http_msg_head_shared.h" #include "service_inspectors/http_inspect/http_field.h" #include "service_inspectors/http_inspect/http_str_to_code.h" diff --git a/src/service_inspectors/http_inspect/test/http_normalizers_test.cc b/src/service_inspectors/http_inspect/test/http_normalizers_test.cc index 11783b902..a346a9466 100644 --- a/src/service_inspectors/http_inspect/test/http_normalizers_test.cc +++ b/src/service_inspectors/http_inspect/test/http_normalizers_test.cc @@ -19,6 +19,10 @@ // http_normalizers_test.cc author Tom Peters // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_inspectors/http_inspect/http_msg_header.h" #include "service_inspectors/http_inspect/http_test_manager.h" diff --git a/src/service_inspectors/http_inspect/test/http_transaction_test.cc b/src/service_inspectors/http_inspect/test/http_transaction_test.cc index 50af330a3..92c5bb0a3 100644 --- a/src/service_inspectors/http_inspect/test/http_transaction_test.cc +++ b/src/service_inspectors/http_inspect/test/http_transaction_test.cc @@ -19,6 +19,10 @@ // http_transaction_test.cc author Tom Peters // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "service_inspectors/http_inspect/http_transaction.h" #include "service_inspectors/http_inspect/http_module.h" #include "service_inspectors/http_inspect/http_flow_data.h" diff --git a/src/service_inspectors/http_inspect/test/http_uri_norm_test.cc b/src/service_inspectors/http_inspect/test/http_uri_norm_test.cc index 29f247b28..2a7ebf985 100644 --- a/src/service_inspectors/http_inspect/test/http_uri_norm_test.cc +++ b/src/service_inspectors/http_inspect/test/http_uri_norm_test.cc @@ -19,6 +19,10 @@ // http_uri_norm_test.cc author Tom Peters // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "log/messages.h" #include "service_inspectors/http_inspect/http_uri_norm.h" #include "service_inspectors/http_inspect/http_js_norm.h" diff --git a/src/service_inspectors/imap/imap.cc b/src/service_inspectors/imap/imap.cc index a9957f8b7..8a107624f 100644 --- a/src/service_inspectors/imap/imap.cc +++ b/src/service_inspectors/imap/imap.cc @@ -18,35 +18,24 @@ // imap.cc author Bhagyashree Bantwal -#include "imap.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "imap.h" #include "events/event_queue.h" #include "log/messages.h" -#include "main/snort_types.h" #include "main/snort_debug.h" #include "profiler/profiler.h" -#include "file_api/file_api.h" -#include "parser/parser.h" -#include "framework/inspector.h" -#include "target_based/snort_protocols.h" -#include "search_engines/search_tool.h" -#include "utils/sfsnprintfappend.h" -#include "utils/util.h" +#include "protocols/packet.h" #include "protocols/ssl.h" -#include "mime/file_mime_process.h" +#include "search_engines/search_tool.h" #include "stream/stream.h" +#include "utils/util.h" -#include "imap_paf.h" #include "imap_module.h" +#include "imap_paf.h" THREAD_LOCAL ProfileStats imapPerfStats; THREAD_LOCAL ImapStats imapstats; diff --git a/src/service_inspectors/imap/imap.h b/src/service_inspectors/imap/imap.h index 0fddd3bea..78514fb61 100644 --- a/src/service_inspectors/imap/imap.h +++ b/src/service_inspectors/imap/imap.h @@ -24,9 +24,8 @@ // Implementation header with definitions, datatypes and flowdata class for // IMAP service inspector. -#include "protocols/packet.h" -#include "stream/stream.h" -#include "imap_config.h" +#include "flow/flow.h" +#include "mime/file_mime_process.h" // Direction packet is coming from, if we can figure it out #define IMAP_PKT_FROM_UNKNOWN 0 diff --git a/src/service_inspectors/imap/imap_module.cc b/src/service_inspectors/imap/imap_module.cc index 99188bf93..273ac6c20 100644 --- a/src/service_inspectors/imap/imap_module.cc +++ b/src/service_inspectors/imap/imap_module.cc @@ -18,13 +18,15 @@ // imap_module.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "imap_module.h" -#include -#include +#include #include "log/messages.h" -#include "main/snort_config.h" using namespace std; diff --git a/src/service_inspectors/imap/imap_module.h b/src/service_inspectors/imap/imap_module.h index 34295eed2..cc4d607b8 100644 --- a/src/service_inspectors/imap/imap_module.h +++ b/src/service_inspectors/imap/imap_module.h @@ -24,8 +24,6 @@ // Interface to the IMAP service inspector #include "framework/module.h" -#include "framework/bits.h" -#include "main/thread.h" #include "imap_config.h" #define GID_IMAP 141 diff --git a/src/service_inspectors/imap/imap_paf.cc b/src/service_inspectors/imap/imap_paf.cc index 69cfa7679..a424573e9 100644 --- a/src/service_inspectors/imap/imap_paf.cc +++ b/src/service_inspectors/imap/imap_paf.cc @@ -16,12 +16,16 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "imap_paf.h" -#include "main/snort_types.h" #include "main/snort_debug.h" +#include "protocols/packet.h" +#include "stream/stream.h" -#include "imap_paf.h" #include "imap.h" extern IMAPToken imap_resps[]; diff --git a/src/service_inspectors/imap/imap_paf.h b/src/service_inspectors/imap/imap_paf.h index 6f34e73bd..f61593647 100644 --- a/src/service_inspectors/imap/imap_paf.h +++ b/src/service_inspectors/imap/imap_paf.h @@ -24,9 +24,8 @@ // Protocol aware flushing for IMAP -#include "main/snort_types.h" -#include "stream/stream_splitter.h" #include "mime/file_mime_paf.h" +#include "stream/stream_splitter.h" struct ImapDataInfo { diff --git a/src/service_inspectors/modbus/ips_modbus_data.cc b/src/service_inspectors/modbus/ips_modbus_data.cc index b398aac35..f49d0cf0c 100644 --- a/src/service_inspectors/modbus/ips_modbus_data.cc +++ b/src/service_inspectors/modbus/ips_modbus_data.cc @@ -19,17 +19,18 @@ // ips_modbus_data.cc author Russ Combs -#include "main/snort_types.h" -#include "main/snort_debug.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detection/detection_defines.h" #include "framework/cursor.h" #include "framework/ips_option.h" #include "framework/module.h" #include "hash/sfhashfcn.h" -#include "protocols/packet.h" #include "profiler/profiler.h" +#include "protocols/packet.h" -#include "modbus.h" #include "modbus_decode.h" static const char* s_name = "modbus_data"; diff --git a/src/service_inspectors/modbus/ips_modbus_func.cc b/src/service_inspectors/modbus/ips_modbus_func.cc index 0d9c92724..20d5e7833 100644 --- a/src/service_inspectors/modbus/ips_modbus_func.cc +++ b/src/service_inspectors/modbus/ips_modbus_func.cc @@ -19,8 +19,10 @@ // ips_modbus_func.cc author Russ Combs -#include "main/snort_types.h" -#include "main/snort_debug.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" diff --git a/src/service_inspectors/modbus/ips_modbus_unit.cc b/src/service_inspectors/modbus/ips_modbus_unit.cc index a521015a3..271283951 100644 --- a/src/service_inspectors/modbus/ips_modbus_unit.cc +++ b/src/service_inspectors/modbus/ips_modbus_unit.cc @@ -19,8 +19,10 @@ // ips_modbus_unit.cc author Russ Combs -#include "main/snort_types.h" -#include "main/snort_debug.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" diff --git a/src/service_inspectors/modbus/modbus.cc b/src/service_inspectors/modbus/modbus.cc index 8e745deec..e431c7053 100644 --- a/src/service_inspectors/modbus/modbus.cc +++ b/src/service_inspectors/modbus/modbus.cc @@ -18,15 +18,15 @@ // modbus.cc author Russ Combs -#include "modbus.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "modbus.h" + #include "events/event_queue.h" -#include "managers/inspector_manager.h" #include "profiler/profiler.h" +#include "protocols/packet.h" #include "modbus_decode.h" #include "modbus_module.h" diff --git a/src/service_inspectors/modbus/modbus.h b/src/service_inspectors/modbus/modbus.h index 7c6372660..56abe798d 100644 --- a/src/service_inspectors/modbus/modbus.h +++ b/src/service_inspectors/modbus/modbus.h @@ -24,7 +24,6 @@ #include "flow/flow.h" #include "framework/counts.h" -#include "main/thread.h" struct ModbusStats { diff --git a/src/service_inspectors/modbus/modbus_decode.cc b/src/service_inspectors/modbus/modbus_decode.cc index 444d58ad9..9b5e45866 100644 --- a/src/service_inspectors/modbus/modbus_decode.cc +++ b/src/service_inspectors/modbus/modbus_decode.cc @@ -19,12 +19,17 @@ // modbus_decode.cc author Ryan Jordan +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "modbus_decode.h" +#include "events/event_queue.h" +#include "protocols/packet.h" + #include "modbus.h" #include "modbus_module.h" -#include "protocols/packet.h" -#include "events/event_queue.h" // FIXIT-L convert this stuff to a table and make configurable diff --git a/src/service_inspectors/modbus/modbus_module.cc b/src/service_inspectors/modbus/modbus_module.cc index 3bac15999..df5ac0ea3 100644 --- a/src/service_inspectors/modbus/modbus_module.cc +++ b/src/service_inspectors/modbus/modbus_module.cc @@ -18,11 +18,16 @@ // modbus_module.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "modbus_module.h" -#include "modbus.h" #include "profiler/profiler.h" +#include "modbus.h" + THREAD_LOCAL ProfileStats modbus_prof; //------------------------------------------------------------------------- diff --git a/src/service_inspectors/modbus/modbus_module.h b/src/service_inspectors/modbus/modbus_module.h index 1d74a5052..51c4fa194 100644 --- a/src/service_inspectors/modbus/modbus_module.h +++ b/src/service_inspectors/modbus/modbus_module.h @@ -22,7 +22,6 @@ #define MODUBS_MODULE_H #include "framework/module.h" -#include "main/thread.h" #define GID_MODBUS 144 diff --git a/src/service_inspectors/modbus/modbus_paf.cc b/src/service_inspectors/modbus/modbus_paf.cc index b2c9779b3..d91da7601 100644 --- a/src/service_inspectors/modbus/modbus_paf.cc +++ b/src/service_inspectors/modbus/modbus_paf.cc @@ -20,12 +20,17 @@ // modbus_paf.cc author Ryan Jordan // Protocol-Aware Flushing (PAF) code for the Modbus preprocessor. +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "modbus_paf.h" -#include "modbus_decode.h" -#include "modbus_module.h" #include "events/event_queue.h" +#include "modbus.h" +#include "modbus_module.h" + #define MODBUS_MIN_HDR_LEN 2 // Enough for Unit ID + Function #define MODBUS_MAX_HDR_LEN 254 // Max PDU size is 260, 6 bytes already seen diff --git a/src/service_inspectors/modbus/modbus_paf.h b/src/service_inspectors/modbus/modbus_paf.h index 7fa98c94e..3d720a2ad 100644 --- a/src/service_inspectors/modbus/modbus_paf.h +++ b/src/service_inspectors/modbus/modbus_paf.h @@ -24,8 +24,6 @@ // Protocol-Aware Flushing (PAF) code for the Modbus preprocessor. -#include "modbus.h" -#include "protocols/packet.h" #include "stream/stream_splitter.h" enum modbus_paf_state_t diff --git a/src/service_inspectors/pop/pop.cc b/src/service_inspectors/pop/pop.cc index 231a88485..5750e7f5e 100644 --- a/src/service_inspectors/pop/pop.cc +++ b/src/service_inspectors/pop/pop.cc @@ -18,31 +18,21 @@ // pop.cc author Bhagyashree Bantwal < bbantwal@cisco.com> -#include "pop.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "pop.h" #include "events/event_queue.h" #include "log/messages.h" -#include "main/snort_types.h" #include "main/snort_debug.h" #include "profiler/profiler.h" -#include "parser/parser.h" -#include "framework/inspector.h" -#include "target_based/snort_protocols.h" +#include "protocols/packet.h" +#include "protocols/ssl.h" #include "search_engines/search_tool.h" -#include "utils/sfsnprintfappend.h" +#include "stream/stream.h" #include "utils/util.h" -#include "protocols/ssl.h" -#include "file_api/file_api.h" -#include "mime/file_mime_process.h" #include "pop_module.h" #include "pop_paf.h" diff --git a/src/service_inspectors/pop/pop.h b/src/service_inspectors/pop/pop.h index ee91f18fa..fb12c28dc 100644 --- a/src/service_inspectors/pop/pop.h +++ b/src/service_inspectors/pop/pop.h @@ -24,9 +24,8 @@ // Implementation header with definitions, datatypes and flowdata class for // POP service inspector. -#include "protocols/packet.h" -#include "stream/stream.h" -#include "pop_config.h" +#include "flow/flow.h" +#include "mime/file_mime_process.h" // Direction packet is coming from, if we can figure it out #define POP_PKT_FROM_UNKNOWN 0 diff --git a/src/service_inspectors/pop/pop_module.cc b/src/service_inspectors/pop/pop_module.cc index ee1d039f7..8c5148a32 100644 --- a/src/service_inspectors/pop/pop_module.cc +++ b/src/service_inspectors/pop/pop_module.cc @@ -18,13 +18,15 @@ // pop_module.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "pop_module.h" -#include -#include +#include #include "log/messages.h" -#include "main/snort_config.h" using namespace std; diff --git a/src/service_inspectors/pop/pop_module.h b/src/service_inspectors/pop/pop_module.h index 676daae6f..324ede424 100644 --- a/src/service_inspectors/pop/pop_module.h +++ b/src/service_inspectors/pop/pop_module.h @@ -21,11 +21,10 @@ #ifndef POP_MODULE_H #define POP_MODULE_H +// Interface to the IMAP service inspector + #include "framework/module.h" -#include "framework/bits.h" -#include "main/thread.h" #include "pop_config.h" -// Interface to the IMAP service inspector #define GID_POP 142 diff --git a/src/service_inspectors/pop/pop_paf.cc b/src/service_inspectors/pop/pop_paf.cc index 650f35e3b..c3562b3e1 100644 --- a/src/service_inspectors/pop/pop_paf.cc +++ b/src/service_inspectors/pop/pop_paf.cc @@ -16,12 +16,15 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "pop_paf.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "pop_paf.h" -#include "main/snort_types.h" #include "main/snort_debug.h" +#include "protocols/packet.h" +#include "stream/stream.h" #include "pop.h" diff --git a/src/service_inspectors/pop/pop_paf.h b/src/service_inspectors/pop/pop_paf.h index b611e6d24..5c8715dab 100644 --- a/src/service_inspectors/pop/pop_paf.h +++ b/src/service_inspectors/pop/pop_paf.h @@ -24,9 +24,8 @@ // Protocol aware flushing for POP. -#include "main/snort_types.h" -#include "stream/stream_splitter.h" #include "mime/file_mime_paf.h" +#include "stream/stream_splitter.h" // Structure used to record expected server termination sequence enum PopExpectedResp diff --git a/src/service_inspectors/rpc_decode/rpc_decode.cc b/src/service_inspectors/rpc_decode/rpc_decode.cc index bb65d15c4..9b998059f 100644 --- a/src/service_inspectors/rpc_decode/rpc_decode.cc +++ b/src/service_inspectors/rpc_decode/rpc_decode.cc @@ -38,27 +38,15 @@ #include "config.h" #endif -#include -#include -#include -#include - -#include "parser/parser.h" +#include "detection/detection_util.h" +#include "framework/data_bus.h" #include "log/messages.h" -#include "main/snort_debug.h" -#include "detection/detect.h" -#include "log/log.h" #include "profiler/profiler.h" -#include "utils/util.h" -#include "detection/detection_util.h" -#include "stream/stream_splitter.h" -#include "target_based/snort_protocols.h" -#include "protocols/tcp.h" #include "protocols/packet.h" -#include "framework/data_bus.h" -#include "framework/inspector.h" #include "stream/stream.h" +#include "stream/stream_splitter.h" #include "utils/safec.h" +#include "utils/util.h" #include "rpc_module.h" diff --git a/src/service_inspectors/rpc_decode/rpc_module.cc b/src/service_inspectors/rpc_decode/rpc_module.cc index 6d3dcdb30..48fb99a3b 100644 --- a/src/service_inspectors/rpc_decode/rpc_module.cc +++ b/src/service_inspectors/rpc_decode/rpc_module.cc @@ -18,8 +18,11 @@ // rpc_module.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "rpc_module.h" -#include #define RPC_FRAG_TRAFFIC_STR \ "fragmented RPC records" diff --git a/src/service_inspectors/rpc_decode/rpc_module.h b/src/service_inspectors/rpc_decode/rpc_module.h index 8dd1f32fd..18533986f 100644 --- a/src/service_inspectors/rpc_decode/rpc_module.h +++ b/src/service_inspectors/rpc_decode/rpc_module.h @@ -23,8 +23,6 @@ // Interface to the RPC decode service inspector #include "framework/module.h" -#include "framework/bits.h" -#include "main/thread.h" #define GID_RPC_DECODE 106 diff --git a/src/service_inspectors/service_inspectors.cc b/src/service_inspectors/service_inspectors.cc index 7a377818d..edcfa3952 100644 --- a/src/service_inspectors/service_inspectors.cc +++ b/src/service_inspectors/service_inspectors.cc @@ -17,13 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "service_inspectors.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "framework/inspector.h" +#include "service_inspectors.h" + #include "managers/plugin_manager.h" extern const BaseApi* sin_imap; diff --git a/src/service_inspectors/sip/ips_sip.cc b/src/service_inspectors/sip/ips_sip.cc index 541c94962..b084efe1f 100644 --- a/src/service_inspectors/sip/ips_sip.cc +++ b/src/service_inspectors/sip/ips_sip.cc @@ -27,16 +27,12 @@ #include -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" -#include "profiler/profiler.h" -#include "flow/flow.h" #include "detection/detection_defines.h" -#include "framework/ips_option.h" #include "framework/cursor.h" -#include "framework/inspector.h" +#include "framework/ips_option.h" #include "framework/module.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" #include "sip.h" diff --git a/src/service_inspectors/sip/ips_sip_method.cc b/src/service_inspectors/sip/ips_sip_method.cc index 05a7d8547..9df0bc99c 100644 --- a/src/service_inspectors/sip/ips_sip_method.cc +++ b/src/service_inspectors/sip/ips_sip_method.cc @@ -26,15 +26,15 @@ #include "config.h" #endif -#include "sip.h" +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" -#include "detection/detect.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" #include "log/messages.h" #include "profiler/profiler.h" +#include "protocols/packet.h" + +#include "sip.h" //------------------------------------------------------------------------- // sip_method diff --git a/src/service_inspectors/sip/ips_sip_stat_code.cc b/src/service_inspectors/sip/ips_sip_stat_code.cc index e370c192d..4591e4c3b 100644 --- a/src/service_inspectors/sip/ips_sip_stat_code.cc +++ b/src/service_inspectors/sip/ips_sip_stat_code.cc @@ -26,16 +26,15 @@ #include "config.h" #endif -#include "sip.h" - -#include "detection/detect.h" #include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" #include "hash/sfhashfcn.h" #include "log/messages.h" #include "profiler/profiler.h" +#include "protocols/packet.h" + +#include "sip.h" //------------------------------------------------------------------------- // sip_stat_code diff --git a/src/service_inspectors/sip/sip.cc b/src/service_inspectors/sip/sip.cc index 87e641493..7743d1721 100644 --- a/src/service_inspectors/sip/sip.cc +++ b/src/service_inspectors/sip/sip.cc @@ -17,31 +17,20 @@ //-------------------------------------------------------------------------- // sip.cc author Hui Cao -#include "sip.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "sip.h" +#include "events/event_queue.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "main/snort_config.h" -#include "profiler/profiler.h" -#include "file_api/file_api.h" -#include "parser/parser.h" -#include "framework/inspector.h" -#include "utils/sfsnprintfappend.h" -#include "target_based/snort_protocols.h" #include "managers/inspector_manager.h" +#include "profiler/profiler.h" +#include "protocols/packet.h" -#include "sip_utils.h" #include "sip_module.h" +#include "sip_utils.h" THREAD_LOCAL ProfileStats sipPerfStats; diff --git a/src/service_inspectors/sip/sip.h b/src/service_inspectors/sip/sip.h index 91374e3a5..6828b909a 100644 --- a/src/service_inspectors/sip/sip.h +++ b/src/service_inspectors/sip/sip.h @@ -21,8 +21,7 @@ #define SIP_H // Implementation header with definitions, datatypes and flowdata class for SIP service inspector. -#include "protocols/packet.h" -#include "sip_config.h" +#include "flow/flow.h" #include "sip_dialog.h" #include "sip_parser.h" #include "sip_roptions.h" diff --git a/src/service_inspectors/sip/sip_common.h b/src/service_inspectors/sip/sip_common.h index 34d4ce4cd..1515cdeff 100644 --- a/src/service_inspectors/sip/sip_common.h +++ b/src/service_inspectors/sip/sip_common.h @@ -22,7 +22,7 @@ #ifndef SIP_COMMON_H #define SIP_COMMON_H -#include "framework/data_bus.h" +#include "sfip/sf_ip.h" // Header containing datatypes/definitions shared by SSL inspector files. diff --git a/src/service_inspectors/sip/sip_config.cc b/src/service_inspectors/sip/sip_config.cc index f42be8e3d..60f249425 100644 --- a/src/service_inspectors/sip/sip_config.cc +++ b/src/service_inspectors/sip/sip_config.cc @@ -19,11 +19,14 @@ // sip_config.cc author Hui Cao +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sip_config.h" #include "log/messages.h" #include "main/snort_debug.h" -#include "parser/parser.h" #include "utils/util.h" #define SIP_SEPERATORS "()<>@,;:\\/[]?={}\" " diff --git a/src/service_inspectors/sip/sip_config.h b/src/service_inspectors/sip/sip_config.h index 52f45da5c..b6bafddc5 100644 --- a/src/service_inspectors/sip/sip_config.h +++ b/src/service_inspectors/sip/sip_config.h @@ -24,7 +24,6 @@ // Configuration for SIP service inspector -#include "protocols/packet.h" #include "framework/counts.h" #include "main/thread.h" #include "sip_common.h" diff --git a/src/service_inspectors/sip/sip_dialog.cc b/src/service_inspectors/sip/sip_dialog.cc index 7e4a7079b..a8232f9e2 100644 --- a/src/service_inspectors/sip/sip_dialog.cc +++ b/src/service_inspectors/sip/sip_dialog.cc @@ -19,26 +19,23 @@ // sip_dialog.cc author Hui Cao -#include "sip_dialog.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "sip_dialog.h" +#include "events/event_queue.h" #include "framework/data_bus.h" -#include "main/snort_config.h" #include "main/snort_debug.h" -#include "main/snort_types.h" -#include "pub_sub/sip_events.h" +#include "protocols/packet.h" #include "protocols/vlan.h" -#include "sfip/sf_ip.h" +#include "pub_sub/sip_events.h" #include "stream/stream.h" #include "utils/util.h" -#include "sip_module.h" #include "sip.h" +#include "sip_module.h" static void SIP_updateMedias(SIP_MediaSession*, SIP_MediaList*); static int SIP_compareMedias(SIP_MediaDataList, SIP_MediaDataList); diff --git a/src/service_inspectors/sip/sip_dialog.h b/src/service_inspectors/sip/sip_dialog.h index cf1e76b0d..4db1e610b 100644 --- a/src/service_inspectors/sip/sip_dialog.h +++ b/src/service_inspectors/sip/sip_dialog.h @@ -24,9 +24,10 @@ // Dialog management for SIP call flow analysis -#include "sip_config.h" #include "sip_parser.h" +struct Packet; + #define TOTAL_RESPONSES 0 #define RESPONSE1XX 1 #define RESPONSE2XX 2 diff --git a/src/service_inspectors/sip/sip_module.cc b/src/service_inspectors/sip/sip_module.cc index 7cb313ddd..086f5206f 100644 --- a/src/service_inspectors/sip/sip_module.cc +++ b/src/service_inspectors/sip/sip_module.cc @@ -18,12 +18,13 @@ // sip_module.cc author Bhagyashree Bantwal -#include "sip_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "sip_module.h" -#include "utils/util.h" +#include using namespace std; diff --git a/src/service_inspectors/sip/sip_module.h b/src/service_inspectors/sip/sip_module.h index 415aa1b6f..dde696611 100644 --- a/src/service_inspectors/sip/sip_module.h +++ b/src/service_inspectors/sip/sip_module.h @@ -24,8 +24,6 @@ // Interface to the SIP service inspector #include "framework/module.h" -#include "framework/bits.h" -#include "main/thread.h" #include "sip_config.h" #define GID_SIP 140 diff --git a/src/service_inspectors/sip/sip_parser.cc b/src/service_inspectors/sip/sip_parser.cc index b4575f0ff..cc1551844 100644 --- a/src/service_inspectors/sip/sip_parser.cc +++ b/src/service_inspectors/sip/sip_parser.cc @@ -23,18 +23,14 @@ #include "config.h" #endif -#include +#include "sip_parser.h" -#include "main/snort_types.h" +#include "events/event_queue.h" #include "main/snort_debug.h" -#include "main/snort_config.h" -#include "sfip/sf_ip.h" #include "utils/util.h" -#include "sip_parser.h" -#include "sip_config.h" -#include "sip_utils.h" #include "sip_module.h" +#include "sip_utils.h" #define MAX_NUM_32BIT 2147483647 diff --git a/src/service_inspectors/sip/sip_utils.cc b/src/service_inspectors/sip/sip_utils.cc index a96d469ad..04472a290 100644 --- a/src/service_inspectors/sip/sip_utils.cc +++ b/src/service_inspectors/sip/sip_utils.cc @@ -19,13 +19,15 @@ // sip_utils.cc author: Hui Cao -#include "sip_utils.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include "main/snort_types.h" + +#include "sip_utils.h" + +#include + +#include "hash/sfhashfcn.h" /******************************************************************** * Function: SIP_IsEmptyStr() diff --git a/src/service_inspectors/sip/sip_utils.h b/src/service_inspectors/sip/sip_utils.h index 3bec3b8dc..a9ce03acf 100644 --- a/src/service_inspectors/sip/sip_utils.h +++ b/src/service_inspectors/sip/sip_utils.h @@ -24,7 +24,6 @@ // Utility functions for SIP inspector -#include "hash/sfhashfcn.h" #include "sip_config.h" int SIP_IsEmptyStr(char*); diff --git a/src/service_inspectors/smtp/smtp.cc b/src/service_inspectors/smtp/smtp.cc index 452349137..1e5b09834 100644 --- a/src/service_inspectors/smtp/smtp.cc +++ b/src/service_inspectors/smtp/smtp.cc @@ -16,36 +16,28 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "smtp.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "smtp.h" +#include "detection/detection_util.h" #include "log/messages.h" -#include "main/snort_types.h" +#include "log/unified2.h" #include "main/snort_debug.h" #include "profiler/profiler.h" -#include "file_api/file_api.h" -#include "mime/file_mime_process.h" -#include "parser/parser.h" -#include "framework/inspector.h" -#include "utils/sfsnprintfappend.h" -#include "target_based/snort_protocols.h" +#include "protocols/packet.h" #include "protocols/ssl.h" -#include "log/unified2.h" -#include "detection/detection_util.h" +#include "stream/stream.h" #include "utils/safec.h" +#include "utils/sfsnprintfappend.h" #include "utils/util.h" #include "smtp_module.h" +#include "smtp_normalize.h" #include "smtp_paf.h" #include "smtp_util.h" -#include "smtp_normalize.h" #include "smtp_xlink2state.h" THREAD_LOCAL ProfileStats smtpPerfStats; diff --git a/src/service_inspectors/smtp/smtp.h b/src/service_inspectors/smtp/smtp.h index 5cb6c0cf1..f7863a18e 100644 --- a/src/service_inspectors/smtp/smtp.h +++ b/src/service_inspectors/smtp/smtp.h @@ -24,9 +24,7 @@ // Implementation header with definitions, datatypes and flowdata class for // SMTP service inspector. -#include "main/thread.h" -#include "protocols/packet.h" -#include "stream/stream.h" +#include "flow/flow.h" #include "smtp_config.h" // Direction packet is coming from, if we can figure it out diff --git a/src/service_inspectors/smtp/smtp_config.h b/src/service_inspectors/smtp/smtp_config.h index 4596e18d9..5589b5145 100644 --- a/src/service_inspectors/smtp/smtp_config.h +++ b/src/service_inspectors/smtp/smtp_config.h @@ -20,6 +20,7 @@ #define SMTP_CONFIG_H // Configuration for SMTP inspector + #include "mime/file_mime_process.h" #include "search_engines/search_tool.h" diff --git a/src/service_inspectors/smtp/smtp_module.cc b/src/service_inspectors/smtp/smtp_module.cc index e1e2edf10..c15833e2e 100644 --- a/src/service_inspectors/smtp/smtp_module.cc +++ b/src/service_inspectors/smtp/smtp_module.cc @@ -18,13 +18,13 @@ // smtp_module.cc author Bhagyashree Bantwal -#include "smtp_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "smtp_module.h" #include "log/messages.h" -#include "main/snort_config.h" #include "utils/util.h" using namespace std; diff --git a/src/service_inspectors/smtp/smtp_module.h b/src/service_inspectors/smtp/smtp_module.h index ebe998cb0..6712e1e6b 100644 --- a/src/service_inspectors/smtp/smtp_module.h +++ b/src/service_inspectors/smtp/smtp_module.h @@ -24,8 +24,6 @@ // Interface to the SMTP service inspector #include "framework/module.h" -#include "framework/bits.h" -#include "main/thread.h" #include "smtp_config.h" #define GID_SMTP 124 diff --git a/src/service_inspectors/smtp/smtp_normalize.cc b/src/service_inspectors/smtp/smtp_normalize.cc index c71907d52..11779ed31 100644 --- a/src/service_inspectors/smtp/smtp_normalize.cc +++ b/src/service_inspectors/smtp/smtp_normalize.cc @@ -30,13 +30,14 @@ * */ -#include "smtp_normalize.h" -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "smtp_normalize.h" + +#include "protocols/packet.h" + #include "smtp.h" #include "smtp_util.h" diff --git a/src/service_inspectors/smtp/smtp_normalize.h b/src/service_inspectors/smtp/smtp_normalize.h index 1e49150a3..9502a1f35 100644 --- a/src/service_inspectors/smtp/smtp_normalize.h +++ b/src/service_inspectors/smtp/smtp_normalize.h @@ -22,7 +22,9 @@ // Implementation of normalizing SMTP traffic into the alternate buffer -#include "protocols/packet.h" +#include + +struct Packet; int SMTP_NormalizeCmd(Packet*, const uint8_t*, const uint8_t*, const uint8_t*); diff --git a/src/service_inspectors/smtp/smtp_paf.cc b/src/service_inspectors/smtp/smtp_paf.cc index 49a0464c0..1f99b1fa5 100644 --- a/src/service_inspectors/smtp/smtp_paf.cc +++ b/src/service_inspectors/smtp/smtp_paf.cc @@ -16,15 +16,17 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "smtp_paf.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "smtp_paf.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" #include "events/event_queue.h" +#include "main/snort_debug.h" +#include "protocols/packet.h" +#include "stream/stream.h" -#include "smtp.h" #include "smtp_module.h" /* State tracker for MIME PAF */ diff --git a/src/service_inspectors/smtp/smtp_paf.h b/src/service_inspectors/smtp/smtp_paf.h index 53aad5abd..2c86bc085 100644 --- a/src/service_inspectors/smtp/smtp_paf.h +++ b/src/service_inspectors/smtp/smtp_paf.h @@ -23,9 +23,8 @@ // Protocol aware flushing for SMTP -#include "main/snort_types.h" -#include "stream/stream_splitter.h" #include "mime/file_mime_paf.h" +#include "stream/stream_splitter.h" // State tracker for SMTP PAF enum SmtpPafState diff --git a/src/service_inspectors/smtp/smtp_util.cc b/src/service_inspectors/smtp/smtp_util.cc index 9bb4536c7..835883e41 100644 --- a/src/service_inspectors/smtp/smtp_util.cc +++ b/src/service_inspectors/smtp/smtp_util.cc @@ -19,21 +19,19 @@ // smtp_util.cc author Andy Mullican // This file contains SMTP helper functions. -#include "smtp_util.h" - -#include -#include -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "smtp.h" -#include "smtp_config.h" +#include "smtp_util.h" + #include "detection/detection_util.h" +#include "protocols/packet.h" +#include "stream/stream.h" #include "utils/safec.h" +#include "smtp.h" + static THREAD_LOCAL DataBuffer DecodeBuf; void SMTP_GetEOL(const uint8_t* ptr, const uint8_t* end, diff --git a/src/service_inspectors/smtp/smtp_util.h b/src/service_inspectors/smtp/smtp_util.h index 13c905a58..051536b0a 100644 --- a/src/service_inspectors/smtp/smtp_util.h +++ b/src/service_inspectors/smtp/smtp_util.h @@ -22,14 +22,11 @@ #ifndef SMTP_UTIL_H #define SMTP_UTIL_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - // SMTP helper functions #include "smtp_config.h" -#include "protocols/packet.h" + +struct Packet; void SMTP_GetEOL(const uint8_t*, const uint8_t*, const uint8_t**, const uint8_t**); void SMTP_LogFuncs(SMTP_PROTO_CONF* config, Packet* p, MimeSession* mime_ssn); diff --git a/src/service_inspectors/smtp/smtp_xlink2state.cc b/src/service_inspectors/smtp/smtp_xlink2state.cc index dc3d2f6ee..3269f99c5 100644 --- a/src/service_inspectors/smtp/smtp_xlink2state.cc +++ b/src/service_inspectors/smtp/smtp_xlink2state.cc @@ -20,21 +20,17 @@ // smtp_xlink2state.c author Andy Mullican // This file handles the X-Link2State vulnerability. -#include "smtp_xlink2state.h" - -#include -#include -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "smtp_util.h" -#include "smtp_module.h" +#include "smtp_xlink2state.h" +#include "events/event_queue.h" #include "packet_io/active.h" +#include "smtp_module.h" + #define XLINK_OTHER 1 #define XLINK_FIRST 2 #define XLINK_CHUNK 3 diff --git a/src/service_inspectors/smtp/smtp_xlink2state.h b/src/service_inspectors/smtp/smtp_xlink2state.h index ccde32c8a..b420dee34 100644 --- a/src/service_inspectors/smtp/smtp_xlink2state.h +++ b/src/service_inspectors/smtp/smtp_xlink2state.h @@ -24,9 +24,7 @@ // declares the API to handle the X-Link2State vulnerability -#include "protocols/packet.h" #include "smtp.h" -#include "smtp_config.h" int ParseXLink2State(SMTP_PROTO_CONF*, Packet*, SMTPData*, const uint8_t*); diff --git a/src/service_inspectors/ssh/ssh.cc b/src/service_inspectors/ssh/ssh.cc index d6eacd297..cb11d2855 100644 --- a/src/service_inspectors/ssh/ssh.cc +++ b/src/service_inspectors/ssh/ssh.cc @@ -23,27 +23,17 @@ * Contributors: Adam Keeton, Ryan Jordan */ -#include "ssh.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "ssh.h" #include "events/event_queue.h" -#include "file_api/file_api.h" -#include "framework/inspector.h" #include "log/messages.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "parser/parser.h" #include "profiler/profiler.h" -#include "utils/sfsnprintfappend.h" -#include "target_based/snort_protocols.h" +#include "protocols/packet.h" +#include "stream/stream.h" #include "ssh_module.h" diff --git a/src/service_inspectors/ssh/ssh.h b/src/service_inspectors/ssh/ssh.h index c6e41433a..b4065a2c4 100644 --- a/src/service_inspectors/ssh/ssh.h +++ b/src/service_inspectors/ssh/ssh.h @@ -30,9 +30,7 @@ // client or server traffic appears to flow the wrong direction, or if // packets appear malformed/spoofed. -#include "protocols/packet.h" -#include "stream/stream.h" -#include "ssh_config.h" +#include "flow/flow.h" // Per-session data block containing current state // of the SSH preprocessor for the session. diff --git a/src/service_inspectors/ssh/ssh_module.cc b/src/service_inspectors/ssh/ssh_module.cc index d73746eb5..74fa54ab3 100644 --- a/src/service_inspectors/ssh/ssh_module.cc +++ b/src/service_inspectors/ssh/ssh_module.cc @@ -18,9 +18,13 @@ // ssh_module.cc author Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ssh_module.h" -#include -#include + +#include using namespace std; diff --git a/src/service_inspectors/ssh/ssh_module.h b/src/service_inspectors/ssh/ssh_module.h index a7b7394da..d16fc049a 100644 --- a/src/service_inspectors/ssh/ssh_module.h +++ b/src/service_inspectors/ssh/ssh_module.h @@ -24,8 +24,6 @@ // Interface to the SSH service inspector #include "framework/module.h" -#include "framework/bits.h" -#include "main/thread.h" #include "ssh_config.h" #define GID_SSH 128 diff --git a/src/service_inspectors/ssl/ips_ssl_state.cc b/src/service_inspectors/ssl/ips_ssl_state.cc index 3a788ea34..08a547b4d 100644 --- a/src/service_inspectors/ssl/ips_ssl_state.cc +++ b/src/service_inspectors/ssl/ips_ssl_state.cc @@ -21,14 +21,13 @@ #include "config.h" #endif -#include "protocols/ssl.h" +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" -#include "detection/detect.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" #include "profiler/profiler.h" +#include "protocols/packet.h" +#include "protocols/ssl.h" #include "ssl_inspector.h" diff --git a/src/service_inspectors/ssl/ips_ssl_version.cc b/src/service_inspectors/ssl/ips_ssl_version.cc index 00340c178..25915d5e0 100644 --- a/src/service_inspectors/ssl/ips_ssl_version.cc +++ b/src/service_inspectors/ssl/ips_ssl_version.cc @@ -21,14 +21,13 @@ #include "config.h" #endif -#include "protocols/ssl.h" +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" -#include "detection/detect.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" #include "profiler/profiler.h" +#include "protocols/packet.h" +#include "protocols/ssl.h" #include "ssl_inspector.h" diff --git a/src/service_inspectors/ssl/ssl_config.h b/src/service_inspectors/ssl/ssl_config.h index 7a795c844..c3ea51479 100644 --- a/src/service_inspectors/ssl/ssl_config.h +++ b/src/service_inspectors/ssl/ssl_config.h @@ -16,13 +16,13 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "framework/counts.h" - #ifndef SSL_CONFIG_H #define SSL_CONFIG_H // Configuration for SSL service inspector +#include "framework/counts.h" + struct SSL_PROTO_CONF { bool trustservers; diff --git a/src/service_inspectors/ssl/ssl_inspector.cc b/src/service_inspectors/ssl/ssl_inspector.cc index 17532d0dc..d72842401 100644 --- a/src/service_inspectors/ssl/ssl_inspector.cc +++ b/src/service_inspectors/ssl/ssl_inspector.cc @@ -17,32 +17,20 @@ //-------------------------------------------------------------------------- // -/* - * SSL inspector - * - */ - -#include "ssl_inspector.h" +// SSL inspector #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "ssl_inspector.h" +#include "detection/detect.h" #include "events/event_queue.h" #include "log/messages.h" -#include "main/snort_types.h" #include "main/snort_debug.h" #include "profiler/profiler.h" -#include "parser/parser.h" -#include "framework/inspector.h" -#include "utils/sfsnprintfappend.h" -#include "target_based/snort_protocols.h" -#include "detection/detect.h" +#include "protocols/packet.h" #include "protocols/ssl.h" #include "stream/stream.h" diff --git a/src/service_inspectors/ssl/ssl_inspector.h b/src/service_inspectors/ssl/ssl_inspector.h index eabbe4bb8..642b6afdd 100644 --- a/src/service_inspectors/ssl/ssl_inspector.h +++ b/src/service_inspectors/ssl/ssl_inspector.h @@ -21,8 +21,7 @@ // Implementation header with definitions, datatypes and flowdata class for SSL service inspector. -#include "protocols/packet.h" -#include "ssl_config.h" +#include "flow/flow.h" #define SSLPP_ENCRYPTED_FLAGS \ (SSL_HS_SDONE_FLAG | SSL_CLIENT_KEYX_FLAG | \ diff --git a/src/service_inspectors/ssl/ssl_module.cc b/src/service_inspectors/ssl/ssl_module.cc index af564e55f..b3b5bf3a9 100644 --- a/src/service_inspectors/ssl/ssl_module.cc +++ b/src/service_inspectors/ssl/ssl_module.cc @@ -18,13 +18,13 @@ // ssl_module.cc author Bhagyashree Bantwal -#include "ssl_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "ssl_module.h" -#include "parser/parser.h" -#include "ssl_inspector.h" +#include using namespace std; diff --git a/src/service_inspectors/ssl/ssl_module.h b/src/service_inspectors/ssl/ssl_module.h index a99991dc5..2506dc9bf 100644 --- a/src/service_inspectors/ssl/ssl_module.h +++ b/src/service_inspectors/ssl/ssl_module.h @@ -24,8 +24,6 @@ // Interface to the SSL service inspector #include "framework/module.h" -#include "framework/bits.h" -#include "main/thread.h" #include "ssl_config.h" #define GID_SSL 137 diff --git a/src/service_inspectors/wizard/curses.cc b/src/service_inspectors/wizard/curses.cc index 1ed924d24..df3afa95b 100644 --- a/src/service_inspectors/wizard/curses.cc +++ b/src/service_inspectors/wizard/curses.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // curses.cc author Maya Dagon +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "curses.h" using namespace std; diff --git a/src/service_inspectors/wizard/curses.h b/src/service_inspectors/wizard/curses.h index a7a6046df..c4ca51bfc 100644 --- a/src/service_inspectors/wizard/curses.h +++ b/src/service_inspectors/wizard/curses.h @@ -20,8 +20,7 @@ #ifndef CURSES_H #define CURSES_H -#include - +#include #include #include diff --git a/src/service_inspectors/wizard/hexes.cc b/src/service_inspectors/wizard/hexes.cc index 075b8697a..0ee1d6451 100644 --- a/src/service_inspectors/wizard/hexes.cc +++ b/src/service_inspectors/wizard/hexes.cc @@ -17,9 +17,11 @@ //-------------------------------------------------------------------------- // magic.cc author Russ Combs -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include #include "magic.h" diff --git a/src/service_inspectors/wizard/magic.cc b/src/service_inspectors/wizard/magic.cc index 18d1bab69..b8839d6ba 100644 --- a/src/service_inspectors/wizard/magic.cc +++ b/src/service_inspectors/wizard/magic.cc @@ -17,6 +17,10 @@ //-------------------------------------------------------------------------- // magic.cc author Russ Combs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "magic.h" MagicPage::MagicPage(const MagicBook& b) : book(b) diff --git a/src/service_inspectors/wizard/magic.h b/src/service_inspectors/wizard/magic.h index f4abdf65e..cd46e13ec 100644 --- a/src/service_inspectors/wizard/magic.h +++ b/src/service_inspectors/wizard/magic.h @@ -17,12 +17,12 @@ //-------------------------------------------------------------------------- // magic.h author Russ Combs -#include -#include - #ifndef MAGIC_H #define MAGIC_H +#include +#include + class MagicBook; struct MagicPage diff --git a/src/service_inspectors/wizard/spells.cc b/src/service_inspectors/wizard/spells.cc index 17a11c0b4..71db57a4d 100644 --- a/src/service_inspectors/wizard/spells.cc +++ b/src/service_inspectors/wizard/spells.cc @@ -17,8 +17,9 @@ //-------------------------------------------------------------------------- // spells.cc author Russ Combs -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "magic.h" diff --git a/src/service_inspectors/wizard/wiz_module.cc b/src/service_inspectors/wizard/wiz_module.cc index 7b2037a4d..00571ba47 100644 --- a/src/service_inspectors/wizard/wiz_module.cc +++ b/src/service_inspectors/wizard/wiz_module.cc @@ -18,12 +18,11 @@ // wiz_module.cc author Russ Combs -#include "wiz_module.h" - -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "wiz_module.h" #include "curses.h" #include "magic.h" diff --git a/src/service_inspectors/wizard/wiz_module.h b/src/service_inspectors/wizard/wiz_module.h index b2515249d..56973ecc1 100644 --- a/src/service_inspectors/wizard/wiz_module.h +++ b/src/service_inspectors/wizard/wiz_module.h @@ -23,11 +23,7 @@ // wizard management interface -#include -#include - #include "framework/module.h" -#include "main/thread.h" #define WIZ_NAME "wizard" #define WIZ_HELP "inspector that implements port-independent protocol identification" diff --git a/src/service_inspectors/wizard/wizard.cc b/src/service_inspectors/wizard/wizard.cc index 171db2e2a..26e80a757 100644 --- a/src/service_inspectors/wizard/wizard.cc +++ b/src/service_inspectors/wizard/wizard.cc @@ -17,17 +17,16 @@ //-------------------------------------------------------------------------- // wizard.cc author Russ Combs -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "host_tracker/host_cache.h" #include "flow/flow.h" -#include "framework/inspector.h" -#include "managers/inspector_manager.h" +#include "log/messages.h" +#include "profiler/profiler.h" #include "protocols/packet.h" #include "stream/stream_splitter.h" -#include "profiler/profiler.h" -#include "utils/stats.h" -#include "log/messages.h" -#include "host_tracker/host_cache.h" #include "curses.h" #include "magic.h" diff --git a/src/sfip/CMakeLists.txt b/src/sfip/CMakeLists.txt index 873435e41..eb57b2433 100644 --- a/src/sfip/CMakeLists.txt +++ b/src/sfip/CMakeLists.txt @@ -2,7 +2,6 @@ set(SFIP_INCLUDES sf_cidr.h sf_ip.h - sf_ipvar.h sf_returns.h ) @@ -16,6 +15,7 @@ add_library ( sfip STATIC sf_cidr.cc sf_ip.cc sf_ipvar.cc + sf_ipvar.h sf_vartable.cc sf_vartable.h ) diff --git a/src/sfip/Makefile.am b/src/sfip/Makefile.am index be0c98be5..517d1eecb 100644 --- a/src/sfip/Makefile.am +++ b/src/sfip/Makefile.am @@ -6,13 +6,13 @@ x_includedir = $(pkgincludedir)/sfip x_include_HEADERS = \ sf_returns.h \ sf_cidr.h \ -sf_ip.h \ -sf_ipvar.h +sf_ip.h libsfip_a_SOURCES = \ sf_cidr.cc \ sf_ip.cc \ sf_ipvar.cc \ +sf_ipvar.h \ sf_vartable.cc \ sf_vartable.h diff --git a/src/sfip/sf_cidr.cc b/src/sfip/sf_cidr.cc index 0aa73fdb9..03bec8b94 100644 --- a/src/sfip/sf_cidr.cc +++ b/src/sfip/sf_cidr.cc @@ -18,6 +18,10 @@ //-------------------------------------------------------------------------- // sf_cidr.cc author Michael Altizer +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sf_cidr.h" SfIpRet SfCidr::set(const char* src) diff --git a/src/sfip/sf_ip.cc b/src/sfip/sf_ip.cc index 6a27b11fc..e8051c449 100644 --- a/src/sfip/sf_ip.cc +++ b/src/sfip/sf_ip.cc @@ -21,13 +21,14 @@ /* Library for managing IP addresses of either v6 or v4 families. */ -#include "sf_ip.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include // For ceil +#include "sf_ip.h" + +#include +#include // For ceil #include "main/thread.h" #include "utils/util.h" diff --git a/src/sfip/sf_ip.h b/src/sfip/sf_ip.h index f037f866f..d98f0e699 100644 --- a/src/sfip/sf_ip.h +++ b/src/sfip/sf_ip.h @@ -23,9 +23,7 @@ #define SF_IP_H #include -#include #include -#include #include diff --git a/src/sfip/sf_ipvar.cc b/src/sfip/sf_ipvar.cc index 441bcf1ea..dc413ae59 100644 --- a/src/sfip/sf_ipvar.cc +++ b/src/sfip/sf_ipvar.cc @@ -24,12 +24,12 @@ * * Library for IP variables. */ -#include "sf_ipvar.h" -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sf_ipvar.h" #include "utils/util.h" diff --git a/src/sfip/sf_ipvar.h b/src/sfip/sf_ipvar.h index ed462e012..5d4a32d52 100644 --- a/src/sfip/sf_ipvar.h +++ b/src/sfip/sf_ipvar.h @@ -33,8 +33,7 @@ #define SFIP_NEGATED 1 #define SFIP_ANY 2 -#include -#include +#include #include "sfip/sf_returns.h" diff --git a/src/sfip/sf_vartable.cc b/src/sfip/sf_vartable.cc index a94b722e2..c9ecfbed7 100644 --- a/src/sfip/sf_vartable.cc +++ b/src/sfip/sf_vartable.cc @@ -24,18 +24,13 @@ * * Library for managing IP variables. */ -#include "sf_vartable.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "sf_vartable.h" -#include "main/snort_types.h" -#include "sfip/sf_vartable.h" #include "sfip/sf_ipvar.h" #include "utils/util.h" diff --git a/src/sfrt/CMakeLists.txt b/src/sfrt/CMakeLists.txt index 61c8aa395..12a9afe57 100644 --- a/src/sfrt/CMakeLists.txt +++ b/src/sfrt/CMakeLists.txt @@ -1,26 +1,18 @@ - -set ( SFRT_INCLUDES - sfrt.h - sfrt_trie.h - sfrt_dir.h - sfrt_flat.h - sfrt_flat_dir.h -) - if ( ENABLE_UNIT_TESTS ) set(TEST_FILES sfrt_test.cc) endif() add_library ( sfrt STATIC sfrt.cc + sfrt.h sfrt_dir.cc + sfrt_dir.h sfrt_flat.cc + sfrt_flat.h sfrt_flat_dir.cc - ${SFRT_INCLUDES} + sfrt_flat_dir.h + sfrt_trie.h ${TEST_FILES} ) -install (FILES ${SFRT_INCLUDES} - DESTINATION "${INCLUDE_INSTALL_PATH}/sfrt" -) diff --git a/src/sfrt/Makefile.am b/src/sfrt/Makefile.am index d3e069f63..a923936a0 100644 --- a/src/sfrt/Makefile.am +++ b/src/sfrt/Makefile.am @@ -1,20 +1,15 @@ noinst_LIBRARIES = libsfrt.a -x_includedir = $(pkgincludedir)/sfrt - -x_include_HEADERS = \ -sfrt.h \ -sfrt_trie.h \ -sfrt_dir.h \ -sfrt_flat.h \ -sfrt_flat_dir.h - libsfrt_a_SOURCES = \ sfrt.cc \ +sfrt.h \ sfrt_dir.cc \ +sfrt_dir.h \ sfrt_flat.cc \ -sfrt_flat_dir.cc +sfrt_flat.h \ +sfrt_flat_dir.cc \ +sfrt_flat_dir.h if ENABLE_UNIT_TESTS libsfrt_a_SOURCES += sfrt_test.cc diff --git a/src/sfrt/sfrt.cc b/src/sfrt/sfrt.cc index 70981fcbe..e8df6890f 100644 --- a/src/sfrt/sfrt.cc +++ b/src/sfrt/sfrt.cc @@ -77,12 +77,12 @@ * sfrt_free - free table */ -#include "sfrt.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "sfrt.h" + #include "sfip/sf_cidr.h" #include "utils/util.h" diff --git a/src/sfrt/sfrt.h b/src/sfrt/sfrt.h index 011c51085..ffdc4fadc 100644 --- a/src/sfrt/sfrt.h +++ b/src/sfrt/sfrt.h @@ -23,7 +23,7 @@ #ifndef SFRT_H #define SFRT_H -#include +#include #include "sfip/sf_ip.h" #include "sfrt/sfrt_trie.h" diff --git a/src/sfrt/sfrt_dir.cc b/src/sfrt/sfrt_dir.cc index 6bbfd5360..fc89039b6 100644 --- a/src/sfrt/sfrt_dir.cc +++ b/src/sfrt/sfrt_dir.cc @@ -26,15 +26,15 @@ * DIR-n-m. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sfrt.h" // FIXIT-L these includes are circular #include "sfrt_dir.h" #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "utils/util.h" typedef struct diff --git a/src/sfrt/sfrt_dir.h b/src/sfrt/sfrt_dir.h index 38eb3363f..460a61280 100644 --- a/src/sfrt/sfrt_dir.h +++ b/src/sfrt/sfrt_dir.h @@ -30,7 +30,7 @@ // The implementation uses an multibit-trie that is similar to Gupta et-al's // DIR-n-m. -#include +#include /*******************************************************************/ /* DIR-n-m data structures diff --git a/src/sfrt/sfrt_flat.cc b/src/sfrt/sfrt_flat.cc index 98442da14..87203b514 100644 --- a/src/sfrt/sfrt_flat.cc +++ b/src/sfrt/sfrt_flat.cc @@ -18,12 +18,12 @@ //-------------------------------------------------------------------------- // 9/7/2011 - Initial implementation ... Hui Cao -#include "sfrt_flat.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "sfrt_flat.h" + #include "sfip/sf_cidr.h" diff --git a/src/sfrt/sfrt_flat_dir.cc b/src/sfrt/sfrt_flat_dir.cc index 8de888fed..b2f487d00 100644 --- a/src/sfrt/sfrt_flat_dir.cc +++ b/src/sfrt/sfrt_flat_dir.cc @@ -18,13 +18,13 @@ //-------------------------------------------------------------------------- // 9/7/2011 - Initial implementation ... Hui Cao -#include "sfrt_flat.h" // FIXIT-L these includes are circular -#include "sfrt_flat_dir.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "sfrt_flat.h" // FIXIT-L these includes are circular +#include "sfrt_flat_dir.h" + #include #if SIZEOF_UNSIGNED_LONG_INT == 8 diff --git a/src/sfrt/sfrt_test.cc b/src/sfrt/sfrt_test.cc index dd2e7e618..2c90bd06d 100644 --- a/src/sfrt/sfrt_test.cc +++ b/src/sfrt/sfrt_test.cc @@ -18,6 +18,10 @@ //-------------------------------------------------------------------------- // sfrt_test.cc author Hui Cao +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "catch/catch.hpp" #include "catch/unit_test.h" #include "sfip/sf_cidr.h" diff --git a/src/side_channel/side_channel.cc b/src/side_channel/side_channel.cc index e2941788d..d34c735eb 100644 --- a/src/side_channel/side_channel.cc +++ b/src/side_channel/side_channel.cc @@ -18,25 +18,20 @@ // side_channel.cc author Ed Borgoyn -#include "side_channel.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include +#include "side_channel.h" + +#include + +#include +#include "framework/counts.h" #include "main/snort_debug.h" #include "managers/connector_manager.h" -#include "profiler/profiler.h" -#include "utils/stats.h" +#include "profiler/profiler_defs.h" /* Globals ****************************************************************/ diff --git a/src/side_channel/side_channel.h b/src/side_channel/side_channel.h index d0e3cc130..976951f05 100644 --- a/src/side_channel/side_channel.h +++ b/src/side_channel/side_channel.h @@ -19,8 +19,6 @@ #ifndef SIDE_CHANNEL_H #define SIDE_CHANNEL_H -#include -#include #include #include "framework/bits.h" @@ -44,9 +42,6 @@ struct __attribute__((__packed__)) SCMsgHdr uint64_t time_seconds; }; -class ConnectorMsgHandle; -class Connector; - struct SCMessage { SideChannel* sc; diff --git a/src/side_channel/side_channel_module.cc b/src/side_channel/side_channel_module.cc index ac7ced5bf..8fca8bd45 100644 --- a/src/side_channel/side_channel_module.cc +++ b/src/side_channel/side_channel_module.cc @@ -18,13 +18,16 @@ // side_channel_module.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "side_channel_module.h" -#include -#include +#include -#include "main/snort_debug.h" #include "log/messages.h" + #include "side_channel.h" static const PegInfo sc_pegs[] = diff --git a/src/side_channel/side_channel_module.h b/src/side_channel/side_channel_module.h index c796a5f18..4f918e572 100644 --- a/src/side_channel/side_channel_module.h +++ b/src/side_channel/side_channel_module.h @@ -21,12 +21,8 @@ #ifndef SIDE_CHANNEL_MODULE_H #define SIDE_CHANNEL_MODULE_H -#include - -#include "framework/connector.h" #include "framework/module.h" -#include "main/thread.h" -#include "side_channel.h" +#include "side_channel/side_channel.h" #define SIDECHANNEL_NAME "side_channel" #define SIDECHANNEL_HELP "implement the side-channel asynchronous messaging subsystem" diff --git a/src/side_channel/test/side_channel_module_test.cc b/src/side_channel/test/side_channel_module_test.cc index 600ebdb2d..998a5eefa 100644 --- a/src/side_channel/test/side_channel_module_test.cc +++ b/src/side_channel/test/side_channel_module_test.cc @@ -19,6 +19,10 @@ // side_channel_module_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "side_channel/side_channel.h" #include "side_channel/side_channel_module.h" diff --git a/src/side_channel/test/side_channel_test.cc b/src/side_channel/test/side_channel_test.cc index 381f3edf9..03f5f87fa 100644 --- a/src/side_channel/test/side_channel_test.cc +++ b/src/side_channel/test/side_channel_test.cc @@ -19,6 +19,10 @@ // side_channel_test.cc author Ed Borgoyn // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "side_channel/side_channel.h" #include "log/messages.h" diff --git a/src/stream/base/stream_base.cc b/src/stream/base/stream_base.cc index 8b7f96dd7..41b38a53c 100644 --- a/src/stream/base/stream_base.cc +++ b/src/stream/base/stream_base.cc @@ -20,17 +20,14 @@ #include "config.h" #endif -#include - #include "flow/flow_control.h" #include "flow/prune_stats.h" -#include "main/snort_debug.h" +#include "protocols/packet.h" #include "managers/inspector_manager.h" -#include "profiler/profiler.h" +#include "profiler/profiler_defs.h" -#include "stream/tcp/tcp_session.h" -#include "stream_module.h" #include "stream_ha.h" +#include "stream_module.h" //------------------------------------------------------------------------- // stats diff --git a/src/stream/base/stream_ha.cc b/src/stream/base/stream_ha.cc index cf2bb869e..7fa597d29 100644 --- a/src/stream/base/stream_ha.cc +++ b/src/stream/base/stream_ha.cc @@ -17,16 +17,19 @@ //-------------------------------------------------------------------------- // stream_ha.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "stream_ha.h" -#include #include #include "binder/binder.h" +#include "flow/flow_key.h" #include "main/snort_debug.h" #include "managers/inspector_manager.h" #include "stream/stream.h" -#include "sfip/sf_ip.h" // HA Session flags helper macros #define HA_IGNORED_SESSION_FLAGS \ diff --git a/src/stream/base/stream_ha.h b/src/stream/base/stream_ha.h index 8696a5865..ef1e8d590 100644 --- a/src/stream/base/stream_ha.h +++ b/src/stream/base/stream_ha.h @@ -22,7 +22,6 @@ #include "flow/flow.h" #include "flow/ha.h" -#include "main/snort_types.h" //------------------------------------------------------------------------- diff --git a/src/stream/base/stream_module.cc b/src/stream/base/stream_module.cc index 16613cae3..3eb0f0bd6 100644 --- a/src/stream/base/stream_module.cc +++ b/src/stream/base/stream_module.cc @@ -18,9 +18,11 @@ // stream_module.cc author Russ Combs -#include "stream_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "stream_module.h" using namespace std; diff --git a/src/stream/base/stream_module.h b/src/stream/base/stream_module.h index b2c70cb10..7d03a729d 100644 --- a/src/stream/base/stream_module.h +++ b/src/stream/base/stream_module.h @@ -21,9 +21,8 @@ #ifndef STREAM_MODULE_H #define STREAM_MODULE_H -#include "main/snort_types.h" -#include "framework/module.h" #include "flow/flow_config.h" +#include "framework/module.h" extern THREAD_LOCAL ProfileStats s5PerfStats; struct SnortConfig; diff --git a/src/stream/file/file_module.cc b/src/stream/file/file_module.cc index 9d0a8ddfe..3be2ceb40 100644 --- a/src/stream/file/file_module.cc +++ b/src/stream/file/file_module.cc @@ -17,12 +17,11 @@ //-------------------------------------------------------------------------- // file_module.cc author Russ Combs -#include "file_module.h" - -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "stream_file.h" -#include "main/snort_config.h" +#include "file_module.h" using namespace std; diff --git a/src/stream/file/file_module.h b/src/stream/file/file_module.h index 0301128bc..45c1e295d 100644 --- a/src/stream/file/file_module.h +++ b/src/stream/file/file_module.h @@ -20,8 +20,6 @@ #ifndef FILE_MODULE_H #define FILE_MODULE_H -#include "main/snort_types.h" -#include "main/thread.h" #include "framework/module.h" struct SnortConfig; diff --git a/src/stream/file/file_session.cc b/src/stream/file/file_session.cc index afa2ad2c7..0a812e7ed 100644 --- a/src/stream/file/file_session.cc +++ b/src/stream/file/file_session.cc @@ -17,22 +17,20 @@ //-------------------------------------------------------------------------- // file_session.cc author Russ Combs -#include "file_session.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "file_api/file_api.h" -#include "perf_monitor/perf_monitor.h" +#include "file_session.h" + +#include "detection/detection_util.h" #include "file_api/file_flows.h" -#include "profiler/profiler.h" #include "packet_io/sfdaq.h" -#include "detection/detection_util.h" +#include "profiler/profiler_defs.h" +#include "protocols/packet.h" #include "target_based/snort_protocols.h" #include "stream_file.h" -#include "file_module.h" #define DECODE_PDU (DECODE_SOF | DECODE_EOF) diff --git a/src/stream/file/file_session.h b/src/stream/file/file_session.h index 12ccb2654..55fc366ba 100644 --- a/src/stream/file/file_session.h +++ b/src/stream/file/file_session.h @@ -17,14 +17,10 @@ //-------------------------------------------------------------------------- // file_session.h author Russ Combs -#ifndef USER_SESSION_H -#define USER_SESSION_H - -#include -#include +#ifndef FILE_SESSION_H +#define FILE_SESSION_H #include "flow/session.h" -#include "stream/paf.h" class FileSession : public Session { diff --git a/src/stream/file/stream_file.cc b/src/stream/file/stream_file.cc index e9b6a5df5..539a4035e 100644 --- a/src/stream/file/stream_file.cc +++ b/src/stream/file/stream_file.cc @@ -17,16 +17,11 @@ //-------------------------------------------------------------------------- // stream_file.cc author Russ Combs -#include "stream_file.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include - -#include "log/messages.h" -#include "protocols/packet.h" +#include "stream_file.h" #include "file_module.h" #include "file_session.h" diff --git a/src/stream/flush_bucket.cc b/src/stream/flush_bucket.cc index a7171a6df..c7add9f29 100644 --- a/src/stream/flush_bucket.cc +++ b/src/stream/flush_bucket.cc @@ -17,15 +17,16 @@ //-------------------------------------------------------------------------- // flush_bucket.cc author Russ Combs -#include "flush_bucket.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "flush_bucket.h" +#include #include #include "main/snort_config.h" -#include "protocols/packet.h" //------------------------------------------------------------------------- // static base members diff --git a/src/stream/flush_bucket.h b/src/stream/flush_bucket.h index 9921998ea..b24c55e1a 100644 --- a/src/stream/flush_bucket.h +++ b/src/stream/flush_bucket.h @@ -20,8 +20,7 @@ #ifndef FLUSH_BUCKET_H #define FLUSH_BUCKET_H -#include "main/snort_types.h" -#include "main/thread.h" +#include class FlushBucket { diff --git a/src/stream/icmp/icmp_ha.cc b/src/stream/icmp/icmp_ha.cc index 61271c06d..844b23c9c 100644 --- a/src/stream/icmp/icmp_ha.cc +++ b/src/stream/icmp/icmp_ha.cc @@ -17,10 +17,12 @@ //-------------------------------------------------------------------------- // icmp_ha.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "icmp_ha.h" -#include "flow/flow_control.h" -#include "main/snort_debug.h" #include "stream/icmp/icmp_session.h" #include "stream/stream.h" diff --git a/src/stream/icmp/icmp_ha.h b/src/stream/icmp/icmp_ha.h index 844a4ded8..10f326b26 100644 --- a/src/stream/icmp/icmp_ha.h +++ b/src/stream/icmp/icmp_ha.h @@ -20,7 +20,6 @@ #ifndef ICMP_HA_H #define ICMP_HA_H -#include "main/snort_types.h" #include "stream/base/stream_ha.h" //------------------------------------------------------------------------- diff --git a/src/stream/icmp/icmp_module.cc b/src/stream/icmp/icmp_module.cc index cd79707a9..725e6cd6d 100644 --- a/src/stream/icmp/icmp_module.cc +++ b/src/stream/icmp/icmp_module.cc @@ -18,9 +18,11 @@ // icmp_module.cc author Russ Combs -#include "icmp_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "icmp_module.h" #include "stream_icmp.h" diff --git a/src/stream/icmp/icmp_module.h b/src/stream/icmp/icmp_module.h index fae11a0cf..70424ca98 100644 --- a/src/stream/icmp/icmp_module.h +++ b/src/stream/icmp/icmp_module.h @@ -21,8 +21,6 @@ #ifndef ICMP_MODULE_H #define ICMP_MODULE_H -#include "main/snort_types.h" -#include "main/thread.h" #include "flow/session.h" #include "framework/module.h" diff --git a/src/stream/icmp/icmp_session.cc b/src/stream/icmp/icmp_session.cc index 5211ad2ef..2248c92a3 100644 --- a/src/stream/icmp/icmp_session.cc +++ b/src/stream/icmp/icmp_session.cc @@ -17,33 +17,24 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "stream_icmp.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "hash/sfxhash.h" -#include "utils/util.h" -#include "stream/stream.h" -#include "flow/flow.h" -#include "flow/flow_control.h" -#include "flow/session.h" -#include "profiler/profiler.h" -#include "protocols/packet.h" -#include "protocols/layer.h" -#include "protocols/vlan.h" -#include "protocols/ip.h" +#include "icmp_session.h" + +#include "flow/flow_key.h" +#include "profiler/profiler_defs.h" #include "protocols/icmp4.h" -#include "protocols/udp.h" +#include "protocols/packet.h" #include "protocols/tcp.h" -#include "sfip/sf_ip.h" +#include "protocols/udp.h" +#include "protocols/vlan.h" +#include "utils/util.h" #include "icmp_ha.h" #include "icmp_module.h" -#include "icmp_session.h" +#include "stream_icmp.h" const PegInfo icmp_pegs[] = { diff --git a/src/stream/icmp/stream_icmp.cc b/src/stream/icmp/stream_icmp.cc index db8122142..a83619a89 100644 --- a/src/stream/icmp/stream_icmp.cc +++ b/src/stream/icmp/stream_icmp.cc @@ -21,17 +21,14 @@ #include "config.h" #endif -#include - #include "stream_icmp.h" + +#include "log/messages.h" + #include "icmp_ha.h" #include "icmp_module.h" #include "icmp_session.h" -#include "log/messages.h" -#include "framework/inspector.h" -#include "protocols/packet.h" - //------------------------------------------------------------------------- // helpers //------------------------------------------------------------------------- diff --git a/src/stream/icmp/stream_icmp.h b/src/stream/icmp/stream_icmp.h index 2046b36ae..693ba2230 100644 --- a/src/stream/icmp/stream_icmp.h +++ b/src/stream/icmp/stream_icmp.h @@ -20,7 +20,7 @@ #ifndef STREAM_ICMP_H #define STREAM_ICMP_H -#include "main/snort_types.h" +#include struct StreamIcmpConfig { diff --git a/src/stream/ip/ip_defrag.cc b/src/stream/ip/ip_defrag.cc index 29f89df45..319134719 100644 --- a/src/stream/ip/ip_defrag.cc +++ b/src/stream/ip/ip_defrag.cc @@ -68,35 +68,23 @@ #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include - -#include "framework/codec.h" -#include "flow/flow_control.h" #include "ip_defrag.h" -#include "stream/ip/ip_session.h" -#include "stream/ip/ip_module.h" -#include "stream/ip/stream_ip.h" + +#include "detection/detect.h" +#include "log/messages.h" +#include "main/snort.h" +#include "main/snort_config.h" #include "packet_io/active.h" #include "packet_io/sfdaq.h" -#include "protocols/layer.h" +#include "profiler/profiler_defs.h" #include "protocols/ipv4_options.h" -#include "protocols/packet_manager.h" -#include "log/messages.h" -#include "main/snort.h" -#include "main/snort_debug.h" -#include "profiler/profiler.h" #include "time/timersub.h" -#include "utils/stats.h" -#include "detection/detect.h" #include "utils/safec.h" #include "utils/util.h" +#include "ip_session.h" +#include "stream_ip.h" + /* D E F I N E S **************************************************/ /* flags for the FragTracker->frag_flags field */ diff --git a/src/stream/ip/ip_defrag.h b/src/stream/ip/ip_defrag.h index 4198ae9ec..3ffdaf8eb 100644 --- a/src/stream/ip/ip_defrag.h +++ b/src/stream/ip/ip_defrag.h @@ -23,12 +23,16 @@ // ip datagram reassembly -int drop_all_fragments(Packet* p); -int fragGetApplicationProtocolId(Packet* p); +#include struct FragEngine; struct FragTracker; struct Fragment; +struct Packet; +struct SnortConfig; + +int drop_all_fragments(Packet* p); +int fragGetApplicationProtocolId(Packet* p); class Defrag { diff --git a/src/stream/ip/ip_ha.cc b/src/stream/ip/ip_ha.cc index d2d3cbe33..ed03a4aef 100644 --- a/src/stream/ip/ip_ha.cc +++ b/src/stream/ip/ip_ha.cc @@ -17,10 +17,14 @@ //-------------------------------------------------------------------------- // ip_ha.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ip_ha.h" -#include "main/snort_debug.h" #include "stream/stream.h" + #include "ip_session.h" Flow* IpHA::create_session(FlowKey* key) diff --git a/src/stream/ip/ip_ha.h b/src/stream/ip/ip_ha.h index 0987b9db8..9788ff54a 100644 --- a/src/stream/ip/ip_ha.h +++ b/src/stream/ip/ip_ha.h @@ -20,7 +20,6 @@ #ifndef IP_HA_H #define IP_HA_H -#include "main/snort_types.h" #include "stream/base/stream_ha.h" //------------------------------------------------------------------------- diff --git a/src/stream/ip/ip_module.cc b/src/stream/ip/ip_module.cc index a335468e9..2ebfbe2c3 100644 --- a/src/stream/ip/ip_module.cc +++ b/src/stream/ip/ip_module.cc @@ -18,13 +18,13 @@ // ip_module.cc author Russ Combs -#include "ip_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "ip_module.h" #include "stream_ip.h" -#include "ip_defrag.h" -#include "stream/stream.h" using namespace std; diff --git a/src/stream/ip/ip_module.h b/src/stream/ip/ip_module.h index f71daa904..ae31d519e 100644 --- a/src/stream/ip/ip_module.h +++ b/src/stream/ip/ip_module.h @@ -21,11 +21,9 @@ #ifndef IP_MODULE_H #define IP_MODULE_H -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "main/thread.h" #include "flow/session.h" #include "framework/module.h" +#include "main/snort_debug.h" struct SnortConfig; diff --git a/src/stream/ip/ip_session.cc b/src/stream/ip/ip_session.cc index 79bbb0725..7faf39946 100644 --- a/src/stream/ip/ip_session.cc +++ b/src/stream/ip/ip_session.cc @@ -17,19 +17,18 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "ip_session.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "stream_ip.h" -#include "ip_module.h" +#include "ip_session.h" + +#include "profiler/profiler_defs.h" +#include "protocols/packet.h" + #include "ip_defrag.h" #include "ip_ha.h" -#include "stream/stream.h" -#include "sfip/sf_ip.h" -#include "profiler/profiler.h" +#include "stream_ip.h" const PegInfo ip_pegs[] = { diff --git a/src/stream/ip/ip_session.h b/src/stream/ip/ip_session.h index 21babd0ea..dd42a18dd 100644 --- a/src/stream/ip/ip_session.h +++ b/src/stream/ip/ip_session.h @@ -20,11 +20,7 @@ #ifndef IP_SESSION_H #define IP_SESSION_H -#include "ip_module.h" - -#include -#include "flow/session.h" -#include "framework/counts.h" +#include "stream/ip/ip_module.h" struct Fragment; struct FragEngine; diff --git a/src/stream/ip/stream_ip.cc b/src/stream/ip/stream_ip.cc index e62da7e94..6ede62ab3 100644 --- a/src/stream/ip/stream_ip.cc +++ b/src/stream/ip/stream_ip.cc @@ -17,20 +17,18 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "stream_ip.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "stream_ip.h" + +#include "log/messages.h" -#include "ip_module.h" #include "ip_defrag.h" #include "ip_ha.h" +#include "ip_module.h" #include "ip_session.h" -#include "log/messages.h" -#include "protocols/packet.h" /* max frags in a single frag tracker */ #define DEFAULT_MAX_FRAGS 8192 diff --git a/src/stream/ip/stream_ip.h b/src/stream/ip/stream_ip.h index 80ed54548..8c350a07f 100644 --- a/src/stream/ip/stream_ip.h +++ b/src/stream/ip/stream_ip.h @@ -22,7 +22,7 @@ #ifndef STREAM_IP_H #define STREAM_IP_H -#include "flow/flow.h" +#include "framework/inspector.h" /* engine-based defragmentation policy enums */ // must update stream.h::IP_POLICIES if this changes diff --git a/src/stream/libtcp/stream_tcp_unit_test.cc b/src/stream/libtcp/stream_tcp_unit_test.cc index aafa00fff..fcd0a2f8a 100644 --- a/src/stream/libtcp/stream_tcp_unit_test.cc +++ b/src/stream/libtcp/stream_tcp_unit_test.cc @@ -22,13 +22,14 @@ #ifndef STREAM_LIBTCP_UNIT_TEST #define STREAM_LIBTCP_UNIT_TEST -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "protocols/packet.h" -#include "protocols/tcp.h" #include "stream_tcp_unit_test.h" +#include "protocols/packet.h" + // SYN PACKET // IP 192.168.0.89.9012 > p3nlh044.shr.prod.phx3.secureserver.net.http: Flags [S], seq 9050, win // 8192, length 0 diff --git a/src/stream/libtcp/stream_tcp_unit_test.h b/src/stream/libtcp/stream_tcp_unit_test.h index 29c8ba527..f9234eab7 100644 --- a/src/stream/libtcp/stream_tcp_unit_test.h +++ b/src/stream/libtcp/stream_tcp_unit_test.h @@ -22,9 +22,8 @@ #ifndef STREAM_LIBTCP_UNIT_TEST_H #define STREAM_LIBTCP_UNIT_TEST_H -#include - -#include "protocols/packet.h" +class Flow; +struct Packet; Packet* get_syn_packet(Flow*); Packet* get_syn_ack_packet(Flow*); diff --git a/src/stream/libtcp/tcp_segment_descriptor.cc b/src/stream/libtcp/tcp_segment_descriptor.cc index 0f75d821f..271e64dec 100644 --- a/src/stream/libtcp/tcp_segment_descriptor.cc +++ b/src/stream/libtcp/tcp_segment_descriptor.cc @@ -19,14 +19,16 @@ // tcp_segment_descriptor.cc author davis mcpherson // Created on: Jul 30, 2015 -#include "log/messages.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tcp_segment_descriptor.h" + +#include "detection/rules.h" #include "main/snort_debug.h" #include "protocols/tcp_options.h" -#include "detection/rules.h" - #include "stream/tcp/tcp_defs.h" -#include "stream/tcp/tcp_event_logger.h" -#include "tcp_segment_descriptor.h" using namespace tcp; diff --git a/src/stream/libtcp/tcp_segment_descriptor.h b/src/stream/libtcp/tcp_segment_descriptor.h index d74139932..a6f1efe45 100644 --- a/src/stream/libtcp/tcp_segment_descriptor.h +++ b/src/stream/libtcp/tcp_segment_descriptor.h @@ -23,9 +23,8 @@ #define TCP_SEGMENT_DESCRIPTOR_H #include "flow/flow.h" -#include "protocols/tcp.h" #include "protocols/packet.h" - +#include "protocols/tcp.h" #include "stream/tcp/tcp_event_logger.h" class TcpSegmentDescriptor diff --git a/src/stream/libtcp/tcp_state_handler.cc b/src/stream/libtcp/tcp_state_handler.cc index 63be0961a..c95640ae6 100644 --- a/src/stream/libtcp/tcp_state_handler.cc +++ b/src/stream/libtcp/tcp_state_handler.cc @@ -19,16 +19,20 @@ // tcp_state_handler.cc author davis mcpherson // Created on: Jun 24, 2015 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tcp_state_handler.h" + #include #include "main/snort_debug.h" #include "tcp_state_machine.h" -#include "tcp_state_handler.h" #ifdef UNIT_TEST #include "catch/catch.hpp" -#include "stream_tcp_unit_test.h" #endif using namespace std; diff --git a/src/stream/libtcp/tcp_state_handler.h b/src/stream/libtcp/tcp_state_handler.h index 230f9e686..ff95c1a25 100644 --- a/src/stream/libtcp/tcp_state_handler.h +++ b/src/stream/libtcp/tcp_state_handler.h @@ -23,8 +23,8 @@ #define TCP_STATE_HANDLER_H #include "protocols/tcp.h" -#include "tcp_segment_descriptor.h" -#include "tcp_stream_tracker.h" +#include "stream/libtcp/tcp_segment_descriptor.h" +#include "stream/libtcp/tcp_stream_tracker.h" class TcpStateMachine; diff --git a/src/stream/libtcp/tcp_state_machine.cc b/src/stream/libtcp/tcp_state_machine.cc index 952b6828c..f90f870cc 100644 --- a/src/stream/libtcp/tcp_state_machine.cc +++ b/src/stream/libtcp/tcp_state_machine.cc @@ -19,8 +19,10 @@ // tcp_state_machine.cc author davis mcpherson // Created on: Jul 29, 2015 -#include "tcp_stream_tracker.h" -#include "tcp_stream_session.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_state_machine.h" TcpStateMachine::TcpStateMachine() diff --git a/src/stream/libtcp/tcp_state_machine.h b/src/stream/libtcp/tcp_state_machine.h index 6eb305e3c..77583c5f5 100644 --- a/src/stream/libtcp/tcp_state_machine.h +++ b/src/stream/libtcp/tcp_state_machine.h @@ -22,11 +22,9 @@ #ifndef TCP_STATE_MACHINE_H #define TCP_STATE_MACHINE_H -#include - -#include "tcp_state_handler.h" -#include "tcp_stream_tracker.h" -#include "tcp_segment_descriptor.h" +#include "stream/libtcp/tcp_state_handler.h" +#include "stream/libtcp/tcp_stream_tracker.h" +#include "stream/libtcp/tcp_segment_descriptor.h" class TcpStateMachine { diff --git a/src/stream/libtcp/tcp_stream_session.cc b/src/stream/libtcp/tcp_stream_session.cc index b60a46c89..1f4079ff1 100644 --- a/src/stream/libtcp/tcp_stream_session.cc +++ b/src/stream/libtcp/tcp_stream_session.cc @@ -19,13 +19,16 @@ // tcp_stream_session.cc author davis mcpherson // Created on: Feb 18, 2016 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tcp_stream_session.h" + #include "log/messages.h" #include "main/snort_debug.h" -#include "sfip/sf_ip.h" #include "stream/tcp/tcp_ha.h" -#include "tcp_stream_session.h" - #ifdef DEBUG_MSGS const char* const flush_policy_names[] = { diff --git a/src/stream/libtcp/tcp_stream_session.h b/src/stream/libtcp/tcp_stream_session.h index 99c18047e..dd8d810a3 100644 --- a/src/stream/libtcp/tcp_stream_session.h +++ b/src/stream/libtcp/tcp_stream_session.h @@ -22,15 +22,10 @@ #ifndef TCP_STREAM_SESSION_H_ #define TCP_STREAM_SESSION_H_ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "detection/detect.h" #include "flow/session.h" +#include "stream/libtcp/tcp_stream_tracker.h" #include "stream/tcp/tcp_stream_config.h" -#include "stream/tcp/tcp_event_logger.h" -#include "tcp_stream_tracker.h" #ifdef DEBUG_MSGS extern const char* const flush_policy_names[]; diff --git a/src/stream/libtcp/tcp_stream_tracker.cc b/src/stream/libtcp/tcp_stream_tracker.cc index 88ccbbf8b..46bff4d49 100644 --- a/src/stream/libtcp/tcp_stream_tracker.cc +++ b/src/stream/libtcp/tcp_stream_tracker.cc @@ -19,12 +19,13 @@ // tcp_stream_tracker.cpp author davis mcpherson // Created on: Jun 24, 2015 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_stream_tracker.h" -#include "profiler/profiler.h" #include "protocols/eth.h" -#include "protocols/tcp.h" -#include "protocols/tcp_options.h" #include "stream/stream.h" const char* tcp_state_names[] = diff --git a/src/stream/libtcp/tcp_stream_tracker.h b/src/stream/libtcp/tcp_stream_tracker.h index 764056236..7282ba538 100644 --- a/src/stream/libtcp/tcp_stream_tracker.h +++ b/src/stream/libtcp/tcp_stream_tracker.h @@ -22,11 +22,9 @@ #ifndef TCP_STREAM_TRACKER_H #define TCP_STREAM_TRACKER_H -#include "stdint.h" - +#include "stream/libtcp/tcp_segment_descriptor.h" #include "stream/paf.h" #include "stream/tcp/tcp_defs.h" -#include "tcp_segment_descriptor.h" /* Only track a maximum number of alerts per session */ #define MAX_SESSION_ALERTS 8 diff --git a/src/stream/paf.cc b/src/stream/paf.cc index 1d9e4b1d6..d2a119aec 100644 --- a/src/stream/paf.cc +++ b/src/stream/paf.cc @@ -19,20 +19,12 @@ // paf.cc author Russ Combs -#include "paf.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include +#include "paf.h" -#include "main/snort_types.h" #include "main/snort_debug.h" #include "protocols/packet.h" diff --git a/src/stream/paf.h b/src/stream/paf.h index 799638bd9..43749af3d 100644 --- a/src/stream/paf.h +++ b/src/stream/paf.h @@ -25,9 +25,6 @@ #ifndef PAF_H #define PAF_H -#include - -#include "main/snort_types.h" #include "stream/stream_splitter.h" struct SnortConfig; diff --git a/src/stream/stream.cc b/src/stream/stream.cc index b38941ea6..bc25cbbf5 100644 --- a/src/stream/stream.cc +++ b/src/stream/stream.cc @@ -17,47 +17,29 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "stream.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include +#include "stream.h" -#include "main/snort_config.h" -#include "main/snort_debug.h" -#include "main/snort_debug.h" #include "flow/flow_control.h" -#include "flow/flow_cache.h" +#include "flow/flow_key.h" #include "flow/ha.h" #include "flow/prune_stats.h" -#include "flow/session.h" -#include "stream/stream.h" -#include "stream/paf.h" -#include "tcp/tcp_session.h" -#include "tcp/stream_tcp.h" -#include "udp/stream_udp.h" -#include "icmp/stream_icmp.h" -#include "ip/stream_ip.h" -#include "detection/detect.h" +#include "main/snort_config.h" +#include "main/snort_debug.h" #include "packet_io/active.h" -#include "packet_io/sfdaq.h" -#include "ips_options/ips_flowbits.h" -#include "protocols/packet.h" -#include "protocols/layer.h" #include "protocols/vlan.h" -#include "target_based/snort_protocols.h" #include "target_based/sftarget_hostentry.h" -#include "utils/bitop.h" +#include "target_based/snort_protocols.h" #include "utils/util.h" +#include "tcp/tcp_session.h" + #ifdef UNIT_TEST #include "catch/catch.hpp" -#include "stream/libtcp/stream_tcp_unit_test.h" +#include "libtcp/stream_tcp_unit_test.h" #endif // this should not be publicly accessible diff --git a/src/stream/stream.h b/src/stream/stream.h index 7863a86d8..aefc61ef2 100644 --- a/src/stream/stream.h +++ b/src/stream/stream.h @@ -24,11 +24,7 @@ // provides a common flow management interface -#include - -#include "protocols/packet.h" #include "flow/flow.h" -#include "main/snort_types.h" /* traffic direction identification */ #define FROM_SERVER 0 diff --git a/src/stream/stream_inspectors.cc b/src/stream/stream_inspectors.cc index 14a030eef..1fd3ca69b 100644 --- a/src/stream/stream_inspectors.cc +++ b/src/stream/stream_inspectors.cc @@ -17,9 +17,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "stream_inspectors.h" -#include "framework/inspector.h" #include "managers/plugin_manager.h" extern const BaseApi* nin_stream_base; diff --git a/src/stream/stream_splitter.cc b/src/stream/stream_splitter.cc index d21a4e781..0a3450a5a 100644 --- a/src/stream/stream_splitter.cc +++ b/src/stream/stream_splitter.cc @@ -17,10 +17,11 @@ //-------------------------------------------------------------------------- // stream_splitter.cc author Russ Combs -#include "stream_splitter.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include +#include "stream_splitter.h" #include "main/snort_config.h" #include "protocols/packet.h" diff --git a/src/stream/stream_splitter.h b/src/stream/stream_splitter.h index 0386b5702..1c5a7bb6f 100644 --- a/src/stream/stream_splitter.h +++ b/src/stream/stream_splitter.h @@ -21,7 +21,6 @@ #define TCP_SPLITTER_H #include "main/snort_types.h" -#include "main/thread.h" class Flow; diff --git a/src/stream/tcp/ips_stream_reassemble.cc b/src/stream/tcp/ips_stream_reassemble.cc index b9fa496be..03ebe3cc7 100644 --- a/src/stream/tcp/ips_stream_reassemble.cc +++ b/src/stream/tcp/ips_stream_reassemble.cc @@ -21,18 +21,15 @@ #include "config.h" #endif -#include "tcp_session.h" - -#include "main/snort_config.h" -#include "stream/stream_splitter.h" +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" -#include "detection/detect.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" +#include "main/snort_config.h" #include "profiler/profiler.h" +#include "tcp_session.h" + #ifdef UNIT_TEST #include "catch/catch.hpp" #include "stream/libtcp/stream_tcp_unit_test.h" diff --git a/src/stream/tcp/ips_stream_size.cc b/src/stream/tcp/ips_stream_size.cc index aa0f58b41..a1c5109cc 100644 --- a/src/stream/tcp/ips_stream_size.cc +++ b/src/stream/tcp/ips_stream_size.cc @@ -21,16 +21,14 @@ #include "config.h" #endif -#include "tcp_session.h" +#include "detection/detection_defines.h" #include "framework/ips_option.h" #include "framework/module.h" -#include "framework/parameter.h" #include "framework/range.h" -#include "detection/detect.h" -#include "detection/detection_defines.h" #include "hash/sfhashfcn.h" -#include "profiler/profiler.h" -#include "sfip/sf_ip.h" +#include "profiler/profiler_defs.h" + +#include "tcp_session.h" //------------------------------------------------------------------------- // stream_size diff --git a/src/stream/tcp/segment_overlap_editor.cc b/src/stream/tcp/segment_overlap_editor.cc index de3178e3a..8c6e949f3 100644 --- a/src/stream/tcp/segment_overlap_editor.cc +++ b/src/stream/tcp/segment_overlap_editor.cc @@ -19,18 +19,16 @@ // segment_overlap_editor.cc author davis mcpherson // Created on: Oct 11, 2015 -#include "segment_overlap_editor.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "segment_overlap_editor.h" #include "log/messages.h" -#include "main/snort_debug.h" -#include "protocols/packet.h" #include "tcp_module.h" -#include "tcp_event_logger.h" #include "tcp_normalizer.h" -#include "tcp_reassembler.h" bool SegmentOverlapEditor::is_segment_retransmit(bool* full_retransmit) { diff --git a/src/stream/tcp/segment_overlap_editor.h b/src/stream/tcp/segment_overlap_editor.h index 91a26b707..ac7fcdca4 100644 --- a/src/stream/tcp/segment_overlap_editor.h +++ b/src/stream/tcp/segment_overlap_editor.h @@ -23,9 +23,9 @@ #define SEGMENT_OVERLAP_EDITOR_H #include "normalize/normalize.h" -#include "tcp_defs.h" -#include "tcp_segment_node.h" -#include "tcp_session.h" +#include "stream/tcp/tcp_segment_node.h" + +class TcpSession; #define STREAM_INSERT_OK 0 // FIXIT-L replace with bool diff --git a/src/stream/tcp/stream_tcp.cc b/src/stream/tcp/stream_tcp.cc index d4dd9502e..705c61d73 100644 --- a/src/stream/tcp/stream_tcp.cc +++ b/src/stream/tcp/stream_tcp.cc @@ -20,13 +20,11 @@ #include "config.h" #endif -#include +#include "stream_tcp.h" #include "main/snort_config.h" #include "stream/flush_bucket.h" -#include "stream/stream_splitter.h" -#include "stream_tcp.h" #include "tcp_ha.h" #include "tcp_module.h" #include "tcp_session.h" diff --git a/src/stream/tcp/stream_tcp.h b/src/stream/tcp/stream_tcp.h index 25ad3c8e7..d25aa7462 100644 --- a/src/stream/tcp/stream_tcp.h +++ b/src/stream/tcp/stream_tcp.h @@ -19,11 +19,10 @@ #ifndef STREAM_TCP_H #define STREAM_TCP_H -#include "flow/flow.h" -#include "protocols/packet.h" - -#include "tcp_defs.h" -#include "tcp_stream_config.h" +class Flow; +class Inspector; +class TcpStreamConfig; +class Session; // misc stuff Session* get_tcp_session(Flow*); diff --git a/src/stream/tcp/tcp_debug_trace.h b/src/stream/tcp/tcp_debug_trace.h index 4ee2aaa70..e61786a1d 100644 --- a/src/stream/tcp/tcp_debug_trace.h +++ b/src/stream/tcp/tcp_debug_trace.h @@ -22,8 +22,7 @@ #ifndef TCP_DEBUG_TRACE_H #define TCP_DEBUG_TRACE_H -#include "protocols/tcp.h" -#include "tcp_reassembler.h" +#include "stream/tcp/tcp_reassembler.h" #ifndef REG_TEST #define S5TraceTCP(pkt, flow, tsd, evt) diff --git a/src/stream/tcp/tcp_defs.h b/src/stream/tcp/tcp_defs.h index 4fd22114c..20fe0e288 100644 --- a/src/stream/tcp/tcp_defs.h +++ b/src/stream/tcp/tcp_defs.h @@ -22,8 +22,9 @@ #ifndef TCP_DEFS_H #define TCP_DEFS_H -#include "main/snort_debug.h" -#include "protocols/packet.h" +#include "main/thread.h" + +struct Packet; /* actions */ #define ACTION_NOTHING 0x00000000 diff --git a/src/stream/tcp/tcp_event_logger.cc b/src/stream/tcp/tcp_event_logger.cc index 75891ba0e..31666ed9f 100644 --- a/src/stream/tcp/tcp_event_logger.cc +++ b/src/stream/tcp/tcp_event_logger.cc @@ -19,15 +19,17 @@ // tcp_event_logger.cc author davis mcpherson // Created on: Jul 30, 2015 -#include "strings.h" -#include "main/snort_config.h" -#include "events/event_queue.h" -#include "filters/sfrf.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tcp_event_logger.h" + #include "detection/rules.h" +#include "filters/sfrf.h" +#include "main/snort_config.h" -#include "tcp_defs.h" #include "tcp_module.h" -#include "tcp_event_logger.h" #define EVENT_SYN_ON_EST 0x00000001 #define EVENT_DATA_ON_SYN 0x00000002 diff --git a/src/stream/tcp/tcp_event_logger.h b/src/stream/tcp/tcp_event_logger.h index 8abafbb4d..49caf7417 100644 --- a/src/stream/tcp/tcp_event_logger.h +++ b/src/stream/tcp/tcp_event_logger.h @@ -22,6 +22,8 @@ #ifndef TCP_EVENT_LOGGER_H #define TCP_EVENT_LOGGER_H +#include + /* events */ #define EVENT_SYN_ON_EST 0x00000001 #define EVENT_DATA_ON_SYN 0x00000002 diff --git a/src/stream/tcp/tcp_ha.cc b/src/stream/tcp/tcp_ha.cc index 6952c1699..b8d5fae66 100644 --- a/src/stream/tcp/tcp_ha.cc +++ b/src/stream/tcp/tcp_ha.cc @@ -17,10 +17,15 @@ //-------------------------------------------------------------------------- // tcp_ha.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_ha.h" #include "main/snort_debug.h" #include "stream/stream.h" + #include "tcp_session.h" Flow* TcpHA::create_session(FlowKey* key) diff --git a/src/stream/tcp/tcp_ha.h b/src/stream/tcp/tcp_ha.h index b470957a2..47193a9a5 100644 --- a/src/stream/tcp/tcp_ha.h +++ b/src/stream/tcp/tcp_ha.h @@ -20,7 +20,6 @@ #ifndef TCP_HA_H #define TCP_HA_H -#include "main/snort_types.h" #include "stream/base/stream_ha.h" //------------------------------------------------------------------------- diff --git a/src/stream/tcp/tcp_module.cc b/src/stream/tcp/tcp_module.cc index 3c516a1e3..8efed6742 100644 --- a/src/stream/tcp/tcp_module.cc +++ b/src/stream/tcp/tcp_module.cc @@ -18,13 +18,13 @@ // tcp_module.cc author Russ Combs -#include "tcp_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "tcp_module.h" -#include "profiler/profiler.h" -#include "stream/stream.h" -#include "stream_tcp.h" +#include "profiler/profiler_defs.h" using namespace std; diff --git a/src/stream/tcp/tcp_module.h b/src/stream/tcp/tcp_module.h index a55dde178..06b28e00c 100644 --- a/src/stream/tcp/tcp_module.h +++ b/src/stream/tcp/tcp_module.h @@ -21,14 +21,9 @@ #ifndef TCP_MODULE_H #define TCP_MODULE_H -#include -#include - -#include "main/snort_types.h" -#include "main/thread.h" #include "flow/session.h" #include "framework/module.h" -#include "tcp_stream_config.h" +#include "stream/tcp/tcp_stream_config.h" #define GID_STREAM_TCP 129 diff --git a/src/stream/tcp/tcp_normalizer.cc b/src/stream/tcp/tcp_normalizer.cc index 54bbcf542..1391af265 100644 --- a/src/stream/tcp/tcp_normalizer.cc +++ b/src/stream/tcp/tcp_normalizer.cc @@ -19,10 +19,14 @@ // tcp_normalization.cc author davis mcpherson // Created on: Jul 31, 2015 -#include "packet_io/active.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "tcp_normalizer.h" -#include "tcp_event_logger.h" + +#include "main/snort_debug.h" +#include "packet_io/active.h" THREAD_LOCAL PegCount tcp_norm_stats[PC_TCP_MAX][NORM_MODE_MAX]; diff --git a/src/stream/tcp/tcp_normalizer.h b/src/stream/tcp/tcp_normalizer.h index 9d9b294f6..bf4683b5f 100644 --- a/src/stream/tcp/tcp_normalizer.h +++ b/src/stream/tcp/tcp_normalizer.h @@ -22,13 +22,9 @@ #ifndef TCP_NORMALIZER_H #define TCP_NORMALIZER_H -#include "main/snort_types.h" -#include "framework/counts.h" -#include "protocols/tcp_options.h" -#include "protocols/tcp.h" #include "normalize/normalize.h" -#include "tcp_session.h" -#include "tcp_defs.h" +#include "protocols/tcp_options.h" +#include "stream/tcp/tcp_session.h" enum TcpPegCounts { diff --git a/src/stream/tcp/tcp_normalizers.cc b/src/stream/tcp/tcp_normalizers.cc index 9c10c728c..c8c260bda 100644 --- a/src/stream/tcp/tcp_normalizers.cc +++ b/src/stream/tcp/tcp_normalizers.cc @@ -19,10 +19,14 @@ // tcp_normalizers.cc author davis mcpherson // Created on: Sep 22, 2015 -#include "tcp_defs.h" -#include "tcp_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_normalizers.h" +#include "tcp_module.h" + class TcpNormalizerFirst : public TcpNormalizer { public: diff --git a/src/stream/tcp/tcp_normalizers.h b/src/stream/tcp/tcp_normalizers.h index dad5e9ba3..1fcf085f9 100644 --- a/src/stream/tcp/tcp_normalizers.h +++ b/src/stream/tcp/tcp_normalizers.h @@ -22,8 +22,7 @@ #ifndef TCP_NORMALIZERS_H #define TCP_NORMALIZERS_H -#include "tcp_defs.h" -#include "tcp_normalizer.h" +#include "stream/tcp/tcp_normalizer.h" class TcpNormalizerFactory { diff --git a/src/stream/tcp/tcp_reassembler.cc b/src/stream/tcp/tcp_reassembler.cc index 4bd0acb16..93471bfb8 100644 --- a/src/stream/tcp/tcp_reassembler.cc +++ b/src/stream/tcp/tcp_reassembler.cc @@ -16,27 +16,22 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -// tcp_reassembly.cc author davis mcpherson +// tcp_reassember.cc author davis mcpherson // Created on: Jul 31, 2015 #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include +#include "tcp_reassembler.h" +#include "log/log.h" #include "main/snort.h" -#include "protocols/packet.h" -#include "protocols/packet_manager.h" #include "profiler/profiler.h" -#include "flow/flow_control.h" +#include "protocols/packet_manager.h" #include "tcp_module.h" -#include "tcp_session.h" -#include "tcp_event_logger.h" #include "tcp_normalizer.h" -#include "tcp_reassembler.h" THREAD_LOCAL Packet* s5_pkt = nullptr; diff --git a/src/stream/tcp/tcp_reassembler.h b/src/stream/tcp/tcp_reassembler.h index 24c498570..837fd1f42 100644 --- a/src/stream/tcp/tcp_reassembler.h +++ b/src/stream/tcp/tcp_reassembler.h @@ -22,13 +22,8 @@ #ifndef TCP_REASSEMBLER_H #define TCP_REASSEMBLER_H -#include "framework/counts.h" -#include "detection/detect.h" -#include "normalize/normalize.h" - -#include "segment_overlap_editor.h" -#include "tcp_defs.h" -#include "tcp_segment_node.h" +#include "stream/stream.h" +#include "stream/tcp/segment_overlap_editor.h" class TcpSession; class TcpStreamTracker; diff --git a/src/stream/tcp/tcp_reassemblers.cc b/src/stream/tcp/tcp_reassemblers.cc index 11166c3c7..e6037e852 100644 --- a/src/stream/tcp/tcp_reassemblers.cc +++ b/src/stream/tcp/tcp_reassemblers.cc @@ -19,9 +19,10 @@ // tcp_reassemblers.cc author davis mcpherson // Created on: Oct 9, 2015 -#include "tcp_module.h" -#include "tcp_event_logger.h" -#include "tcp_session.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_reassemblers.h" class TcpReassemblerFirst : public TcpReassembler diff --git a/src/stream/tcp/tcp_reassemblers.h b/src/stream/tcp/tcp_reassemblers.h index 95c5e7764..8c2882276 100644 --- a/src/stream/tcp/tcp_reassemblers.h +++ b/src/stream/tcp/tcp_reassemblers.h @@ -22,8 +22,7 @@ #ifndef TCP_REASSEMBLERS_H #define TCP_REASSEMBLERS_H -#include "tcp_defs.h" -#include "tcp_reassembler.h" +#include "stream/tcp/tcp_reassembler.h" class TcpReassemblerFactory { diff --git a/src/stream/tcp/tcp_segment_node.cc b/src/stream/tcp/tcp_segment_node.cc index c1706a6fd..000d5915b 100644 --- a/src/stream/tcp/tcp_segment_node.cc +++ b/src/stream/tcp/tcp_segment_node.cc @@ -19,11 +19,14 @@ // tcp_segment.cc author davis mcpherson // Created on: Sep 21, 2015 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_segment_node.h" -#include "flow/flow_control.h" -#include "protocols/packet.h" #include "utils/util.h" + #include "tcp_module.h" // FIXIT-P this is going to set each member 2X; once here and once in init diff --git a/src/stream/tcp/tcp_segment_node.h b/src/stream/tcp/tcp_segment_node.h index d48fc68a5..ef673cd37 100644 --- a/src/stream/tcp/tcp_segment_node.h +++ b/src/stream/tcp/tcp_segment_node.h @@ -23,10 +23,8 @@ #define TCP_SEGMENT_H #include "main/snort_debug.h" -#include "protocols/packet.h" - -#include "tcp_defs.h" #include "stream/libtcp/tcp_segment_descriptor.h" +#include "stream/tcp/tcp_defs.h" //----------------------------------------------------------------- // we make a lot of TcpSegments so it is organized by member diff --git a/src/stream/tcp/tcp_session.cc b/src/stream/tcp/tcp_session.cc index cde50483d..6541e3ae6 100644 --- a/src/stream/tcp/tcp_session.cc +++ b/src/stream/tcp/tcp_session.cc @@ -46,45 +46,20 @@ #include "config.h" #endif -#include -#include - -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "main/snort_config.h" -#include "detection/detect.h" -#include "detection/detection_util.h" -#include "hash/sfxhash.h" -#include "utils/util.h" -#include "utils/util_net.h" -#include "utils/sflsq.h" -#include "time/packet_time.h" +#include "tcp_session.h" + +#include "log/log.h" #include "perf_monitor/flow_ip_tracker.h" -#include "sfip/sf_ip.h" -#include "protocols/packet.h" -#include "protocols/packet_manager.h" -#include "protocols/tcp_options.h" -#include "protocols/tcp.h" -#include "protocols/eth.h" -#include "log/log_text.h" -#include "stream/stream.h" -#include "stream/stream_splitter.h" -#include "flow/session.h" #include "profiler/profiler.h" -#include "file_api/file_api.h" -#include "perf_monitor/flow_tracker.h" -#include "filters/sfrf.h" +#include "protocols/eth.h" -#include "stream/paf.h" #include "stream_tcp.h" +#include "tcp_debug_trace.h" #include "tcp_ha.h" #include "tcp_module.h" -#include "tcp_event_logger.h" -#include "tcp_debug_trace.h" #include "tcp_normalizers.h" #include "tcp_reassemblers.h" #include "tcp_stream_state_machine.h" -#include "tcp_session.h" DEBUG_WRAP(const char* t_name = NULL; const char* l_name = NULL; ) diff --git a/src/stream/tcp/tcp_session.h b/src/stream/tcp/tcp_session.h index fe758f6f6..319b7732a 100644 --- a/src/stream/tcp/tcp_session.h +++ b/src/stream/tcp/tcp_session.h @@ -20,18 +20,9 @@ #ifndef TCP_SESSION_H #define TCP_SESSION_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "detection/detect.h" - #include "stream/libtcp/tcp_stream_session.h" #include "stream/libtcp/tcp_state_machine.h" -#include "stream_tcp.h" -#include "tcp_defs.h" -#include "tcp_stream_config.h" -#include "tcp_tracker.h" +#include "stream/tcp/tcp_tracker.h" class TcpEventLogger; diff --git a/src/stream/tcp/tcp_state_close_wait.cc b/src/stream/tcp/tcp_state_close_wait.cc index e71153303..e104750c5 100644 --- a/src/stream/tcp/tcp_state_close_wait.cc +++ b/src/stream/tcp/tcp_state_close_wait.cc @@ -19,14 +19,17 @@ // tcp_state_close_wait.cc author davis mcpherson // Created on: Aug 5, 2015 -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" #include "tcp_state_close_wait.h" +#include "main/snort_debug.h" + +#include "tcp_normalizer.h" +#include "tcp_session.h" + #ifdef UNIT_TEST #include "catch/catch.hpp" #endif diff --git a/src/stream/tcp/tcp_state_closed.cc b/src/stream/tcp/tcp_state_closed.cc index 69dc5b648..0b0a8d292 100644 --- a/src/stream/tcp/tcp_state_closed.cc +++ b/src/stream/tcp/tcp_state_closed.cc @@ -19,16 +19,16 @@ // tcp_state_closed.cc author davis mcpherson // Created on: Jul 30, 2015 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_state_closed.h" -#include "tcp_module.h" -#include "tcp_tracker.h" #include "tcp_session.h" -#include "tcp_normalizer.h" #ifdef UNIT_TEST #include "catch/catch.hpp" -#include "stream/libtcp/stream_tcp_unit_test.h" #endif TcpStateClosed::TcpStateClosed(TcpStateMachine& tsm) : diff --git a/src/stream/tcp/tcp_state_closing.cc b/src/stream/tcp/tcp_state_closing.cc index e5ecf2233..066b43403 100644 --- a/src/stream/tcp/tcp_state_closing.cc +++ b/src/stream/tcp/tcp_state_closing.cc @@ -19,14 +19,17 @@ // tcp_state_closing.cc author davis mcpherson // Created on: Aug 5, 2015 -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" #include "tcp_state_closing.h" +#include "main/snort_debug.h" + +#include "tcp_normalizer.h" +#include "tcp_session.h" + #ifdef UNIT_TEST #include "catch/catch.hpp" #endif diff --git a/src/stream/tcp/tcp_state_established.cc b/src/stream/tcp/tcp_state_established.cc index 4737cf978..2f1748474 100644 --- a/src/stream/tcp/tcp_state_established.cc +++ b/src/stream/tcp/tcp_state_established.cc @@ -19,12 +19,15 @@ // tcp_state_established.cc author davis mcpherson // Created on: Jul 30, 2015 -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_state_established.h" +#include "tcp_normalizer.h" +#include "tcp_session.h" + TcpStateEstablished::TcpStateEstablished(TcpStateMachine& tsm) : TcpStateHandler(TcpStreamTracker::TCP_ESTABLISHED, tsm) { diff --git a/src/stream/tcp/tcp_state_fin_wait1.cc b/src/stream/tcp/tcp_state_fin_wait1.cc index 36eb424f2..51b33abbf 100644 --- a/src/stream/tcp/tcp_state_fin_wait1.cc +++ b/src/stream/tcp/tcp_state_fin_wait1.cc @@ -19,17 +19,17 @@ // tcp_state_fin_wait1.cc author davis mcpherson // Created on: Aug 5, 2015 -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" #include "tcp_state_fin_wait1.h" -#ifdef UNIT_TEST -#include "catch/catch.hpp" -#endif +#include "main/snort_debug.h" + +#include "tcp_normalizer.h" +#include "tcp_module.h" +#include "tcp_session.h" using namespace std; diff --git a/src/stream/tcp/tcp_state_fin_wait2.cc b/src/stream/tcp/tcp_state_fin_wait2.cc index 30edca40b..e0013251b 100644 --- a/src/stream/tcp/tcp_state_fin_wait2.cc +++ b/src/stream/tcp/tcp_state_fin_wait2.cc @@ -19,17 +19,14 @@ // tcp_state_fin_wait2.cc author davis mcpherson // Created on: Aug 5, 2015 -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" #include "tcp_state_fin_wait2.h" -#ifdef UNIT_TEST -#include "catch/catch.hpp" -#endif +#include "tcp_normalizer.h" +#include "tcp_session.h" using namespace std; diff --git a/src/stream/tcp/tcp_state_last_ack.cc b/src/stream/tcp/tcp_state_last_ack.cc index 59559ed20..b3c205a90 100644 --- a/src/stream/tcp/tcp_state_last_ack.cc +++ b/src/stream/tcp/tcp_state_last_ack.cc @@ -19,17 +19,14 @@ // tcp_state_last_ack.cc author davis mcpherson // Created on: Aug 5, 2015 -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" #include "tcp_state_last_ack.h" -#ifdef UNIT_TEST -#include "catch/catch.hpp" -#endif +#include "tcp_normalizer.h" +#include "tcp_session.h" using namespace std; diff --git a/src/stream/tcp/tcp_state_listen.cc b/src/stream/tcp/tcp_state_listen.cc index c52e6ce4c..db37c4c7c 100644 --- a/src/stream/tcp/tcp_state_listen.cc +++ b/src/stream/tcp/tcp_state_listen.cc @@ -19,12 +19,15 @@ // tcp_state_listen.cc author davis mcpherson // Created on: Jul 30, 2015 -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_state_listen.h" +#include "tcp_normalizer.h" +#include "tcp_session.h" + TcpStateListen::TcpStateListen(TcpStateMachine& tsm) : TcpStateHandler(TcpStreamTracker::TCP_LISTEN, tsm) { diff --git a/src/stream/tcp/tcp_state_none.cc b/src/stream/tcp/tcp_state_none.cc index b35acb546..5bdf72edc 100644 --- a/src/stream/tcp/tcp_state_none.cc +++ b/src/stream/tcp/tcp_state_none.cc @@ -19,17 +19,14 @@ // tcp_state_none.cc author davis mcpherson // Created on: Jul 30, 2015 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_state_none.h" -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" #include "tcp_normalizer.h" - -#ifdef UNIT_TEST -#include "catch/catch.hpp" -#include "stream/libtcp/stream_tcp_unit_test.h" -#endif +#include "tcp_session.h" TcpStateNone::TcpStateNone(TcpStateMachine& tsm) : TcpStateHandler(TcpStreamTracker::TCP_STATE_NONE, tsm) diff --git a/src/stream/tcp/tcp_state_syn_recv.cc b/src/stream/tcp/tcp_state_syn_recv.cc index f71e90819..e3646db27 100644 --- a/src/stream/tcp/tcp_state_syn_recv.cc +++ b/src/stream/tcp/tcp_state_syn_recv.cc @@ -19,13 +19,15 @@ // tcp_state_syn_recv.cc author davis mcpherson // Created on: Aug 5, 2015 -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tcp_state_syn_recv.h" #include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" #include "tcp_normalizer.h" -#include "tcp_state_syn_recv.h" +#include "tcp_session.h" using namespace std; diff --git a/src/stream/tcp/tcp_state_syn_sent.cc b/src/stream/tcp/tcp_state_syn_sent.cc index 4a1e04064..a0e475fd2 100644 --- a/src/stream/tcp/tcp_state_syn_sent.cc +++ b/src/stream/tcp/tcp_state_syn_sent.cc @@ -19,17 +19,13 @@ // tcp_state_syn_sent.cc author davis mcpherson // Created on: Aug 5, 2015 -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" #include "tcp_state_syn_sent.h" -#ifdef UNIT_TEST -#include "catch/catch.hpp" -#endif +#include "tcp_session.h" using namespace std; diff --git a/src/stream/tcp/tcp_state_time_wait.cc b/src/stream/tcp/tcp_state_time_wait.cc index 241489db5..9a9536928 100644 --- a/src/stream/tcp/tcp_state_time_wait.cc +++ b/src/stream/tcp/tcp_state_time_wait.cc @@ -19,17 +19,16 @@ // tcp_state_time_wait.cc author davis mcpherson // Created on: Aug 5, 2015 -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include "tcp_module.h" -#include "tcp_tracker.h" -#include "tcp_session.h" -#include "tcp_normalizer.h" #include "tcp_state_time_wait.h" -#ifdef UNIT_TEST -#include "catch/catch.hpp" -#endif +#include "main/snort_debug.h" + +#include "tcp_normalizer.h" +#include "tcp_session.h" using namespace std; diff --git a/src/stream/tcp/tcp_stream_config.cc b/src/stream/tcp/tcp_stream_config.cc index 7c77b854a..822e2dde5 100644 --- a/src/stream/tcp/tcp_stream_config.cc +++ b/src/stream/tcp/tcp_stream_config.cc @@ -19,10 +19,14 @@ // tcp_stream_config.cc author davis mcpherson // Created on: Oct 22, 2015 -#include "log/messages.h" -#include "main/snort_config.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_stream_config.h" +#include "log/messages.h" + static const char* const reassembly_policy_names[] = { "no policy", "first", "last", "linux", "old_linux", "bsd", "macos", "solaris", "irix", "hpux11", "hpux10", "windows", "win_2003", "vista", "proxy" }; diff --git a/src/stream/tcp/tcp_stream_config.h b/src/stream/tcp/tcp_stream_config.h index 3727251ea..d146b5ac6 100644 --- a/src/stream/tcp/tcp_stream_config.h +++ b/src/stream/tcp/tcp_stream_config.h @@ -22,8 +22,9 @@ #ifndef TCP_STREAM_CONFIG_H #define TCP_STREAM_CONFIG_H +#include "protocols/packet.h" +#include "stream/tcp/tcp_defs.h" #include "time/packet_time.h" -#include "tcp_defs.h" #define STREAM_CONFIG_STATEFUL_INSPECTION 0x00000001 #define STREAM_CONFIG_LOG_STREAMS 0x00000004 diff --git a/src/stream/tcp/tcp_stream_state_machine.cc b/src/stream/tcp/tcp_stream_state_machine.cc index 7a7f89ebd..341fc11ad 100644 --- a/src/stream/tcp/tcp_stream_state_machine.cc +++ b/src/stream/tcp/tcp_stream_state_machine.cc @@ -19,6 +19,12 @@ // tcp_stream_state_machine.cc author davis mcpherson // Created on: Apr 1, 2016 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tcp_stream_state_machine.h" + #include "tcp_state_none.h" #include "tcp_state_closed.h" #include "tcp_state_listen.h" @@ -32,8 +38,6 @@ #include "tcp_state_last_ack.h" #include "tcp_state_time_wait.h" -#include "tcp_stream_state_machine.h" - TcpStreamStateMachine::TcpStreamStateMachine() { // initialize stream tracker state machine with handler for each state... diff --git a/src/stream/tcp/tcp_tracker.cc b/src/stream/tcp/tcp_tracker.cc index 107f40eaf..de99449dc 100644 --- a/src/stream/tcp/tcp_tracker.cc +++ b/src/stream/tcp/tcp_tracker.cc @@ -19,14 +19,18 @@ // tcp_tracker.cc author davis mcpherson // Created on: Dec 1, 2015 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "tcp_tracker.h" #include "log/messages.h" #include "profiler/profiler_defs.h" + #include "tcp_module.h" -#include "tcp_normalizers.h" -#include "tcp_reassemblers.h" -#include "tcp_session.h" +#include "tcp_normalizer.h" +#include "tcp_reassembler.h" TcpTracker::TcpTracker(bool client, TcpSession* ssn) : TcpStreamTracker(client) diff --git a/src/stream/tcp/tcp_tracker.h b/src/stream/tcp/tcp_tracker.h index 81b4ba790..6d571e27c 100644 --- a/src/stream/tcp/tcp_tracker.h +++ b/src/stream/tcp/tcp_tracker.h @@ -23,7 +23,6 @@ #define TCP_TRACKER_H_ #include "stream/libtcp/tcp_stream_tracker.h" -#include "tcp_defs.h" //------------------------------------------------------------------------- // extra, extra - read all about it! diff --git a/src/stream/tcp/test/tcp_normalizer_test.cc b/src/stream/tcp/test/tcp_normalizer_test.cc index 2259c8114..d3ed70b98 100644 --- a/src/stream/tcp/test/tcp_normalizer_test.cc +++ b/src/stream/tcp/test/tcp_normalizer_test.cc @@ -19,6 +19,10 @@ // tcp_normalizer_test.cc author Davis McPherson // unit test main +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "stream/tcp/tcp_module.h" #include "stream/tcp/tcp_normalizers.h" #include "protocols/tcp_options.h" diff --git a/src/stream/udp/stream_udp.cc b/src/stream/udp/stream_udp.cc index 0020bef19..a5d1f85e5 100644 --- a/src/stream/udp/stream_udp.cc +++ b/src/stream/udp/stream_udp.cc @@ -20,14 +20,13 @@ #include "config.h" #endif -#include - #include "stream_udp.h" -#include "udp_module.h" -#include "udp_ha.h" -#include "stream/udp/udp_session.h" + #include "log/messages.h" -#include "protocols/packet.h" + +#include "udp_ha.h" +#include "udp_module.h" +#include "udp_session.h" //------------------------------------------------------------------------- // helpers diff --git a/src/stream/udp/stream_udp.h b/src/stream/udp/stream_udp.h index 259716751..2fc82bf51 100644 --- a/src/stream/udp/stream_udp.h +++ b/src/stream/udp/stream_udp.h @@ -19,7 +19,9 @@ #ifndef STREAM_UDP_H #define STREAM_UDP_H -#include "flow/flow.h" +#include + +class Inspector; struct StreamUdpConfig { diff --git a/src/stream/udp/udp_ha.cc b/src/stream/udp/udp_ha.cc index 815278a38..3bf7f2b0d 100644 --- a/src/stream/udp/udp_ha.cc +++ b/src/stream/udp/udp_ha.cc @@ -17,10 +17,14 @@ //-------------------------------------------------------------------------- // udp_ha.cc author Ed Borgoyn +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "udp_ha.h" -#include "main/snort_debug.h" #include "stream/stream.h" + #include "udp_session.h" Flow* UdpHA::create_session(FlowKey* key) diff --git a/src/stream/udp/udp_ha.h b/src/stream/udp/udp_ha.h index d7578871e..07a8aa559 100644 --- a/src/stream/udp/udp_ha.h +++ b/src/stream/udp/udp_ha.h @@ -20,7 +20,6 @@ #ifndef UDP_HA_H #define UDP_HA_H -#include "main/snort_types.h" #include "stream/base/stream_ha.h" //------------------------------------------------------------------------- diff --git a/src/stream/udp/udp_module.cc b/src/stream/udp/udp_module.cc index 0d0247c6b..0fef17bdf 100644 --- a/src/stream/udp/udp_module.cc +++ b/src/stream/udp/udp_module.cc @@ -18,9 +18,11 @@ // udp_module.cc author Russ Combs -#include "udp_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "udp_module.h" #include "stream_udp.h" diff --git a/src/stream/udp/udp_module.h b/src/stream/udp/udp_module.h index d3dce14fb..910edfe9c 100644 --- a/src/stream/udp/udp_module.h +++ b/src/stream/udp/udp_module.h @@ -21,11 +21,6 @@ #ifndef UDP_MODULE_H #define UDP_MODULE_H -#include -#include - -#include "main/snort_types.h" -#include "main/thread.h" #include "flow/session.h" #include "framework/module.h" diff --git a/src/stream/udp/udp_session.cc b/src/stream/udp/udp_session.cc index ead652715..6493004ee 100644 --- a/src/stream/udp/udp_session.cc +++ b/src/stream/udp/udp_session.cc @@ -17,31 +17,20 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "udp_session.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "stream/stream.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" -#include "detection/detect.h" -#include "detection/rules.h" -#include "detection/treenodes.h" -#include "hash/sfxhash.h" -#include "utils/util.h" -#include "protocols/packet.h" +#include "udp_session.h" + #include "flow/session.h" -#include "packet_io/active.h" #include "perf_monitor/flow_ip_tracker.h" -#include "profiler/profiler.h" -#include "sfip/sf_ip.h" -#include "stream/stream.h" +#include "profiler/profiler_defs.h" +#include "protocols/packet.h" -#include "stream_udp.h" -#include "udp_module.h" #include "udp_ha.h" +#include "udp_module.h" +#include "stream_udp.h" // NOTE: sender is assumed to be client // responder is assumed to be server diff --git a/src/stream/udp/udp_session.h b/src/stream/udp/udp_session.h index eeb670e16..025370c8e 100644 --- a/src/stream/udp/udp_session.h +++ b/src/stream/udp/udp_session.h @@ -20,7 +20,6 @@ #ifndef UDP_SESSION_H #define UDP_SESSION_H -#include #include "flow/session.h" class UdpSession : public Session diff --git a/src/stream/user/stream_user.cc b/src/stream/user/stream_user.cc index 1d4592b8a..813af2fd2 100644 --- a/src/stream/user/stream_user.cc +++ b/src/stream/user/stream_user.cc @@ -17,18 +17,16 @@ //-------------------------------------------------------------------------- // stream_user.cc author Russ Combs -#include "stream_user.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "stream_user.h" + +#include "log/messages.h" #include "user_module.h" #include "user_session.h" -#include "log/messages.h" -#include "protocols/packet.h" //------------------------------------------------------------------------- // helpers diff --git a/src/stream/user/stream_user.h b/src/stream/user/stream_user.h index bb12eb25b..6c6ad0726 100644 --- a/src/stream/user/stream_user.h +++ b/src/stream/user/stream_user.h @@ -20,7 +20,9 @@ #ifndef STREAM_USER_H #define STREAM_USER_H -#include "flow/flow.h" +#include + +class Inspector; struct StreamUserConfig { diff --git a/src/stream/user/user_module.cc b/src/stream/user/user_module.cc index 673531f6c..ec0f5ed70 100644 --- a/src/stream/user/user_module.cc +++ b/src/stream/user/user_module.cc @@ -17,12 +17,13 @@ //-------------------------------------------------------------------------- // user_module.cc author Russ Combs -#include "user_module.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include "user_module.h" #include "stream_user.h" -#include "main/snort_config.h" using namespace std; diff --git a/src/stream/user/user_module.h b/src/stream/user/user_module.h index 8c0cfa7f0..6c8cdc09e 100644 --- a/src/stream/user/user_module.h +++ b/src/stream/user/user_module.h @@ -20,11 +20,7 @@ #ifndef USER_MODULE_H #define USER_MODULE_H -#include "main/snort_debug.h" -#include "main/snort_types.h" -#include "main/thread.h" #include "framework/module.h" -#include "stream/stream.h" struct SnortConfig; diff --git a/src/stream/user/user_session.cc b/src/stream/user/user_session.cc index d4b3792f2..362ad1c3b 100644 --- a/src/stream/user/user_session.cc +++ b/src/stream/user/user_session.cc @@ -17,22 +17,17 @@ //-------------------------------------------------------------------------- // user_session.cc author Russ Combs -#include "user_session.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "user_session.h" + #include "main/snort.h" -#include "perf_monitor/perf_monitor.h" -#include "profiler/profiler.h" -#include "sfip/sf_ip.h" +#include "profiler/profiler_defs.h" +#include "protocols/packet.h" #include "utils/util.h" -#include "stream/stream.h" -#include "stream/stream_splitter.h" -#include "stream/paf.h" - #include "stream_user.h" #include "user_module.h" diff --git a/src/stream/user/user_session.h b/src/stream/user/user_session.h index c6300dca2..1047da108 100644 --- a/src/stream/user/user_session.h +++ b/src/stream/user/user_session.h @@ -20,7 +20,6 @@ #ifndef USER_SESSION_H #define USER_SESSION_H -#include #include #include "flow/session.h" diff --git a/src/target_based/sftarget_hostentry.cc b/src/target_based/sftarget_hostentry.cc index 1f5f71309..1b61240a7 100644 --- a/src/target_based/sftarget_hostentry.cc +++ b/src/target_based/sftarget_hostentry.cc @@ -19,6 +19,10 @@ // sftarget_hostentry.c author Steven Sturges +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sftarget_hostentry.h" #if 0 diff --git a/src/target_based/sftarget_hostentry.h b/src/target_based/sftarget_hostentry.h index 614b2ec77..385ea9555 100644 --- a/src/target_based/sftarget_hostentry.h +++ b/src/target_based/sftarget_hostentry.h @@ -23,7 +23,6 @@ #define SFTARGET_HOSTENTRY_H #include "target_based/sftarget_reader.h" -#include "target_based/sftarget_data.h" /* API for HostAttributeEntry 'class' */ diff --git a/src/target_based/sftarget_reader.cc b/src/target_based/sftarget_reader.cc index 4fbc7a2a1..7297853ae 100644 --- a/src/target_based/sftarget_reader.cc +++ b/src/target_based/sftarget_reader.cc @@ -22,36 +22,19 @@ * sftarget_reader.c */ -#include "sftarget_reader.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include - -#include "snort_protocols.h" -#include "sftarget_hostentry.h" -#include "sftarget_data.h" +#include "sftarget_reader.h" -#include "hash/sfxhash.h" #include "log/messages.h" #include "main/snort_config.h" #include "main/snort_debug.h" -#include "parser/parser.h" #include "protocols/packet.h" +#include "sfrt/sfrt.h" #include "utils/stats.h" #include "utils/util.h" -#include "utils/util_net.h" -#include "sfip/sf_ip.h" -#include "sfrt/sfrt.h" #define ATTRIBUTE_MAP_MAX_ROWS 1024 diff --git a/src/target_based/snort_protocols.cc b/src/target_based/snort_protocols.cc index f4991ece2..a945227bb 100644 --- a/src/target_based/snort_protocols.cc +++ b/src/target_based/snort_protocols.cc @@ -19,21 +19,20 @@ // snort_protocols.cc derived from sftarget_protocol_reference.c by Steven Sturges +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "snort_protocols.h" #include -#include -#include #include "hash/sfghash.h" #include "log/messages.h" -#include "main/snort_config.h" #include "main/snort_debug.h" -#include "stream/stream.h" +#include "protocols/packet.h" #include "utils/util.h" -#include "sftarget_reader.h" -#include "sftarget_hostentry.h" #include "sftarget_data.h" using namespace std; diff --git a/src/target_based/snort_protocols.h b/src/target_based/snort_protocols.h index 36ba3adb7..9a7fc4db1 100644 --- a/src/target_based/snort_protocols.h +++ b/src/target_based/snort_protocols.h @@ -25,7 +25,6 @@ #include #include -#include "main/snort_config.h" #include "main/snort_types.h" // FIXIT-L use logical type instead of int16_t diff --git a/src/time/clock_defs.h b/src/time/clock_defs.h index 01881f6e8..a217e352b 100644 --- a/src/time/clock_defs.h +++ b/src/time/clock_defs.h @@ -20,10 +20,6 @@ #ifndef CLOCK_DEFS_H #define CLOCK_DEFS_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef USE_TSC_CLOCK #include "time/tsc_clock.h" using SnortClock = TscClock; diff --git a/src/time/packet_time.cc b/src/time/packet_time.cc index bf89dde2e..69d7d22af 100644 --- a/src/time/packet_time.cc +++ b/src/time/packet_time.cc @@ -29,9 +29,14 @@ * or use the packet time. I choose the latter. */ -#include "time/packet_time.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "main/thread.h" +#include "packet_time.h" + static THREAD_LOCAL struct timeval s_recent_packet = { 0, 0 }; static THREAD_LOCAL uint32_t s_first_packet = 0; diff --git a/src/time/packet_time.h b/src/time/packet_time.h index 03df40d8a..0d9893921 100644 --- a/src/time/packet_time.h +++ b/src/time/packet_time.h @@ -21,7 +21,6 @@ #define PACKET_TIME_H #include -#include #include "main/snort_types.h" diff --git a/src/time/periodic.cc b/src/time/periodic.cc index b2f9950ff..dcc8dd8c8 100644 --- a/src/time/periodic.cc +++ b/src/time/periodic.cc @@ -17,6 +17,10 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "periodic.h" #include diff --git a/src/time/periodic.h b/src/time/periodic.h index 2129aceb4..6e81d3239 100644 --- a/src/time/periodic.h +++ b/src/time/periodic.h @@ -20,7 +20,7 @@ #ifndef PERIODIC_H #define PERIODIC_H -#include "main/snort_types.h" +#include using PeriodicHook = void (*)(void*); diff --git a/src/time/stopwatch_test.cc b/src/time/stopwatch_test.cc index a183d4473..eb50bffdd 100644 --- a/src/time/stopwatch_test.cc +++ b/src/time/stopwatch_test.cc @@ -18,6 +18,10 @@ // stopwatch_test.cc author Joel Cornett +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "catch/catch.hpp" #include "catch/unit_test.h" diff --git a/src/time/tsc_clock.cc b/src/time/tsc_clock.cc index 150d0158e..f2d3cd0f9 100644 --- a/src/time/tsc_clock.cc +++ b/src/time/tsc_clock.cc @@ -17,13 +17,13 @@ //-------------------------------------------------------------------------- // tsc_clock.cc author Russ Combs -#include "tsc_clock.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "tsc_clock.h" + +#include long clock_scale() { diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index e668423d7..f7ca40c2f 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -10,14 +10,12 @@ endif ( BUILD_SNPRINTF ) set( UTIL_INCLUDES bitop.h cpp_macros.h - dnet_header.h kmap.h safec.h segment_mem.h sflsq.h sfmemcap.h sfsnprintfappend.h - snort_bounds.h stats.h util.h util_jsnorm.h @@ -34,6 +32,7 @@ ADD_LIBRARY( utils STATIC ${SNPRINTF_SOURCES} boyer_moore.cc boyer_moore.h + dnet_header.h dyn_array.cc dyn_array.h kmap.cc @@ -41,6 +40,7 @@ ADD_LIBRARY( utils STATIC sflsq.cc sfmemcap.cc sfsnprintfappend.cc + snort_bounds.h stats.cc util.cc util_jsnorm.cc diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 91310aae3..2ba151f62 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -6,14 +6,12 @@ x_includedir = $(pkgincludedir)/utils x_include_HEADERS = \ bitop.h \ cpp_macros.h \ -dnet_header.h \ kmap.h \ safec.h \ segment_mem.h \ sflsq.h \ sfmemcap.h \ sfsnprintfappend.h \ -snort_bounds.h \ stats.h \ util.h \ util_jsnorm.h \ @@ -22,6 +20,7 @@ util_utf.h libutils_a_SOURCES = \ boyer_moore.cc boyer_moore.h \ +dnet_header.h \ dyn_array.cc dyn_array.h \ kmap.cc \ segment_mem.cc \ diff --git a/src/utils/bitop_test.cc b/src/utils/bitop_test.cc index 2359f162f..7dc0c9959 100644 --- a/src/utils/bitop_test.cc +++ b/src/utils/bitop_test.cc @@ -1,3 +1,7 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "catch/catch.hpp" #include "catch/unit_test.h" diff --git a/src/utils/boyer_moore.cc b/src/utils/boyer_moore.cc index ea4485081..47d54efdf 100644 --- a/src/utils/boyer_moore.cc +++ b/src/utils/boyer_moore.cc @@ -40,21 +40,16 @@ * 07/24/01 MFR Fixed Regex pattern matcher introduced by Fyodor * **************************************************************************/ -#include "boyer_moore.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include +#include "boyer_moore.h" -#include "main/snort_types.h" #include "main/snort_debug.h" -#include "utils/util.h" + +#include "util.h" /**************************************************************** * diff --git a/src/utils/dnet_header.h b/src/utils/dnet_header.h index f2766ffdf..987d05136 100644 --- a/src/utils/dnet_header.h +++ b/src/utils/dnet_header.h @@ -23,10 +23,6 @@ // Provide the correct dnet interface -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc99-extensions" diff --git a/src/utils/dyn_array.cc b/src/utils/dyn_array.cc index ebf1d83eb..9c1398de3 100644 --- a/src/utils/dyn_array.cc +++ b/src/utils/dyn_array.cc @@ -17,15 +17,13 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "dyn_array.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "dyn_array.h" -#include "main/snort_debug.h" -#include "sfrt/sfrt.h" -#include "utils/util.h" +#include "util.h" // number of additional policies allocated with each re-alloc operation #define POLICY_ALLOCATION_CHUNK 10 diff --git a/src/utils/kmap.cc b/src/utils/kmap.cc index 1e3ea539d..50a7a3c16 100644 --- a/src/utils/kmap.cc +++ b/src/utils/kmap.cc @@ -20,20 +20,16 @@ // kmap.cc author Marc Norton // a generic map library - maps key + data pairs -#include "kmap.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "kmap.h" + #include -#include -#include -#include -#include +#include -#include "utils/util.h" +#include "util.h" void keep_kmap_lib() { } diff --git a/src/utils/safec.h b/src/utils/safec.h index 16c6729a9..4b605ff23 100644 --- a/src/utils/safec.h +++ b/src/utils/safec.h @@ -20,10 +20,6 @@ #ifndef UTILS_SAFEC_H #define UTILS_SAFEC_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - //FIXIT-M combine these macros in the build foo #if defined(HAVE_SAFEC) && defined(ENABLE_SAFEC) diff --git a/src/utils/segment_mem.cc b/src/utils/segment_mem.cc index 62374da63..e4d49b10b 100644 --- a/src/utils/segment_mem.cc +++ b/src/utils/segment_mem.cc @@ -18,17 +18,13 @@ //-------------------------------------------------------------------------- // 8/7/2011 - Initial implementation ... Hui Cao -#include "segment_mem.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include "main/snort_types.h" -#ifndef SIZE_MAX -#define SIZE_MAX 0xFFFFFFFF // FIXIT-L use c++ value -#endif +#include "segment_mem.h" + +#include /*point to the start of the unused memory*/ static MEM_OFFSET unused_ptr = 0; diff --git a/src/utils/segment_mem.h b/src/utils/segment_mem.h index cd7949f47..2389a6a2f 100644 --- a/src/utils/segment_mem.h +++ b/src/utils/segment_mem.h @@ -23,7 +23,8 @@ // Segment memory allocation used by sfrt -#include "main/snort_types.h" +#include +#include using MEM_OFFSET = uint32_t; @@ -33,5 +34,6 @@ void segment_free(MEM_OFFSET ptr); MEM_OFFSET segment_snort_calloc(size_t num, size_t size); size_t segment_unusedmem(); void* segment_basePtr(); + #endif diff --git a/src/utils/sflsq.cc b/src/utils/sflsq.cc index e64c51630..22908a001 100644 --- a/src/utils/sflsq.cc +++ b/src/utils/sflsq.cc @@ -29,14 +29,13 @@ * multiple readers to traverse a list. */ -#include "sflsq.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include +#include "sflsq.h" -#include "main/snort_types.h" -#include "utils/util.h" +#include "util.h" /* * private alloc diff --git a/src/utils/sfmemcap.cc b/src/utils/sfmemcap.cc index c5cfd7618..add7c4a4c 100644 --- a/src/utils/sfmemcap.cc +++ b/src/utils/sfmemcap.cc @@ -27,15 +27,14 @@ Marc Norton */ -#include "sfmemcap.h" -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sfmemcap.h" #include "util.h" -#include "main/snort_types.h" -#include "main/snort_debug.h" /* * Set max # bytes & init other variables. diff --git a/src/utils/sfsnprintfappend.cc b/src/utils/sfsnprintfappend.cc index e0c9f5446..b509d5689 100644 --- a/src/utils/sfsnprintfappend.cc +++ b/src/utils/sfsnprintfappend.cc @@ -22,13 +22,14 @@ * * Author: Steven Sturges */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "sfsnprintfappend.h" -#include -#include -#include -#include -#include +#include #include "util.h" diff --git a/src/utils/stats.cc b/src/utils/stats.cc index ab6da0c55..5422819e4 100644 --- a/src/utils/stats.cc +++ b/src/utils/stats.cc @@ -17,28 +17,26 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "stats.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "util.h" +#include "stats.h" + +#include "file_api/file_stats.h" +#include "filters/sfthreshold.h" +#include "helpers/process.h" #include "log/messages.h" #include "main/snort_config.h" -#include "helpers/process.h" -#include "packet_io/sfdaq.h" +#include "managers/module_manager.h" #include "packet_io/active.h" +#include "packet_io/sfdaq.h" #include "packet_io/trough.h" -#include "target_based/sftarget_reader.h" -#include "managers/module_manager.h" -#include "managers/codec_manager.h" -#include "protocols/packet_manager.h" -#include "detection/fp_create.h" -#include "filters/sfthreshold.h" #include "profiler/profiler.h" +#include "protocols/packet_manager.h" #include "time/timersub.h" -#include "file_api/file_stats.h" + +#include "util.h" #define STATS_SEPARATOR \ "--------------------------------------------------" diff --git a/src/utils/stats.h b/src/utils/stats.h index 799c7a229..f9e16fe5e 100644 --- a/src/utils/stats.h +++ b/src/utils/stats.h @@ -22,18 +22,11 @@ // Provides facilities for displaying Snort exit stats -#include -#include - -#include -#include -#include -#include #include -#include "main/thread.h" -#include "main/snort_types.h" #include "framework/counts.h" +#include "main/snort_types.h" +#include "main/thread.h" using IndexVec = std::vector; diff --git a/src/utils/util.cc b/src/utils/util.cc index f95770860..a40898a97 100644 --- a/src/utils/util.cc +++ b/src/utils/util.cc @@ -18,13 +18,12 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "util.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "util.h" + #include #include #include @@ -49,7 +48,6 @@ extern "C" { } #include -#include #include "log/messages.h" #include "main/build.h" diff --git a/src/utils/util.h b/src/utils/util.h index 52bb09b6e..07d029d8d 100644 --- a/src/utils/util.h +++ b/src/utils/util.h @@ -26,19 +26,14 @@ #define TIMEBUF_SIZE 26 -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - #if defined(__linux__) #include #endif +#include +#include +#include +#include #include #include "main/snort_types.h" diff --git a/src/utils/util_jsnorm.cc b/src/utils/util_jsnorm.cc index 11d32b8a9..2577f8494 100644 --- a/src/utils/util_jsnorm.cc +++ b/src/utils/util_jsnorm.cc @@ -18,10 +18,15 @@ //-------------------------------------------------------------------------- // Writen by Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "util_jsnorm.h" -#include -#include +#include +#include + #include "main/thread.h" #define INVALID_HEX_VAL -1 diff --git a/src/utils/util_jsnorm.h b/src/utils/util_jsnorm.h index de8885aa4..59ae943c7 100644 --- a/src/utils/util_jsnorm.h +++ b/src/utils/util_jsnorm.h @@ -23,7 +23,6 @@ // Javascript Normalization -#include #include "main/snort_types.h" #define ALERT_SPACES_EXCEEDED 0x1 diff --git a/src/utils/util_net.cc b/src/utils/util_net.cc index 815eabb11..0298e6ea1 100644 --- a/src/utils/util_net.cc +++ b/src/utils/util_net.cc @@ -17,17 +17,15 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -#include "util_net.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include "util_net.h" #include "main/thread.h" +#include "sfip/sf_ip.h" + #include "util.h" /** diff --git a/src/utils/util_net.h b/src/utils/util_net.h index 4556fcda2..d6a76818f 100644 --- a/src/utils/util_net.h +++ b/src/utils/util_net.h @@ -26,7 +26,8 @@ // Be aware that subsequent calls will overwrite the memory that is pointed to #include "main/snort_types.h" -#include "sfip/sf_ip.h" + +struct SfIp; SO_PUBLIC char* inet_ntoax(const SfIp*); diff --git a/src/utils/util_unfold.cc b/src/utils/util_unfold.cc index d8c1f5230..ad2d19515 100644 --- a/src/utils/util_unfold.cc +++ b/src/utils/util_unfold.cc @@ -18,6 +18,10 @@ //-------------------------------------------------------------------------- // Writen by Bhagyashree Bantwal +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "util_unfold.h" /* Given a string, removes header folding (\r\n followed by linear whitespace) diff --git a/src/utils/util_utf.cc b/src/utils/util_utf.cc index 068992439..efd9e2dc1 100644 --- a/src/utils/util_utf.cc +++ b/src/utils/util_utf.cc @@ -19,10 +19,13 @@ /* Some UTF-{16,32}{le,be} normalization functions */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "util_utf.h" -#include -#include +#include #define DSTATE_FIRST 0 #define DSTATE_SECOND 1 -- 2.47.2