-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathcommon.h
More file actions
58 lines (46 loc) · 1.1 KB
/
common.h
File metadata and controls
58 lines (46 loc) · 1.1 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* common.h -- Common header for mreceive.c and msend.c
*/
#ifndef MTOOLS_COMMON_H_
#define MTOOLS_COMMON_H_
#include <getopt.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/time.h>
#include "inet.h"
#include "sock.h"
#define TEST_ADDR_IPV4 "224.1.1.1"
#define TEST_ADDR_IPV6 "ff2e::1"
#define LOOPMAX 20
#define BUFSIZE 1024
#ifndef strlcpy /* older glibc systems */
#define strlcpy strncpy
#endif
/* From The Practice of Programming, by Kernighan and Pike */
#ifndef NELEMS
#define NELEMS(array) (sizeof(array) / sizeof(array[0]))
#endif
#define logit(fmt, args...) if (opt_verbose) { \
printf(fmt, ##args); fflush(stdout); \
}
extern char *group_addr;
extern int group_port;
extern int opt_count;
extern int opt_family;
extern char *opt_ifaddr;
extern char *opt_ifname;
extern int opt_isnum;
extern int opt_join;
extern int opt_period;
extern int opt_ttl;
extern int opt_verbose;
#endif /* MTOOLS_COMMON_H_ */
/**
* Local Variables:
* c-file-style: "linux"
* indent-tabs-mode: t
* End:
*/