search for: eth_p_all

Displaying 10 results from an estimated 10 matches for "eth_p_all".

2007 Apr 18
2
[Bridge] Bridge and PACKET-socket
Ahoy, I've encountered some confusing semantics with using PACKET(7) sockets on bridge-enslaved interfaces. Specifically, if my socket accepts all types of frame (bind() to ETH_P_ALL) then it gets all packets; but if it accepts any specific type (e.g. ETH_P_IP), then it receives no packets at all. That is how it's coded in net/core/dev.c's netif_receive_skb(). First ETH_P_ALL handlers are called, then the bridge, and then -- only if the bridge declines the packet -- th...
2002 Sep 13
0
tcng version 8w
...- I''ve added fields for skb meta-data (meta_protocol, etc.) - if USE_META_PROTOCOL is #defined (tcc -D... or tcsim -Xc,-D...), ip_hdr and ip6_hdr check the protocol number - if_u32 generates distinct classifier branches for each protocol - f_fw, f_tcindex, and f_u32 now default to ETH_P_ALL instead of ETH_P_IP The latter change affects how u32 classification works ! tests/protu32 illustrates how protocol-aware classification is used. What''s missing: - C and tcc-ext-match need to support meta_protocol too - if_u32 does a few ugly things, and can also generate redundant...
2009 Nov 02
0
[PATCHv4 3/6] qemu/net: add raw backend
...struct RAWState { + VLANClientState *vc; + int fd; + uint8_t buf[4096]; + int promisc; +} RAWState; + +static int net_raw_fd_init(Monitor *mon, const char *ifname, int promisc) +{ + int fd, ret; + struct ifreq req; + struct sockaddr_ll lladdr; + + fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (fd < 0) + fprintf(stderr, "packet socket failed\n"); + + memset(&req, 0, sizeof(req)); + strncpy(req.ifr_name, ifname, IFNAMSIZ-1); + ret = ioctl(fd, SIOCGIFINDEX, &req); + if (ret < 0) + fprintf(stderr, "SIOCGIFINDEX failed\n"); + + memset(&lladdr,...
2009 Nov 02
0
[PATCHv4 3/6] qemu/net: add raw backend
...struct RAWState { + VLANClientState *vc; + int fd; + uint8_t buf[4096]; + int promisc; +} RAWState; + +static int net_raw_fd_init(Monitor *mon, const char *ifname, int promisc) +{ + int fd, ret; + struct ifreq req; + struct sockaddr_ll lladdr; + + fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (fd < 0) + fprintf(stderr, "packet socket failed\n"); + + memset(&req, 0, sizeof(req)); + strncpy(req.ifr_name, ifname, IFNAMSIZ-1); + ret = ioctl(fd, SIOCGIFINDEX, &req); + if (ret < 0) + fprintf(stderr, "SIOCGIFINDEX failed\n"); + + memset(&lladdr,...
2009 Aug 13
0
[PATCHv2 3/3] qemu-kvm: vhost-net implementation
...sockaddr_ll lladdr; + struct ifreq req; + int r; + const char *ifname = vhost_device; + if (!ifname) + return 0; + + net->dev.nvqs = 2; + net->dev.vqs = net->vqs; + r = vhost_dev_init(&net->dev, dev); + if (r < 0) + return r; + + net->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (net->sock < 0) + return -errno; + + memset(&req, 0, sizeof(req)); + strncpy(req.ifr_name, ifname, IFNAMSIZ-1); + r = ioctl(net->sock, SIOCGIFINDEX, &req); + if (r < 0) + return -errno; + + memset(&lladdr, 0, sizeof(lladdr)); + lladdr.sll_family = AF_PACKET; + ll...
2009 Aug 13
0
[PATCHv2 3/3] qemu-kvm: vhost-net implementation
...sockaddr_ll lladdr; + struct ifreq req; + int r; + const char *ifname = vhost_device; + if (!ifname) + return 0; + + net->dev.nvqs = 2; + net->dev.vqs = net->vqs; + r = vhost_dev_init(&net->dev, dev); + if (r < 0) + return r; + + net->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (net->sock < 0) + return -errno; + + memset(&req, 0, sizeof(req)); + strncpy(req.ifr_name, ifname, IFNAMSIZ-1); + r = ioctl(net->sock, SIOCGIFINDEX, &req); + if (r < 0) + return -errno; + + memset(&lladdr, 0, sizeof(lladdr)); + lladdr.sll_family = AF_PACKET; + ll...
2009 Aug 17
1
[PATCHv3 3/4] qemu-kvm: vhost-net implementation
...sockaddr_ll lladdr; + struct ifreq req; + int r; + const char *ifname = vhost_device; + if (!ifname) + return 0; + + net->dev.nvqs = 2; + net->dev.vqs = net->vqs; + r = vhost_dev_init(&net->dev, dev); + if (r < 0) + return r; + + net->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (net->sock < 0) + return -errno; + + memset(&req, 0, sizeof(req)); + strncpy(req.ifr_name, ifname, IFNAMSIZ-1); + r = ioctl(net->sock, SIOCGIFINDEX, &req); + if (r < 0) + return -errno; + + memset(&lladdr, 0, sizeof(lladdr)); + lladdr.sll_family = AF_PACKET; + ll...
2009 Aug 17
1
[PATCHv3 3/4] qemu-kvm: vhost-net implementation
...sockaddr_ll lladdr; + struct ifreq req; + int r; + const char *ifname = vhost_device; + if (!ifname) + return 0; + + net->dev.nvqs = 2; + net->dev.vqs = net->vqs; + r = vhost_dev_init(&net->dev, dev); + if (r < 0) + return r; + + net->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (net->sock < 0) + return -errno; + + memset(&req, 0, sizeof(req)); + strncpy(req.ifr_name, ifname, IFNAMSIZ-1); + r = ioctl(net->sock, SIOCGIFINDEX, &req); + if (r < 0) + return -errno; + + memset(&lladdr, 0, sizeof(lladdr)); + lladdr.sll_family = AF_PACKET; + ll...
2009 Aug 10
0
[PATCH 3/3] qemu-kvm: vhost-net implementation
...sockaddr_ll lladdr; + struct ifreq req; + int r; + const char *ifname = vhost_device; + if (!ifname) + return 0; + + net->dev.nvqs = 2; + net->dev.vqs = net->vqs; + r = vhost_dev_init(&net->dev, dev); + if (r < 0) + return r; + + net->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (net->sock < 0) + return -errno; + + memset(&req, 0, sizeof(req)); + strncpy(req.ifr_name, ifname, IFNAMSIZ-1); + r = ioctl(net->sock, SIOCGIFINDEX, &req); + if (r < 0) + return -errno; + + memset(&lladdr, 0, sizeof(lladdr)); + lladdr.sll_family = AF_PACKET; + ll...
2009 Aug 10
0
[PATCH 3/3] qemu-kvm: vhost-net implementation
...sockaddr_ll lladdr; + struct ifreq req; + int r; + const char *ifname = vhost_device; + if (!ifname) + return 0; + + net->dev.nvqs = 2; + net->dev.vqs = net->vqs; + r = vhost_dev_init(&net->dev, dev); + if (r < 0) + return r; + + net->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (net->sock < 0) + return -errno; + + memset(&req, 0, sizeof(req)); + strncpy(req.ifr_name, ifname, IFNAMSIZ-1); + r = ioctl(net->sock, SIOCGIFINDEX, &req); + if (r < 0) + return -errno; + + memset(&lladdr, 0, sizeof(lladdr)); + lladdr.sll_family = AF_PACKET; + ll...