aboutsummaryrefslogtreecommitdiff
path: root/hw/net/vmxnet_rx_pkt.c
diff options
context:
space:
mode:
authorShmulik Ladkani <shmulik.ladkani@ravellosystems.com>2015-07-14 11:55:15 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2015-07-20 17:39:05 +0100
commitfcf0cdc362dd96cb8d2935b892d3dd9ab73ad393 (patch)
tree88b6c295de6a83e82eceacfd384e3c81ae5cd649 /hw/net/vmxnet_rx_pkt.c
parent091f1f52963d7093ea578e4a05e67bc015b21192 (diff)
net/vmxnet3: Refactor 'vmxnet_rx_pkt_attach_data'
Separate RX packet protocol parsing out of 'vmxnet_rx_pkt_attach_data'. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Message-id: 1436864116-19154-2-git-send-email-shmulik.ladkani@ravellosystems.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/net/vmxnet_rx_pkt.c')
-rw-r--r--hw/net/vmxnet_rx_pkt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/hw/net/vmxnet_rx_pkt.c b/hw/net/vmxnet_rx_pkt.c
index acbca6a3db..aa5462931e 100644
--- a/hw/net/vmxnet_rx_pkt.c
+++ b/hw/net/vmxnet_rx_pkt.c
@@ -92,9 +92,6 @@ void vmxnet_rx_pkt_attach_data(struct VmxnetRxPkt *pkt, const void *data,
}
pkt->tci = tci;
-
- eth_get_protocols(data, len, &pkt->isip4, &pkt->isip6,
- &pkt->isudp, &pkt->istcp);
}
void vmxnet_rx_pkt_dump(struct VmxnetRxPkt *pkt)
@@ -131,6 +128,15 @@ size_t vmxnet_rx_pkt_get_total_len(struct VmxnetRxPkt *pkt)
return pkt->tot_len;
}
+void vmxnet_rx_pkt_set_protocols(struct VmxnetRxPkt *pkt, const void *data,
+ size_t len)
+{
+ assert(pkt);
+
+ eth_get_protocols(data, len, &pkt->isip4, &pkt->isip6,
+ &pkt->isudp, &pkt->istcp);
+}
+
void vmxnet_rx_pkt_get_protocols(struct VmxnetRxPkt *pkt,
bool *isip4, bool *isip6,
bool *isudp, bool *istcp)