todo comment update for address and port parsing

remotes/origin/master-1.0.x
Anoop Saldanha 16 years ago committed by Victor Julien
parent 621c8dd921
commit bb8a84d967

@ -727,7 +727,28 @@ error:
return -1; return -1;
} }
/* XXX error handling */ /**
* \brief Parses an address string and updates the 2 address heads with the
* address data.
*
* \todo We don't seem to be handling negated cases, like [addr,![!addr,addr]],
* since we pass around negate without keeping a count of ! with depth.
* Can solve this by keeping a count of the negations with depth, so that
* an even no of negations would count as no negation and an odd no of
* negations would count as a negation.
*
* \param gh Pointer to the address head that should hold address ranges
* that are not negated.
* \param ghn Pointer to the address head that should hold address ranges
* that are negated.
* \param s Pointer to the character string holding the address to be
* parsed.
* \param negate Flag that indicates if the receieved address string is negated
* or not. 0 if it is not, 1 it it is.
*
* \retval 0 On successfully parsing.
* \retval -1 On failure.
*/
int DetectAddressParse2(DetectAddressHead *gh, int DetectAddressParse2(DetectAddressHead *gh,
DetectAddressHead *ghn, DetectAddressHead *ghn,
char *s, int negate) { char *s, int negate) {

@ -969,15 +969,26 @@ error:
} }
/** /**
* \brief Real function that parse the ports string and fragment it into groups * \brief Parses a port string and updates the 2 port heads with the
* port groups.
* *
* \param head Pointer to the head of the DetectPort group list * \todo We don't seem to be handling negated cases, like [port,![!port,port]],
* \param nhead Pointer to the new head of the DetectPort group list * since we pass around negate without keeping a count of ! with depth.
* \param s Pointer to the port string * Can solve this by keeping a count of the negations with depth, so that
* \param negate Flag to know if the group is negated * an even no of negations would count as no negation and an odd no of
* negations would count as a negation.
* *
* \retval 0 on success * \param gh Pointer to the port group head that should hold port ranges
* \retval -1 on error * that are not negated.
* \param ghn Pointer to the port group head that should hold port ranges
* that are negated.
* \param s Pointer to the character string holding the port to be
* parsed.
* \param negate Flag that indicates if the receieved address string is negated
* or not. 0 if it is not, 1 it it is.
*
* \retval 0 On successfully parsing.
* \retval -1 On failure.
*/ */
static int DetectPortParseDo(DetectPort **head, DetectPort **nhead, char *s, static int DetectPortParseDo(DetectPort **head, DetectPort **nhead, char *s,
int negate) { int negate) {

Loading…
Cancel
Save