mirror of
https://github.com/opnsense/src.git
synced 2026-03-16 23:55:19 -04:00
Testing LibAliasOut functionality. This concentrates the typical use case of initiating data transfers from the inside. Provide a exhaustive test for the data structure in order to check for performance improvements. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30335
29 lines
594 B
C
29 lines
594 B
C
#include <sys/types.h>
|
|
|
|
#include <arpa/inet.h>
|
|
#include <netinet/ip.h>
|
|
#include <netinet/udp.h>
|
|
|
|
#ifndef _UTIL_H
|
|
#define _UTIL_H
|
|
|
|
int randcmp(const void *a, const void *b);
|
|
void hexdump(void *p, size_t len);
|
|
struct ip * ip_packet(struct in_addr src, struct in_addr dst, u_char protocol, size_t len);
|
|
struct udphdr * set_udp(struct ip *p, u_short sport, u_short dport);
|
|
|
|
inline int
|
|
addr_eq(struct in_addr a, struct in_addr b)
|
|
{
|
|
return a.s_addr == b.s_addr;
|
|
}
|
|
|
|
#define a2h(a) ntohl(a.s_addr)
|
|
|
|
inline int
|
|
rand_range(int min, int max)
|
|
{
|
|
return min + rand()%(max - min);
|
|
}
|
|
|
|
#endif /* _UTIL_H */
|