public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
ffe440acab247c2aebfd701535e25b75e1167ca9 blob 1313 bytes (raw)

 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
 
/* SPDX-License-Identifier: GPL-2.0-or-later
 * Copyright (c) 2026 Red Hat GmbH
 * Author: Stefano Brivio <sbrivio@redhat.com>
 */

#ifndef PORTS_H
#define PORTS_H

#include <stdbool.h>

#include "inany.h"

/* Number of ports for both TCP and UDP */
#define	NUM_PORTS	(1U << 16)

/**
 * enum fwd_mode - Overall forwarding mode for a direction and protocol
 * @FWD_MODE_UNSET	Initial value, not parsed/configured yet
 * @FWD_MODE_SPEC	Forward specified ports
 * @FWD_MODE_NONE	No forwarded ports
 * @FWD_MODE_AUTO	Automatic detection and forwarding based on bound ports
 * @FWD_MODE_ALL	Bind all free ports
 */
enum fwd_mode {
	FWD_MODE_UNSET = 0,
	FWD_MODE_SPEC,
	FWD_MODE_NONE,
	FWD_MODE_AUTO,
	FWD_MODE_ALL,
};

struct fwd_table;

void fwd_probe_ephemeral(void);
bool fwd_port_is_ephemeral(in_port_t port);
void conf_ports_range_except(char optname, const char *optarg,
			     struct fwd_table *fwd,
			     const union inany_addr *addr, const char *ifname,
			     uint16_t first, uint16_t last,
			     const uint8_t *exclude, uint16_t to, uint8_t flags,
			     bool can_bindtodevice,
			     bool v4_enabled, bool v6_enabled);
void conf_ports(char optname, const char *optarg, struct fwd_table *fwd,
		enum fwd_mode *mode, bool can_bindtodevice,
		bool v4_enabled, bool v6_enabled);


#endif /* PORTS_H */
debug log:

solving ffe440a ...
found ffe440a in https://archives.passt.top/passt-dev/20260322141843.4095972-2-sbrivio@redhat.com/
found 3ef50e6 in https://archives.passt.top/passt-dev/20260322141843.4095972-1-sbrivio@redhat.com/

applying [1/2] https://archives.passt.top/passt-dev/20260322141843.4095972-1-sbrivio@redhat.com/
diff --git a/ports.h b/ports.h
new file mode 100644
index 0000000..3ef50e6


applying [2/2] https://archives.passt.top/passt-dev/20260322141843.4095972-2-sbrivio@redhat.com/
diff --git a/ports.h b/ports.h
index 3ef50e6..ffe440a 100644

Checking patch ports.h...
Applied patch ports.h cleanly.
Checking patch ports.h...
Applied patch ports.h cleanly.

index at:
100644 ffe440acab247c2aebfd701535e25b75e1167ca9	ports.h

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).