Skip to content

Commit

Permalink
continued work on portevent, can't access size of the buffer list
Browse files Browse the repository at this point in the history
without making it public, so I need to add a method to do that.
  • Loading branch information
dakrone committed Sep 8, 2008
1 parent eb9eb16 commit bbebcae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions portevent.cxx
Expand Up @@ -5,6 +5,8 @@


PortEvent::PortEvent() PortEvent::PortEvent()
{ {
/* if a port occurs in less than X percent of all these packets... */
low_port_threshold = 5; /* 5% */
} }


PortEvent::~PortEvent() PortEvent::~PortEvent()
Expand All @@ -14,8 +16,18 @@ PortEvent::~PortEvent()
bool PortEvent::process_packet(LIDSBuffer* buff) bool PortEvent::process_packet(LIDSBuffer* buff)
{ {
IN(); IN();
OUTd(false); bool threw_alarm = false;
return false;
for (u_int i = 0; i < buff->get_packet_count(); i++) {
/*
* grab port, add to a list, tell if the list has x% or less of
* those ports in the packets
*/
/* do something with the packet */
}

OUTd(threw_alarm);
return threw_alarm;
} }


char* PortEvent::get_event_name() char* PortEvent::get_event_name()
Expand Down
1 change: 1 addition & 0 deletions portevent.h
Expand Up @@ -14,6 +14,7 @@ class PortEvent: public LIDSEvent {
char* get_event_name(); char* get_event_name();


private: private:
int low_port_threshold;




}; };
Expand Down

0 comments on commit bbebcae

Please sign in to comment.