File: libmac.h

package info (click to toggle)
ipv6calc 4.1.0-0.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,676 kB
  • sloc: ansic: 101,567; sh: 6,796; perl: 3,867; xml: 1,475; makefile: 909
file content (51 lines) | stat: -rw-r--r-- 1,697 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Project    : ipv6calc
 * File       : libmac.h
 * Version    : $Id: 860f35647868bb753a510b3c596e5bec9943fb84 $
 * Copyright  : 2001-2014 by Peter Bieringer <pb (at) bieringer.de>
 *
 * Information:
 *  Header file for libmac.c
 */ 


#ifndef _libmac_h

#define _libmac_h 1


#include "libipv6calc.h"


/* typedefs */

typedef struct {
	uint8_t addr[6];	/* MAC address in 6x 8 bit */
	int flag_valid;		/* address structure filled */
} ipv6calc_macaddr;


typedef struct {
	int active;
	uint32_t typeinfo_must_have;
	/* others coming next */
} s_ipv6calc_filter_macaddr;

#define EUI48_00_23(x)  ((x[0] << 16) | (x[1] << 8) | x[2])
#define EUI48_24_47(x)  ((x[3] << 16) | (x[4] << 8) | x[5])


#endif


/* prototypes */
extern int mac_to_macaddrstruct(const char *addrstring, char *resultstring, const size_t resultstring_length, ipv6calc_macaddr *macaddrp);
extern int addr_to_macaddrstruct(const char *addrstring, char *resultstring, const size_t resultstring_length, ipv6calc_macaddr *macaddrp); // compatible name
extern int macaddrstruct_to_string(const ipv6calc_macaddr *macaddrp, char *resultstring, const size_t resultstring_length, const uint32_t formatoptions);
extern int libmacaddr_macaddrstruct_to_string(const ipv6calc_macaddr *macaddrp, char *resultstring, const size_t resultstring_length, const uint32_t formatoptions); // compatible name
extern void mac_clearall(ipv6calc_macaddr *macaddrp);

extern int macaddr_filter(const ipv6calc_macaddr *macaddrp, const s_ipv6calc_filter_macaddr *filter);
extern void macaddr_filter_clear(s_ipv6calc_filter_macaddr *filter);

extern void libmacaddr_anonymize(ipv6calc_macaddr *macaddrp, const s_ipv6calc_anon_set *ipv6calc_anon_set_p);