aboutgitcodebugslistschat
path: root/tcp.h
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-08-12 15:42:43 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-09-01 17:00:27 +0200
commit1e49d194d01788afbc4b8216e27c794651a4facf (patch)
tree3397d4b687a74fe9552e057138c3a795917a5afa /tcp.h
parent1b1b27c06a27067a7d7a380f1df545e72268c411 (diff)
downloadpasst-1e49d194d01788afbc4b8216e27c794651a4facf.tar
passt-1e49d194d01788afbc4b8216e27c794651a4facf.tar.gz
passt-1e49d194d01788afbc4b8216e27c794651a4facf.tar.bz2
passt-1e49d194d01788afbc4b8216e27c794651a4facf.tar.lz
passt-1e49d194d01788afbc4b8216e27c794651a4facf.tar.xz
passt-1e49d194d01788afbc4b8216e27c794651a4facf.tar.zst
passt-1e49d194d01788afbc4b8216e27c794651a4facf.zip
passt, pasta: Introduce command-line options and port re-mapping
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.h')
-rw-r--r--tcp.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/tcp.h b/tcp.h
index 0dcd798..359414c 100644
--- a/tcp.h
+++ b/tcp.h
@@ -16,6 +16,8 @@ int tcp_sock_init(struct ctx *c);
void tcp_timer(struct ctx *c, struct timespec *ts);
void tcp_update_l2_buf(unsigned char *eth_d, unsigned char *eth_s,
uint32_t *ip_da);
+void tcp_remap_to_tap(in_port_t port, in_port_t delta);
+void tcp_remap_to_init(in_port_t port, in_port_t delta);
/**
* union tcp_epoll_ref - epoll reference portion for TCP connections
@@ -40,24 +42,16 @@ union tcp_epoll_ref {
* @hash_secret: 128-bit secret for hash functions, ISN and hash table
* @tap_conn_count: Count of tap connections in connection table
* @splice_conn_count: Count of spliced connections in connection table
- * @port4_to_tap: IPv4 ports bound host/init-side, packets to guest/tap
- * @port6_to_tap: IPv6 ports bound host/init-side, packets to guest/tap
- * @port4_to_init: IPv4 ports bound namespace-side, spliced to init
- * @port6_to_init: IPv6 ports bound namespace-side, spliced to init
- * @port4_to_ns: IPv4 ports bound init-side, spliced to namespace
- * @port6_to_ns: IPv6 ports bound init-side, spliced to namespace
+ * @port_to_tap: Ports bound host-side, packets to tap or spliced
+ * @port_to_init: Ports bound namespace-side, spliced to init
* @timer_run: Timestamp of most recent timer run
*/
struct tcp_ctx {
uint64_t hash_secret[2];
int tap_conn_count;
int splice_conn_count;
- uint8_t port4_to_tap [USHRT_MAX / 8];
- uint8_t port6_to_tap [USHRT_MAX / 8];
- uint8_t port4_to_init [USHRT_MAX / 8];
- uint8_t port6_to_init [USHRT_MAX / 8];
- uint8_t port4_to_ns [USHRT_MAX / 8];
- uint8_t port6_to_ns [USHRT_MAX / 8];
+ uint8_t port_to_tap [USHRT_MAX / 8];
+ uint8_t port_to_init [USHRT_MAX / 8];
struct timespec timer_run;
};