summaryrefslogtreecommitdiffstats
path: root/src/nftutils.h
blob: 7db56f428980a88c4433b6b75d729182e65807f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef NFTUTILS_H
#define NFTUTILS_H

#include <stddef.h>

/* The maximum buffer size for (struct protoent).p_name. It is excessively large,
 * while still reasonably fitting on the stack. Arbitrarily chosen. */
#define NFT_PROTONAME_MAXSIZE 1024

bool nft_getprotobynumber(int number, char *out_name, size_t name_len);
int nft_getprotobyname(const char *name);

/* The maximum buffer size for (struct servent).s_name. It is excessively large,
 * while still reasonably fitting on the stack. Arbitrarily chosen. */
#define NFT_SERVNAME_MAXSIZE 1024

bool nft_getservbyport(int port, const char *proto, char *out_name, size_t name_len);

#endif /* NFTUTILS_H */