aboutsummaryrefslogtreecommitdiffstats
path: root/intersect.c
blob: 56d0d35b3a977179fc612403aa7a1784eb8dc32f (plain)
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
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <arpa/inet.h> /* ntohl */
#include <string.h>

#include "reglib.h"

int main(int argc, char **argv)
{
	const struct ieee80211_regdomain *rd;

	if (argc != 2) {
		fprintf(stderr, "You must specify a file\n");
		return -EINVAL;
	}

	rd = reglib_intersect_regdb(argv[1]);
	if (!rd) {
		fprintf(stderr, "Intersection not possible\n");
		return -ENOENT;
	}

	reglib_print_regdom(rd);
	free((struct ieee80211_regdomain *) rd);

	return 0;
}