else
{
trace_logf(detection, TRACE_RULE_EVAL, "Reached leaf, cursor name %s, cursor position %u\n",
- name, pos);
+ name, pos);
}
if (!trace_enabled(detection_trace, trace_buffer))
enum
{
- TRACE_DETECTION_ENGINE = 0x1,
- TRACE_RULE_EVAL = 0x2,
- TRACE_BUFFER_MINIMAL = 0x4,
- TRACE_BUFFER_VERBOSE = 0x8,
- TRACE_RULE_VARS = 0x10
+ TRACE_DETECTION_ENGINE = 0x1,
+ TRACE_RULE_EVAL = 0x2,
+ TRACE_BUFFER_MINIMAL = 0x4,
+ TRACE_BUFFER_VERBOSE = 0x8,
+ TRACE_RULE_VARS = 0x10
};
-
+
void clear_trace_cursor_info();
void print_pkt_info(Packet* p);
void print_pattern(const PatternMatchData* pmd);
unsigned finish(char* buf);
void reset()
- { step = step_A, state = 0; }
+ { step = step_A; state = 0; }
private:
enum Steps { step_A, step_B, step_C };
static void parse_base(uint8_t value, ByteMathData& idx)
{
- assert(value <= 2);
- int base[] = { 16, 10, 8 };
- idx.base = base[value];
+ assert(value <= 2);
+ int base[] = { 16, 10, 8 };
+ idx.base = base[value];
}
static void parse_endian(uint8_t value, ByteMathData& idx)
{
- assert(value <= 1);
- int endian[] = { ENDIAN_BIG, ENDIAN_LITTLE };
- set_byte_order(idx.endianess, endian[value], "byte_math");
+ assert(value <= 1);
+ int endian[] = { ENDIAN_BIG, ENDIAN_LITTLE };
+ set_byte_order(idx.endianess, endian[value], "byte_math");
}
//-------------------------------------------------------------------------
((uint8_t)p->ptrs.icmph->type == icmp::Icmp6Types::ECHO_REQUEST ||
(uint8_t)p->ptrs.icmph->type == icmp::Icmp6Types::ECHO_REPLY) )
{
- uint16_t icmp_id = ntohs(p->ptrs.icmph->s_icmp_id);
+ uint16_t icmp_id = ntohs(p->ptrs.icmph->s_icmp_id);
if ( config.eval( icmp_id ) )
return DETECTION_OPTION_MATCH;
}
((uint8_t)p->ptrs.icmph->type == icmp::Icmp6Types::ECHO_REQUEST ||
(uint8_t)p->ptrs.icmph->type == icmp::Icmp6Types::ECHO_REPLY) )
{
- uint16_t icmp_seq = ntohs(p->ptrs.icmph->s_icmp_seq);
+ uint16_t icmp_seq = ntohs(p->ptrs.icmph->s_icmp_seq);
if ( config.eval( icmp_seq ) )
{
return DETECTION_OPTION_MATCH;
uint32_t program;
uint32_t version;
uint32_t procedure;
- uint32_t flags; // which fields to check
+ uint32_t flags; // which fields to check
};
#define RPC_CHECK_VERSION 0x1
// get a 32-bit int from the current location and increment to next int position
uint32_t RpcOption::get_int(const uint8_t*& data)
{
- uint32_t value = extract_32bits(data);
+ uint32_t value = extract_32bits(data);
data += 4;
return value;
}
static THREAD_LOCAL ProfileStats sessionPerfStats;
-#define SESSION_PRINTABLE 1
-#define SESSION_BINARY 2
-#define SESSION_ALL 3
+#define SESSION_PRINTABLE 1
+#define SESSION_BINARY 2
+#define SESSION_ALL 3
struct SessionData
{
parse_errors++;
}
-NORETURN void ParseAbort(const char* format, ...)
+[[noreturn]] void ParseAbort(const char* format, ...)
{
char buf[STD_BUF+1];
va_list ap;
*
* Returns: void function
*/
-NORETURN void FatalError(const char* format,...)
+[[noreturn]] void FatalError(const char* format,...)
{
char buf[STD_BUF+1];
va_list ap;
}
}
-void log_safec_error(const char* msg, void*, int e)
+[[noreturn]] void log_safec_error(const char* msg, void*, int e)
{
static THREAD_LOCAL unsigned safec_errors = 0;
SO_PUBLIC void ParseMessage(const char*, ...) __attribute__((format (printf, 1, 2)));
SO_PUBLIC void ParseWarning(WarningGroup, const char*, ...) __attribute__((format (printf, 2, 3)));
SO_PUBLIC void ParseError(const char*, ...) __attribute__((format (printf, 1, 2)));
-SO_PUBLIC NORETURN void ParseAbort(const char*, ...) __attribute__((format (printf, 1, 2)));
+[[noreturn]] SO_PUBLIC void ParseAbort(const char*, ...) __attribute__((format (printf, 1, 2)));
SO_PUBLIC void LogMessage(const char*, ...) __attribute__((format (printf, 1, 2)));
SO_PUBLIC void LogMessage(FILE* fh, const char*, ...) __attribute__((format (printf, 2, 3)));
SO_PUBLIC void ErrorMessage(const char*, ...) __attribute__((format (printf, 1, 2)));
// FIXIT-M do not call FatalError() during runtime
-SO_PUBLIC NORETURN void FatalError(const char*, ...) __attribute__((format (printf, 1, 2)));
+[[noreturn]] SO_PUBLIC void FatalError(const char*, ...) __attribute__((format (printf, 1, 2)));
-void log_safec_error(const char*, void*, int);
+[[noreturn]] void log_safec_error(const char*, void*, int);
class Dumper
{
}
}
-NORETURN void help_basic(SnortConfig*, const char*)
+[[noreturn]] void help_basic(SnortConfig*, const char*)
{
fprintf(stdout, "%s\n", snort_help);
exit(0);
}
-NORETURN void help_usage(SnortConfig*, const char* s)
+[[noreturn]] void help_usage(SnortConfig*, const char* s)
{
fprintf(stdout, "usage:\n");
fprintf(stdout, " %s -?: list options\n", s);
exit(0);
}
-NORETURN void help_options(SnortConfig*, const char* val)
+[[noreturn]] void help_options(SnortConfig*, const char* val)
{
help_args(val);
exit(0);
}
-NORETURN void help_signals(SnortConfig*, const char*)
+[[noreturn]] void help_signals(SnortConfig*, const char*)
{
help_signals();
exit(0);
HT_IPS, HT_LST, HT_MOD, HT_PEG, HT_PLG
};
-NORETURN static void show_help(SnortConfig* sc, const char* val, HelpType ht)
+[[noreturn]] static void show_help(SnortConfig* sc, const char* val, HelpType ht)
{
snort_conf = new SnortConfig;
ScriptManager::load_scripts(sc->script_paths);
exit(0);
}
-NORETURN void help_config(SnortConfig* sc, const char* val)
+[[noreturn]] void help_config(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_CFG);
}
-NORETURN void help_commands(SnortConfig* sc, const char* val)
+[[noreturn]] void help_commands(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_CMD);
}
Markup::enable();
}
-NORETURN void help_gids(SnortConfig* sc, const char* val)
+[[noreturn]] void help_gids(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_GID);
}
-NORETURN void help_buffers(SnortConfig* sc, const char* val)
+[[noreturn]] void help_buffers(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_BUF);
}
-NORETURN void help_builtin(SnortConfig* sc, const char* val)
+[[noreturn]] void help_builtin(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_IPS);
}
-NORETURN void help_counts(SnortConfig* sc, const char* val)
+[[noreturn]] void help_counts(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_PEG);
}
-NORETURN void help_module(SnortConfig* sc, const char* val)
+[[noreturn]] void help_module(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_MOD);
}
-NORETURN void help_modules(SnortConfig* sc, const char* val)
+[[noreturn]] void help_modules(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_HMO);
}
-NORETURN void help_plugins(SnortConfig* sc, const char* val)
+[[noreturn]] void help_plugins(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_HPL);
}
-NORETURN void help_version(SnortConfig*)
+[[noreturn]] void help_version(SnortConfig*)
{
DisplayBanner();
exit(0);
}
-NORETURN void list_daqs(SnortConfig* sc)
+[[noreturn]] void list_daqs(SnortConfig* sc)
{
SFDAQ::load(sc);
SFDAQ::print_types(cout);
exit(0);
}
-NORETURN void list_interfaces(SnortConfig*)
+[[noreturn]] void list_interfaces(SnortConfig*)
{
PrintAllInterfaces();
exit(0);
}
-NORETURN void list_modules(SnortConfig* sc, const char* val)
+[[noreturn]] void list_modules(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_LST);
}
-NORETURN void list_plugins(SnortConfig* sc, const char* val)
+[[noreturn]] void list_plugins(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_PLG);
}
-NORETURN void dump_defaults(SnortConfig* sc, const char* val)
+[[noreturn]] void dump_defaults(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_DFL);
}
-NORETURN void dump_builtin_rules(SnortConfig* sc, const char* val)
+[[noreturn]] void dump_builtin_rules(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_DBR);
}
-NORETURN void dump_dynamic_rules(SnortConfig* sc, const char* val)
+[[noreturn]] void dump_dynamic_rules(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_DDR);
}
-NORETURN void dump_msg_map(SnortConfig* sc, const char* val)
+[[noreturn]] void dump_msg_map(SnortConfig* sc, const char* val)
{
show_help(sc, val, HT_DMM);
}
-NORETURN void dump_rule_hex(SnortConfig*, const char* val)
+[[noreturn]] void dump_rule_hex(SnortConfig*, const char* val)
{
SoManager::rule_to_hex(val);
exit(0);
}
-NORETURN void dump_rule_text(SnortConfig*, const char* val)
+[[noreturn]] void dump_rule_text(SnortConfig*, const char* val)
{
SoManager::rule_to_text(val);
exit(0);
}
-NORETURN void dump_version(SnortConfig*)
+[[noreturn]] void dump_version(SnortConfig*)
{
cout << VERSION << endl;
exit(0);
void config_markup(SnortConfig*, const char*);
void help_args(const char* pfx);
-void help_basic(SnortConfig*, const char*);
-void help_usage(SnortConfig*, const char*);
-void help_options(SnortConfig*, const char*);
-void help_signals(SnortConfig*, const char*);
-void help_config(SnortConfig* sc, const char*);
-void help_commands(SnortConfig* sc, const char*);
-void help_gids(SnortConfig* sc, const char*);
-void help_buffers(SnortConfig* sc, const char*);
-void help_builtin(SnortConfig* sc, const char*);
-void help_module(SnortConfig* sc, const char*);
-void help_modules(SnortConfig* sc, const char*);
-void help_plugins(SnortConfig* sc, const char*);
-void help_version(SnortConfig*);
-void help_counts(SnortConfig* sc, const char*);
-
-void list_modules(SnortConfig* sc, const char*);
-void list_plugins(SnortConfig* sc, const char*);
-void list_interfaces(SnortConfig*);
-void list_daqs(SnortConfig* sc);
-
-void dump_defaults(SnortConfig* sc, const char*);
-void dump_builtin_rules(SnortConfig* sc, const char*);
-void dump_dynamic_rules(SnortConfig* sc, const char*);
-void dump_msg_map(SnortConfig* sc, const char*);
-void dump_rule_hex(SnortConfig* sc, const char*);
-void dump_rule_text(SnortConfig* sc, const char*);
-void dump_version(SnortConfig* sc);
+[[noreturn]] void help_basic(SnortConfig*, const char*);
+[[noreturn]] void help_usage(SnortConfig*, const char*);
+[[noreturn]] void help_options(SnortConfig*, const char*);
+[[noreturn]] void help_signals(SnortConfig*, const char*);
+[[noreturn]] void help_config(SnortConfig* sc, const char*);
+[[noreturn]] void help_commands(SnortConfig* sc, const char*);
+[[noreturn]] void help_gids(SnortConfig* sc, const char*);
+[[noreturn]] void help_buffers(SnortConfig* sc, const char*);
+[[noreturn]] void help_builtin(SnortConfig* sc, const char*);
+[[noreturn]] void help_module(SnortConfig* sc, const char*);
+[[noreturn]] void help_modules(SnortConfig* sc, const char*);
+[[noreturn]] void help_plugins(SnortConfig* sc, const char*);
+[[noreturn]] void help_version(SnortConfig*);
+[[noreturn]] void help_counts(SnortConfig* sc, const char*);
+
+[[noreturn]] void list_modules(SnortConfig* sc, const char*);
+[[noreturn]] void list_plugins(SnortConfig* sc, const char*);
+[[noreturn]] void list_interfaces(SnortConfig*);
+[[noreturn]] void list_daqs(SnortConfig* sc);
+
+[[noreturn]] void dump_defaults(SnortConfig* sc, const char*);
+[[noreturn]] void dump_builtin_rules(SnortConfig* sc, const char*);
+[[noreturn]] void dump_dynamic_rules(SnortConfig* sc, const char*);
+[[noreturn]] void dump_msg_map(SnortConfig* sc, const char*);
+[[noreturn]] void dump_rule_hex(SnortConfig* sc, const char*);
+[[noreturn]] void dump_rule_text(SnortConfig* sc, const char*);
+[[noreturn]] void dump_version(SnortConfig* sc);
#endif
if ( !trace_enabled(mask, flags) )
return;
- char buf[STD_BUF];
+ char buf[STD_BUF];
int buf_len = sizeof(buf);
char* buf_ptr = buf;
int size;
-
+
if (name)
{
size = snprintf(buf, buf_len, "%s: ", name);
buf_len -= size;
}
}
-
+
if ( file )
{
size = snprintf(buf_ptr, buf_len, "%s:%d: ", file, line);
// why not
//-------------------------------------------------------------------------
-NORETURN static void c2x(const char* s)
+[[noreturn]] static void c2x(const char* s)
{
printf("'%c' = 0x%2.2X (%d)\n", s[0], s[0], s[0]);
exit(0);
}
-NORETURN static void x2c(unsigned x)
+[[noreturn]] static void x2c(unsigned x)
{
printf("0x%2.2X (%u) = '%c'\n", x, x, static_cast<char>(x));
exit(0);
}
-NORETURN static void x2s(const char* s)
+[[noreturn]] static void x2s(const char* s)
{
bool inv;
string out, in = "\"";
#endif
#endif
-/* specifies that a function does not return
- * used for quieting Visual Studio warnings */
-#ifdef _MSC_VER
-# if _MSC_VER >= 1400
-# define NORETURN __declspec(noreturn)
-# else
-# define NORETURN
-# endif
-#else
-# define NORETURN __attribute__ ((noreturn))
-#endif
-
#if !defined(__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 5)
#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
struct ChpMatchDescriptor
{
- void free_rewrite_buffers()
- {
+ void free_rewrite_buffers()
+ {
for (unsigned i = 0; i < NUMBER_OF_PTYPES; i++)
if (chp_rewritten[i])
{
snort_free(chp_rewritten[i]);
chp_rewritten[i] = nullptr;
}
- }
+ }
- void sort_chp_matches()
- {
- chp_matches[cur_ptype].sort(ChpMatchDescriptor::comp_chp_actions);
- }
+ void sort_chp_matches()
+ {
+ chp_matches[cur_ptype].sort(ChpMatchDescriptor::comp_chp_actions);
+ }
PatternType cur_ptype;
char* buffer[NUMBER_OF_PTYPES] = { nullptr };
return deleteRtnFromOtn(otn, get_ips_policy()->policy_id, sc);
}
-uint32_t rtn_hash_func(SFHASHFCN*, unsigned char *k, int)
+static uint32_t rtn_hash_func(SFHASHFCN*, unsigned char *k, int)
{
uint32_t a,b,c;
RuleTreeNodeKey* rtnk = (RuleTreeNodeKey*)k;
return c;
}
-int rtn_compare_func(const void *k1, const void *k2, size_t)
+static int rtn_compare_func(const void *k1, const void *k2, size_t)
{
RuleTreeNodeKey* rtnk1 = (RuleTreeNodeKey*)k1;
RuleTreeNodeKey* rtnk2 = (RuleTreeNodeKey*)k2;
if (same_headers(rtnk1->rtn, rtnk2->rtn))
return 0;
- return 1;
+ return 1;
}
/**Add RTN to OTN for a particular OTN.
SF_LIST** parray = (SF_LIST**)snort_calloc(sizeof(SF_LIST*), SFPO_MAX_PORTS);
assert(parray);
- PortObject* po;
+ PortObject* po;
SF_LNODE* lpos;
for ( po = (PortObject*)sflist_first(p->pt_polist, &lpos);
po;
po;
po = (PortObject*)sflist_next(&lpos) )
{
- if (pol_cnt < SFPO_MAX_LPORTS )
+ if (pol_cnt < SFPO_MAX_LPORTS )
{
- pol[ pol_cnt++ ] = po;
+ pol[ pol_cnt++ ] = po;
}
}
p->pt_port_object[i] = 0;
DEBUG_WRAP(DebugMessage(DEBUG_PORTLISTS, "\n"); fflush(stdout); );
}
- delete_port_lists(optimized_pl);
- snort_free(optimized_pl);
+ delete_port_lists(optimized_pl);
+ snort_free(optimized_pl);
/*
* Normalize the Ports so they indicate only the ports that
static int List_GetNextStateOpt( ACSM_STRUCT2 * acsm,
trans_node_t **acsmTransTableOpt, int state, int input )
{
- int index = state * acsm->acsmAlphabetSize + input;
- trans_node_t * t = acsmTransTableOpt[index];
+ int index = state * acsm->acsmAlphabetSize + input;
+ trans_node_t * t = acsmTransTableOpt[index];
- if ( t )
- return t->next_state;
+ if ( t )
+ return t->next_state;
- if( state == 0 )
+ if( state == 0 )
return 0;
- return ACSM_FAIL_STATE2; /* Fail state ??? */
+ return ACSM_FAIL_STATE2; /* Fail state ??? */
}
* Put Next State - Head insertion, and transition updates
*/
static int List_PutNextStateOpt( ACSM_STRUCT2 * acsm, trans_node_t **acsmTransTableOpt,
- int state, int input, int next_state )
+ int state, int input, int next_state )
{
- int index = state * acsm->acsmAlphabetSize + input;
+ int index = state * acsm->acsmAlphabetSize + input;
- trans_node_t *t = acsmTransTableOpt[index];
+ trans_node_t *t = acsmTransTableOpt[index];
- if ( t )
- {
- t->next_state = next_state;
- return 0;
- }
+ if ( t )
+ {
+ t->next_state = next_state;
+ return 0;
+ }
- /* Definitely not an existing transition - add it */
- trans_node_t * tnew = (trans_node_t*)AC_MALLOC(sizeof(trans_node_t),
- ACSM2_MEMORY_TYPE__TRANSTABLE);
+ /* Definitely not an existing transition - add it */
+ trans_node_t * tnew = (trans_node_t*)AC_MALLOC(sizeof(trans_node_t),
+ ACSM2_MEMORY_TYPE__TRANSTABLE);
- if( !tnew )
- return -1;
+ if( !tnew )
+ return -1;
- tnew->key = input;
- tnew->next_state = next_state;
- tnew->next = acsm->acsmTransTable[state];
- acsm->acsmTransTable[state] = tnew;
- acsm->acsmNumTrans++;
+ tnew->key = input;
+ tnew->next_state = next_state;
+ tnew->next = acsm->acsmTransTable[state];
+ acsm->acsmTransTable[state] = tnew;
+ acsm->acsmNumTrans++;
- acsmTransTableOpt[index] = tnew;
+ acsmTransTableOpt[index] = tnew;
- return 0;
+ return 0;
}
/*
for (int i=0; i<acsm->acsmAlphabetSize; i++)
{
if ( int s = List_GetNextStateOpt(acsm, acsmTransTableOpt, 0, i) )
- {
- if ( !queue_array[s] )
- {
- queue.push_back(s);
- queue_array[s] = true;
- }
- }
+ {
+ if ( !queue_array[s] )
+ {
+ queue.push_back(s);
+ queue_array[s] = true;
+ }
+ }
}
/* Start building the next layer of transitions */
for ( auto r : queue )
{
- queue_array[r] = false;
+ queue_array[r] = false;
/* Process this states layer */
for (int i = 0; i < acsm->acsmAlphabetSize; i++)
if ( (acstate_t)s != ACSM_FAIL_STATE2 && s != 0 )
{
- if ( !queue_array[s] )
- {
- queue.push_back(s);
- queue_array[s] = true;
- }
+ if ( !queue_array[s] )
+ {
+ queue.push_back(s);
+ queue_array[s] = true;
+ }
}
else
{
}
}
- snort_free(queue_array);
- snort_free(acsmTransTableOpt);
+ snort_free(queue_array);
+ snort_free(acsmTransTableOpt);
}
/*
{
Profile profile(dce2_smb_pstat_new_session);
- DebugMessage(DEBUG_DCE_SMB, "DCE over SMB packet detected\n");
- DebugMessage(DEBUG_DCE_SMB, "Creating new session\n");
+ DebugMessage(DEBUG_DCE_SMB, "DCE over SMB packet detected\n");
+ DebugMessage(DEBUG_DCE_SMB, "Creating new session\n");
DCE2_SmbSsnData* dce2_smb_sess = set_new_dce2_smb_session(p);
- if ( dce2_smb_sess )
- {
- dce2_smb_sess->dialect_index = DCE2_SENTINEL;
- dce2_smb_sess->max_outstanding_requests = 10; // Until Negotiate/SessionSetupAndX
- dce2_smb_sess->cli_data_state = DCE2_SMB_DATA_STATE__NETBIOS_HEADER;
- dce2_smb_sess->srv_data_state = DCE2_SMB_DATA_STATE__NETBIOS_HEADER;
- dce2_smb_sess->pdu_state = DCE2_SMB_PDU_STATE__COMMAND;
- dce2_smb_sess->uid = DCE2_SENTINEL;
- dce2_smb_sess->tid = DCE2_SENTINEL;
- dce2_smb_sess->ftracker.fid_v1 = DCE2_SENTINEL;
- dce2_smb_sess->rtracker.mid = DCE2_SENTINEL;
- dce2_smb_sess->max_file_depth = FileService::get_max_file_depth();
-
- DCE2_ResetRopts(&dce2_smb_sess->sd.ropts);
-
- dce2_smb_stats.smb_sessions++;
- DebugFormat(DEBUG_DCE_SMB,"Created (%p)\n", (void*)dce2_smb_sess);
-
- dce2_smb_sess->sd.trans = DCE2_TRANS_TYPE__SMB;
- dce2_smb_sess->sd.server_policy = config->common.policy;
- dce2_smb_sess->sd.client_policy = DCE2_POLICY__WINXP;
- dce2_smb_sess->sd.wire_pkt = p;
- dce2_smb_sess->sd.config = (void*)config;
- }
+ if ( dce2_smb_sess )
+ {
+ dce2_smb_sess->dialect_index = DCE2_SENTINEL;
+ dce2_smb_sess->max_outstanding_requests = 10; // Until Negotiate/SessionSetupAndX
+ dce2_smb_sess->cli_data_state = DCE2_SMB_DATA_STATE__NETBIOS_HEADER;
+ dce2_smb_sess->srv_data_state = DCE2_SMB_DATA_STATE__NETBIOS_HEADER;
+ dce2_smb_sess->pdu_state = DCE2_SMB_PDU_STATE__COMMAND;
+ dce2_smb_sess->uid = DCE2_SENTINEL;
+ dce2_smb_sess->tid = DCE2_SENTINEL;
+ dce2_smb_sess->ftracker.fid_v1 = DCE2_SENTINEL;
+ dce2_smb_sess->rtracker.mid = DCE2_SENTINEL;
+ dce2_smb_sess->max_file_depth = FileService::get_max_file_depth();
+
+ DCE2_ResetRopts(&dce2_smb_sess->sd.ropts);
+
+ dce2_smb_stats.smb_sessions++;
+ DebugFormat(DEBUG_DCE_SMB,"Created (%p)\n", (void*)dce2_smb_sess);
+
+ dce2_smb_sess->sd.trans = DCE2_TRANS_TYPE__SMB;
+ dce2_smb_sess->sd.server_policy = config->common.policy;
+ dce2_smb_sess->sd.client_policy = DCE2_POLICY__WINXP;
+ dce2_smb_sess->sd.wire_pkt = p;
+ dce2_smb_sess->sd.config = (void*)config;
+ }
return dce2_smb_sess;
}
StreamSplitter* FtpData::get_splitter(bool to_server)
{
- return new FtpDataSplitter(to_server);
+ return new FtpDataSplitter(to_server);
}
//-------------------------------------------------------------------------
METH_REBIND, METH_UNBIND, METH_UNLINK, METH_UPDATEREDIRECTREF,
METH__WEBDAV_LOW=1000, // All WebDAV related methods go after this.
- METH_PROPFIND, METH_PROPPATCH, METH_MKCOL, METH_COPY, METH_MOVE,
- METH_LOCK, METH_UNLOCK, METH_SEARCH, METH_BCOPY, METH_BDELETE,
- METH_BMOVE, METH_BPROPFIND, METH_BPROPPATCH, METH_NOTIFY, METH_POLL,
- METH_SUBSCRIBE, METH_UNSUBSCRIBE, METH_X_MS_ENUMATTS,
- METH__WEBDAV_HIGH // All WebDAV related methods go before this.
+ METH_PROPFIND, METH_PROPPATCH, METH_MKCOL, METH_COPY, METH_MOVE,
+ METH_LOCK, METH_UNLOCK, METH_SEARCH, METH_BCOPY, METH_BDELETE,
+ METH_BMOVE, METH_BPROPFIND, METH_BPROPPATCH, METH_NOTIFY, METH_POLL,
+ METH_SUBSCRIBE, METH_UNSUBSCRIBE, METH_X_MS_ENUMATTS,
+ METH__WEBDAV_HIGH // All WebDAV related methods go before this.
};
// URI formats
/* Returns true if the IPv6 address appears mapped. */
bool is_mapped() const;
bool is_loopback() const;
- bool is_private() const;
+ bool is_private() const;
const char* ntop(char* buf, int bufsize) const;
const char* ntoa() const;
else
{
ParseError("can't open file %s = %s: %s", key, fname, get_error(errno));
- return "";
+ return "";
}
return line;
len = 0;
return len;
-}
\ No newline at end of file
+}
+
{ return rule_file.empty() ? get_out_file() : rule_file; }
static void help_args(const char* pfx, const char* /*val*/);
-static void print_args(const char* pfx, const char* /*val*/);
//-------------------------------------------------------------------------
// arg foo
return false;
}
-static void help_usage()
+[[noreturn]] static void help_usage()
{
std::cout << "usage:\n";
std::cout << " -?: list options\n";
}
#ifdef REG_TEST
-static void print_binder_order(const char* /*key*/, const char* /*val*/)
+[[noreturn]] static void print_binder_order(const char* /*key*/, const char* /*val*/)
{
print_binder_priorities();
exit(0);
}
#endif
-static void help(const char* key, const char* val)
+[[noreturn]] static void help(const char* key, const char* val)
{
std::cout << Markup::head(3) << "Usage: snort2lua [OPTIONS]... -c <snort_conf> ...\n";
std::cout << "\n";
exit(0);
}
-static void print_args(const char* key, const char* val)
+[[noreturn]] static void print_args(const char* key, const char* val)
{
help_args(key, val);
exit(0);