File: pike_top.h

package info (click to toggle)
kamailio 4.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 56,100 kB
  • sloc: ansic: 552,832; xml: 166,484; sh: 8,659; makefile: 7,676; sql: 6,235; perl: 3,487; yacc: 3,428; python: 1,457; cpp: 1,219; php: 1,047; java: 449; pascal: 194; cs: 40; awk: 27
file content (28 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef __PIKE_TOP_H
#define __PIKE_TOP_H

#include "ip_tree.h"
#include "../../ip_addr.h"

struct TopListItem_t {
	int             addr_len;
	unsigned char   ip_addr[45];	/*!< Make room for IPv6 */
	unsigned int  	leaf_hits[2];
	unsigned int  	hits[2];
	unsigned int    expires;	/*!< in seconds */
	node_status_t   status;

	struct TopListItem_t *next;
};

// returns 1 when OK and 0 when failed
int pike_top_add_entry( unsigned char *ip_addr, int addr_len, unsigned short leaf_hits[2], unsigned short hits[2], unsigned int expires, node_status_t status );

struct TopListItem_t *pike_top_get_root();
void pike_top_list_clear();

/* helpful functions */
char *pike_top_print_addr( unsigned char *ip_addr, int addrlen, char *buff, int buffsize );


#endif // PIKE_TOP_H