Re: [ovs-dev] [flow-stats 06/14] packets: New function eth_from_hex().

2011-12-15 Thread Ben Pfaff
On Wed, Dec 14, 2011 at 05:50:39PM -0800, Ansis Atteka wrote: > On Thu, Dec 8, 2011 at 2:01 PM, Ben Pfaff wrote: > > +const char * > > +eth_from_hex(const char *hex, struct ofpbuf **packetp) > > +{ > > +struct ofpbuf *packet; > > + > > +packet = *packetp = ofpbuf_new(strlen(hex) / 2); > >

Re: [ovs-dev] [flow-stats 06/14] packets: New function eth_from_hex().

2011-12-14 Thread Ansis Atteka
On Thu, Dec 8, 2011 at 2:01 PM, Ben Pfaff wrote: > An upcoming commit will add another user. > --- > lib/packets.c | 25 + > lib/packets.h |2 ++ > ofproto/ofproto-dpif.c | 12 > 3 files changed, 31 insertions(+), 8 deletions(-) > >

Re: [ovs-dev] [flow-stats 06/14] packets: New function eth_from_hex().

2011-12-14 Thread Ethan Jackson
> ETH_TOTAL_MIN isn't really very useful in practice because it only > applies to packets that go over a physical Ethernet (or some > semi-accurate virtualization thereof).  I'm not even sure that all > physical media that we call "Ethernet" even has this requirement (is > there any reason for it o

Re: [ovs-dev] [flow-stats 06/14] packets: New function eth_from_hex().

2011-12-14 Thread Ben Pfaff
On Tue, Dec 13, 2011 at 03:41:54PM -0800, Ethan Jackson wrote: > > + ? ?if (packet->size < ETH_HEADER_LEN) { > > In theory, I think we would want ETH_TOTAL_MIN here. However, that > could potentially be annoying for it's only user ofproto/trace. So I > think it's fine. Thank you for the review.

Re: [ovs-dev] [flow-stats 06/14] packets: New function eth_from_hex().

2011-12-13 Thread Ethan Jackson
Looks good to me. > +    if (packet->size < ETH_HEADER_LEN) { In theory, I think we would want ETH_TOTAL_MIN here. However, that could potentially be annoying for it's only user ofproto/trace. So I think it's fine. Ethan ___ dev mailing list dev@open

[ovs-dev] [flow-stats 06/14] packets: New function eth_from_hex().

2011-12-08 Thread Ben Pfaff
An upcoming commit will add another user. --- lib/packets.c | 25 + lib/packets.h |2 ++ ofproto/ofproto-dpif.c | 12 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/lib/packets.c b/lib/packets.c index 46a44bd..b9f37bb