aboutsummaryrefslogtreecommitdiff
path: root/include/net/eth.h
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2023-02-23 19:50:49 +0900
committerJason Wang <jasowang@redhat.com>2023-03-10 15:35:38 +0800
commit65f474bbae9a33b08707084efb95701e187f79e3 (patch)
tree2f52c41e376d2c32cfdcb6cccd0618229e3b043d /include/net/eth.h
parent5fb7d149953f469381a11e486d66dc56af2c0f21 (diff)
downloadqemu-65f474bbae9a33b08707084efb95701e187f79e3.zip
qemu-65f474bbae9a33b08707084efb95701e187f79e3.tar.gz
qemu-65f474bbae9a33b08707084efb95701e187f79e3.tar.bz2
net/eth: Introduce EthL4HdrProto
igb, a new network device emulation, will need SCTP checksum offloading. Currently eth_get_protocols() has a bool parameter for each protocol currently it supports, but there will be a bit too many parameters if we add yet another protocol. Introduce an enum type, EthL4HdrProto to represent all L4 protocols eth_get_protocols() support with one parameter. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include/net/eth.h')
-rw-r--r--include/net/eth.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/net/eth.h b/include/net/eth.h
index fbac30c..c5ae449 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -381,18 +381,24 @@ typedef struct eth_ip4_hdr_info_st {
bool fragment;
} eth_ip4_hdr_info;
+typedef enum EthL4HdrProto {
+ ETH_L4_HDR_PROTO_INVALID,
+ ETH_L4_HDR_PROTO_TCP,
+ ETH_L4_HDR_PROTO_UDP
+} EthL4HdrProto;
+
typedef struct eth_l4_hdr_info_st {
union {
struct tcp_header tcp;
struct udp_header udp;
} hdr;
+ EthL4HdrProto proto;
bool has_tcp_data;
} eth_l4_hdr_info;
void eth_get_protocols(const struct iovec *iov, int iovcnt,
bool *hasip4, bool *hasip6,
- bool *hasudp, bool *hastcp,
size_t *l3hdr_off,
size_t *l4hdr_off,
size_t *l5hdr_off,