FACT++  1.0
int dis_hash_service_insert ( SERVICE servp)

Definition at line 3259 of file dis.c.

References dll_init(), dll_insert_queue(), HashFunction(), Memory::malloc(), MAX_HASH_ENTRIES, and serv::name.

Referenced by do_dis_add_cmnd_dns(), and do_dis_add_service_dns().

3260 {
3261  int index;
3262  index = HashFunction(servp->name, MAX_HASH_ENTRIES);
3263  if(!Service_hash_table[index])
3264  {
3265  Service_hash_table[index] = (SERVICE *) malloc(sizeof(SERVICE));
3266  dll_init((DLL *) Service_hash_table[index]);
3267  }
3268  Service_new_entries[index]++;
3270  (DLL *) servp);
3271  return(1);
3272 }
#define MAX_HASH_ENTRIES
Definition: dis.c:3231
void dll_insert_queue(DLL *head, DLL *item)
Definition: dll.c:23
char name[MAX_NAME]
Definition: dis.c:72
void * malloc()
Definition: EventBuilder.cc:99
void dll_init(DLL *head)
Definition: dll.c:14
static int Service_new_entries[MAX_HASH_ENTRIES]
Definition: dis.c:3234
Definition: dim.h:530
Definition: dis.c:69
static SERVICE * Service_hash_table[MAX_HASH_ENTRIES]
Definition: dis.c:3233
int HashFunction(char *name, int max)
Definition: hash.c:22

+ Here is the call graph for this function:

+ Here is the caller graph for this function: