~ubuntu-branches/ubuntu/saucy/qemu/saucy-proposed

« back to all changes in this revision

Viewing changes to hw/net/vmxnet_rx_pkt.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-05-28 08:18:30 UTC
  • mfrom: (1.8.2) (10.1.37 sid)
  • Revision ID: package-import@ubuntu.com-20130528081830-87xl2z9fq516a814
Tags: 1.5.0+dfsg-2ubuntu1
* Merge 1.5.0+dfs-2 from debian unstable.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - Dropped patches:
    * 0001-fix-wrong-output-with-info-chardev-for-tcp-socket.patch
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * gridcentric patch - updated
    * linaro arm patches from qemu-linaro rebasing branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * QEMU VMWARE VMXNET* paravirtual NICs - RX packets abstraction
 
3
 *
 
4
 * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com)
 
5
 *
 
6
 * Developed by Daynix Computing LTD (http://www.daynix.com)
 
7
 *
 
8
 * Authors:
 
9
 * Dmitry Fleytman <dmitry@daynix.com>
 
10
 * Tamir Shomer <tamirs@daynix.com>
 
11
 * Yan Vugenfirer <yan@daynix.com>
 
12
 *
 
13
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 
14
 * See the COPYING file in the top-level directory.
 
15
 *
 
16
 */
 
17
 
 
18
#ifndef VMXNET_RX_PKT_H
 
19
#define VMXNET_RX_PKT_H
 
20
 
 
21
#include "stdint.h"
 
22
#include "stdbool.h"
 
23
#include "net/eth.h"
 
24
 
 
25
/* defines to enable packet dump functions */
 
26
/*#define VMXNET_RX_PKT_DEBUG*/
 
27
 
 
28
struct VmxnetRxPkt;
 
29
 
 
30
/**
 
31
 * Clean all rx packet resources
 
32
 *
 
33
 * @pkt:            packet
 
34
 *
 
35
 */
 
36
void vmxnet_rx_pkt_uninit(struct VmxnetRxPkt *pkt);
 
37
 
 
38
/**
 
39
 * Init function for rx packet functionality
 
40
 *
 
41
 * @pkt:            packet pointer
 
42
 * @has_virt_hdr:   device uses virtio header
 
43
 *
 
44
 */
 
45
void vmxnet_rx_pkt_init(struct VmxnetRxPkt **pkt, bool has_virt_hdr);
 
46
 
 
47
/**
 
48
 * returns total length of data attached to rx context
 
49
 *
 
50
 * @pkt:            packet
 
51
 *
 
52
 * Return:  nothing
 
53
 *
 
54
 */
 
55
size_t vmxnet_rx_pkt_get_total_len(struct VmxnetRxPkt *pkt);
 
56
 
 
57
/**
 
58
 * fetches packet analysis results
 
59
 *
 
60
 * @pkt:            packet
 
61
 * @isip4:          whether the packet given is IPv4
 
62
 * @isip6:          whether the packet given is IPv6
 
63
 * @isudp:          whether the packet given is UDP
 
64
 * @istcp:          whether the packet given is TCP
 
65
 *
 
66
 */
 
67
void vmxnet_rx_pkt_get_protocols(struct VmxnetRxPkt *pkt,
 
68
                                 bool *isip4, bool *isip6,
 
69
                                 bool *isudp, bool *istcp);
 
70
 
 
71
/**
 
72
 * returns virtio header stored in rx context
 
73
 *
 
74
 * @pkt:            packet
 
75
 * @ret:            virtio header
 
76
 *
 
77
 */
 
78
struct virtio_net_hdr *vmxnet_rx_pkt_get_vhdr(struct VmxnetRxPkt *pkt);
 
79
 
 
80
/**
 
81
 * returns packet type
 
82
 *
 
83
 * @pkt:            packet
 
84
 * @ret:            packet type
 
85
 *
 
86
 */
 
87
eth_pkt_types_e vmxnet_rx_pkt_get_packet_type(struct VmxnetRxPkt *pkt);
 
88
 
 
89
/**
 
90
 * returns vlan tag
 
91
 *
 
92
 * @pkt:            packet
 
93
 * @ret:            VLAN tag
 
94
 *
 
95
 */
 
96
uint16_t vmxnet_rx_pkt_get_vlan_tag(struct VmxnetRxPkt *pkt);
 
97
 
 
98
/**
 
99
 * tells whether vlan was stripped from the packet
 
100
 *
 
101
 * @pkt:            packet
 
102
 * @ret:            VLAN stripped sign
 
103
 *
 
104
 */
 
105
bool vmxnet_rx_pkt_is_vlan_stripped(struct VmxnetRxPkt *pkt);
 
106
 
 
107
/**
 
108
 * notifies caller if the packet has virtio header
 
109
 *
 
110
 * @pkt:            packet
 
111
 * @ret:            true if packet has virtio header, false otherwize
 
112
 *
 
113
 */
 
114
bool vmxnet_rx_pkt_has_virt_hdr(struct VmxnetRxPkt *pkt);
 
115
 
 
116
/**
 
117
 * returns number of frags attached to the packet
 
118
 *
 
119
 * @pkt:            packet
 
120
 * @ret:            number of frags
 
121
 *
 
122
 */
 
123
uint16_t vmxnet_rx_pkt_get_num_frags(struct VmxnetRxPkt *pkt);
 
124
 
 
125
/**
 
126
 * attach data to rx packet
 
127
 *
 
128
 * @pkt:            packet
 
129
 * @data:           pointer to the data buffer
 
130
 * @len:            data length
 
131
 * @strip_vlan:     should the module strip vlan from data
 
132
 *
 
133
 */
 
134
void vmxnet_rx_pkt_attach_data(struct VmxnetRxPkt *pkt, const void *data,
 
135
    size_t len, bool strip_vlan);
 
136
 
 
137
/**
 
138
 * returns io vector that holds the attached data
 
139
 *
 
140
 * @pkt:            packet
 
141
 * @ret:            pointer to IOVec
 
142
 *
 
143
 */
 
144
struct iovec *vmxnet_rx_pkt_get_iovec(struct VmxnetRxPkt *pkt);
 
145
 
 
146
/**
 
147
 * prints rx packet data if debug is enabled
 
148
 *
 
149
 * @pkt:            packet
 
150
 *
 
151
 */
 
152
void vmxnet_rx_pkt_dump(struct VmxnetRxPkt *pkt);
 
153
 
 
154
/**
 
155
 * copy passed vhdr data to packet context
 
156
 *
 
157
 * @pkt:            packet
 
158
 * @vhdr:           VHDR buffer
 
159
 *
 
160
 */
 
161
void vmxnet_rx_pkt_set_vhdr(struct VmxnetRxPkt *pkt,
 
162
    struct virtio_net_hdr *vhdr);
 
163
 
 
164
/**
 
165
 * save packet type in packet context
 
166
 *
 
167
 * @pkt:            packet
 
168
 * @packet_type:    the packet type
 
169
 *
 
170
 */
 
171
void vmxnet_rx_pkt_set_packet_type(struct VmxnetRxPkt *pkt,
 
172
    eth_pkt_types_e packet_type);
 
173
 
 
174
#endif