kvm tools: Add ivshmem device
[linux-2.6/next.git] / tools / kvm / net / uip / icmp.c
blob233297caf44bcc037d85403288f6bc930915dad5
1 #include "kvm/uip.h"
3 int uip_tx_do_ipv4_icmp(struct uip_tx_arg *arg)
5 struct uip_ip *ip, *ip2;
6 struct uip_icmp *icmp2;
7 struct uip_buf *buf;
9 buf = uip_buf_clone(arg);
11 icmp2 = (struct uip_icmp *)(buf->eth);
12 ip2 = (struct uip_ip *)(buf->eth);
13 ip = (struct uip_ip *)(arg->eth);
15 ip2->sip = ip->dip;
16 ip2->dip = ip->sip;
17 ip2->csum = 0;
19 * ICMP reply: 0
21 icmp2->type = 0;
22 icmp2->csum = 0;
23 ip2->csum = uip_csum_ip(ip2);
24 icmp2->csum = uip_csum_icmp(icmp2);
26 uip_buf_set_used(arg->info, buf);
28 return 0;