File: test-common.h

package info (click to toggle)
kronosnet 1.33-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,092 kB
  • sloc: ansic: 25,419; sh: 5,295; makefile: 666
file content (37 lines) | stat: -rw-r--r-- 723 bytes parent folder | download
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
/*
 * Copyright (C) 2018-2026 Red Hat, Inc.  All rights reserved.
 *
 * Authors: Fabio M. Di Nitto <fabbione@kronosnet.org>
 *
 * This software licensed under GPL-2.0+
 */

#ifndef __NOZZLE_TEST_COMMON_H__
#define __NOZZLE_TEST_COMMON_H__

#include "internals.h"
#include "libnozzle.h"

/*
 * error codes from automake test-driver
 */

#define PASS	0
#define SKIP	77
#define ERROR	99
#define FAIL	-1

/*
 * common facilities
 */

#define IPBUFSIZE 1024

void need_root(void);
void need_tun(void);
int test_iface(char *name, size_t size, const char *updownpath);
int is_if_in_system(char *name);
int get_random_byte(void);
void make_local_ips(char *testipv4_1, char *testipv4_2, char *testipv6_1, char *testipv6_2);

#endif