[Snort-devel] Fwd: [Snort-Users] snort signature code

Joel Esler jesler at ...402...
Fri Jun 10 13:00:14 EDT 2011



Begin forwarded message:

> From: nashwa salah <nashwasalah8 at ...2499...>
> Date: June 10, 2011 12:03:52 PM EDT
> To: Snort-Users <snortusers at ...3154...>
> Subject: [Snort-Users] snort signature code
> mime-version: 1.0
> user-agent: G2/1.0
> 
> i want to know what this code mean or what that main function of it in
> signature file:
> 
> ReferenceSystemNode * ReferenceSystemAdd(ReferenceSystemNode **head,
> char *name, char *url)
> {
>    ReferenceSystemNode *node;
> 
>    if (name == NULL)
>    {
>        ErrorMessage("NULL reference system name\n");
>        return NULL;
>    }
> 
>    if (head == NULL)
>        return NULL;
> 
>    /* create the new node */
>    node = (ReferenceSystemNode
> *)SnortAlloc(sizeof(ReferenceSystemNode));
> 
>    node->name = SnortStrdup(name);
>    if (url != NULL)
>        node->url = SnortStrdup(url);
> 
>    /* Add to the front of the list */
>    node->next = *head;
>    *head = node;
> 
>    return node;
> }
> 
> ReferenceSystemNode * ReferenceSystemLookup(ReferenceSystemNode *head,
> char *name)
> {
>    if (name == NULL)
>        return NULL;
> 
>    while (head != NULL)
>    {
>        if (strcasecmp(name, head->name) == 0)
>            break;
> 
>        head = head->next;
>    }
> 
>    return head;
> }
> 
> -- 
> To post to this group, send email to snortusers at ...3154...
> 
> For more information, please visit http://www.snort.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20110610/3843083c/attachment.html>


More information about the Snort-devel mailing list