NETWORK ATTACKS FRAMEWORK  1.0.0
A NETwork Attacks framework. Making network attacks impact evaluation easier!
NA_list.h File Reference

Go to the source code of this file.

Classes

struct  list_t

Defines

#define NS_PORT
#define OMNETPP
#define LIST_NULL   -1
#define LIST_SUCCESS   1
#define LIST(name)   list_t name = { &(name), &(name) }
#define INIT_LIST_HEAD(h)
#define INIT_LIST_ELM(le)
#define list_foreach(curr, head)   for (curr = (head)->next; curr != (head); curr = curr->next)
#define list_foreach_safe(pos, tmp, head)

Typedefs

typedef struct list_t list_t

Functions

int list_detach (list_t *le)
int list_add_tail (list_t *head, list_t *le)
int list_add (list_t *head, list_t *le)
int list_empty (list_t *)
list_tlist_first (list_t *)
int list_unattached (list_t *)

Define Documentation

#define INIT_LIST_ELM (   le)
Value:
do { \
    (le)->next = NULL; (le)->prev = NULL; \
} while (0)

Definition at line 42 of file NA_list.h.

#define INIT_LIST_HEAD (   h)
Value:
do { \
    (h)->next = (h); (h)->prev = (h); \
} while (0)

Definition at line 38 of file NA_list.h.

#define LIST (   name)    list_t name = { &(name), &(name) }

Definition at line 36 of file NA_list.h.

#define list_foreach (   curr,
  head 
)    for (curr = (head)->next; curr != (head); curr = curr->next)

Definition at line 51 of file NA_list.h.

#define list_foreach_safe (   pos,
  tmp,
  head 
)
Value:
for (pos = (head)->next, tmp = pos->next; pos != (head); \
                pos = tmp, tmp = pos->next)

Definition at line 54 of file NA_list.h.

#define LIST_NULL   -1

Definition at line 33 of file NA_list.h.

#define LIST_SUCCESS   1

Definition at line 34 of file NA_list.h.

#define NS_PORT

Definition at line 24 of file NA_list.h.

#define OMNETPP

Definition at line 25 of file NA_list.h.


Typedef Documentation

typedef struct list_t list_t

Function Documentation

int list_add ( list_t head,
list_t le 
)

Definition at line 45 of file NA_list.cc.

{

    if (!head || !le)
        return LIST_NULL;

    listelm_add(le, head, head->next);

    return LIST_SUCCESS;
}
int list_add_tail ( list_t head,
list_t le 
)

Definition at line 56 of file NA_list.cc.

{

    if (!head || !le)
        return LIST_NULL;

    listelm_add(le, head->prev, head);

    return LIST_SUCCESS;
}
int list_detach ( list_t le)

Definition at line 67 of file NA_list.cc.

{
    if (!le)
        return LIST_NULL;

    listelm_detach(le->prev, le->next);

    le->next = le->prev = NULL;

    return LIST_SUCCESS;
};
int list_empty ( list_t )

Definition at line 80 of file NA_list.cc.

{
    if (head == head->next)
        return 1;
    return 0;
}

Definition at line 87 of file NA_list.cc.

{
    return head->next;
}
int list_unattached ( list_t )

Definition at line 92 of file NA_list.cc.

{
    if (le->next == NULL && le->prev == NULL)
        return 1;
    return 0;
}
 All Classes Files Functions Variables Typedefs Enumerator Defines