aboutgitcodebugslistschat
path: root/fwd.h
diff options
context:
space:
mode:
Diffstat (limited to 'fwd.h')
-rw-r--r--fwd.h31
1 files changed, 6 insertions, 25 deletions
diff --git a/fwd.h b/fwd.h
index beba0bf..33600cb 100644
--- a/fwd.h
+++ b/fwd.h
@@ -16,6 +16,7 @@
#include "bitmap.h"
#include "inany.h"
+#include "fwd_rule.h"
struct flowside;
@@ -26,32 +27,12 @@ void fwd_probe_ephemeral(void);
void fwd_port_map_ephemeral(uint8_t *map);
/**
- * struct fwd_rule - Forwarding rule governing a range of ports
- * @addr: Address to forward from
- * @ifname: Interface to forward from
- * @first: First port number to forward
- * @last: Last port number to forward
- * @to: Target port for @first, port n goes to @to + (n - @first)
- * @proto: Protocol to forward
- * @flags: Flag mask
- * FWD_DUAL_STACK_ANY - match any IPv4 or IPv6 address (@addr should be ::)
- * FWD_WEAK - Don't give an error if binds fail for some forwards
- * FWD_SCAN - Only forward if the matching port in the target is listening
+ * struct fwd_rule_state - Forwarding rule and associated state
+ * @rule: Rule specification
* @socks: Array of listening sockets for this entry
- *
- * FIXME: @addr and @ifname currently ignored for outbound tables
*/
-struct fwd_rule {
- union inany_addr addr;
- char ifname[IFNAMSIZ];
- in_port_t first;
- in_port_t last;
- in_port_t to;
- uint8_t proto;
-#define FWD_DUAL_STACK_ANY BIT(0)
-#define FWD_WEAK BIT(1)
-#define FWD_SCAN BIT(2)
- uint8_t flags;
+struct fwd_rule_state {
+ struct fwd_rule rule;
int *socks;
};
@@ -88,7 +69,7 @@ struct fwd_listen_ref {
*/
struct fwd_table {
unsigned count;
- struct fwd_rule rules[MAX_FWD_RULES];
+ struct fwd_rule_state rules[MAX_FWD_RULES];
unsigned sock_count;
int socks[MAX_LISTEN_SOCKS];
};