File: addr.h

package info (click to toggle)
ulogd2 2.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,932 kB
  • sloc: ansic: 13,019; sh: 4,674; sql: 2,302; makefile: 197; perl: 90
file content (27 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (4)
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
/* IP address handling functions
 *
 * (C) 2012 by Pablo Neira Ayuso <pablo@netfilter.org>
 * (C) 2012 by Eric Leblond <eric@regit.org>
 *
 * This code is distributed under the terms of GNU GPL version 2 */

#ifndef _ADDR_H
#define _ADDR_H

#include <stdint.h>

uint32_t ulogd_bits2netmask(int bits);
void ulogd_ipv6_cidr2mask_host(uint8_t cidr, uint32_t *res);
void ulogd_ipv6_addr2addr_host(uint32_t *addr, uint32_t *res);

struct ulogd_addr {
	union {
		uint32_t ipv4;
		uint32_t ipv6[4];
	} in;
	uint32_t netmask;
};

int ulogd_parse_addr(char *string, size_t len, struct ulogd_addr *addr);

#endif