-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathutils.h
More file actions
executable file
·31 lines (24 loc) · 1.26 KB
/
utils.h
File metadata and controls
executable file
·31 lines (24 loc) · 1.26 KB
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
29
30
31
// generic linked list structure which will always work for any structure type with 'next' as its first element
// you just need to cast to (LINK *<*>)
typedef struct _link { struct _link *next; } LINK;
char *FileContents(char *filename, int *size);
int timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y);
int PtrDuplicate(char *ptr, int size, char **dest, int *dest_size);
int DataPrepare(char **data, char *ptr, int size);
void PtrFree(char **ptr);
void L_link_ordered(LINK **list, LINK *ele);
LINK *L_last(LINK *list);
int L_count(LINK *ele);
void L_unlink(LINK **list, LINK *ptr);
void md5hash(char *data, int size);
void CopyIPv6Address(void *dst, void *src);
int CompareIPv6Addresses(struct in6_addr *first, struct in6_addr *second);
void L_link_ordered_offset(LINK **list, LINK *ele, int offset);
int L_count_offset(LINK *lptr, int offset);
int IP_prepare(char *ascii_ip, uint32_t *ipv4_dest, struct in6_addr *ipv6_dest, int *_is_ipv6);
void L_link_unordered(LINK **list, LINK *ele);
char *IP_prepare_ascii(uint32_t ipv4_dest, struct in6_addr *ipv6_src);
int file_exist(char *filename);
int FileWrite(char *filename, char *ptr, int size);
uint32_t get_source_ipv4(void);
void get_source_ipv6(struct in6_addr *addr6);