"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/detection-plugins/detection_leaf_node.c" between
snort-2.9.16.1.tar.gz and snort-2.9.17.tar.gz

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

detection_leaf_node.c  (snort-2.9.16.1):detection_leaf_node.c  (snort-2.9.17)
skipping to change at line 110 skipping to change at line 110
#define PacketUnknown(pkt) (PacketService (pkt) == 0) #define PacketUnknown(pkt) (PacketService (pkt) == 0)
static inline LEAF_STATUS static inline LEAF_STATUS
leaf_node_check_otn_service (OptTreeNode * otn, Packet * packet) leaf_node_check_otn_service (OptTreeNode * otn, Packet * packet)
{ {
bool service_match = false; bool service_match = false;
unsigned int i; unsigned int i;
if (PacketUnknown (packet)) if (PacketUnknown (packet))
{ {
#ifdef TARGET_BASED
if (OtnAndPorts (otn)) if (OtnAndPorts (otn))
return (Leaf_Abort); return (Leaf_Abort);
#endif
return (Leaf_CheckPorts); return (Leaf_CheckPorts);
} }
#ifdef TARGET_BASED
for (i = 0; i < OtnServiceCount (otn); i++) for (i = 0; i < OtnServiceCount (otn); i++)
{ {
const uint16_t ordinal = otn->sigInfo.services[ i ].service_ordinal; const uint16_t ordinal = otn->sigInfo.services[ i ].service_ordinal;
if (PacketService (packet) == ordinal) if (PacketService (packet) == ordinal)
{ {
service_match = true; service_match = true;
} }
} }
#endif
if (service_match) if (service_match)
{ {
// identified service matches the rule // identified service matches the rule
#ifdef TARGET_BASED
if (OtnAndPorts (otn)) if (OtnAndPorts (otn))
return (Leaf_CheckPorts); return (Leaf_CheckPorts);
#endif
return (Leaf_SkipPorts); return (Leaf_SkipPorts);
} }
else else
{ {
#ifdef TARGET_BASED
if (!OtnOrPorts (otn)) if (!OtnOrPorts (otn))
return (Leaf_Abort); return (Leaf_Abort);
#endif
} }
return (Leaf_CheckPorts); return (Leaf_CheckPorts);
} }
static inline LEAF_STATUS static inline LEAF_STATUS
detection_leaf_node_eval (detection_option_tree_node_t * node, detection_leaf_node_eval (detection_option_tree_node_t * node,
detection_option_eval_data_t * eval_data) detection_option_eval_data_t * eval_data)
{ {
OptTreeNode *otn = (OptTreeNode*) node->option_data; OptTreeNode *otn = (OptTreeNode*) node->option_data;
Packet * packet = (Packet*) eval_data->p; Packet * packet = (Packet*) eval_data->p;
#ifdef TARGET_BASED
if (!IsAdaptiveConfigured()) if (!IsAdaptiveConfigured())
return (Leaf_CheckPorts); return (Leaf_CheckPorts);
#endif
return leaf_node_check_otn_service (otn, packet); return leaf_node_check_otn_service (otn, packet);
} }
 End of changes. 10 change blocks. 
2 lines changed or deleted 10 lines changed or added

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