15 Commits
Author SHA1 Message Date
Bryan Boreham 34dc4dabce Clean up some lint warnings
I ran golangci-lint and it pointed out a few things to clean up.
2020-07-31 10:28:55 +00:00
Bryan Boreham 0ca831f50b Reduce pcap timeout to avoid overflow
The value is passed by google/gopacket into a signed 32-bit int, so we
must pick a timeout which is less than 2^31 microseconds.

See https://github.com/google/gopacket/issues/708
2020-03-11 12:21:07 +00:00
Bryan Boreham 334974472d Rename router.Bridge to router.InjectorConsumer
since what it does it injects and consumes packets, and something else
entirely does bridging.
2017-04-25 11:03:32 +01:00
Matthias Radestock e5c256daa1 add Bridge.Interface() 2016-01-13 13:50:18 +00:00
David Wragg e702234fdc Don't use a nil FlowOp to mean "discard the packet" 2015-10-14 13:53:34 +01:00
David Wragg c2ad4c5633 Flows
For fast datapath, the router core will only be invoked upon datapath
misses.  And it needs to yield routing decisions in a form that can be
used to configure the in-kernel datapath.  So here we make the router
core yield FlowOps, which represent operations which actually do
something with a packet.  The router core obtains these in turn from
the Bridge or the Overlay, depending on what it wants to do with
a packet.

For fast datapath, it's critical that the router makes decisions based
only on the required packet header information (as the same header
information will be used when configuring the ODP flow rules).  So we
pass only that information into the router core, in the form of
PacketKeys.

The overall effect is to curry the router core: Rather than taking a
packet and doing something with it, it takes packet header information
and returns a function that does something with a packet.
2015-09-08 10:44:52 +01:00
David Wragg 57e78e2bec Introduce Bridge 2015-09-08 10:44:37 +01:00
Matthias Radestock c1d799a06c add pcap stats to weave report
Closes #1185.
2015-08-11 12:57:52 +01:00
Alvaro Saurin f6ffd604dd Removed all the imports from "code.google.com" 2015-07-02 13:32:52 +02:00
Paul Bellamy 06101d134b Running goimports 2015-06-17 15:32:08 +01:00
Matthias Radestock c6604a6442 cosmetic: more linter happiness 2015-05-27 16:52:08 +01:00
Matthias Radestock e40f1fe9a7 fix typo and reformat 2015-05-02 17:46:21 +01:00
David Wragg be983931fc Produce a better error message when there is no real SetImmediateMode
If gopacket is compiled against an older pcap.h that doesn't have
pcap_set_immediate_mode, it supplies a dummy definition that
always returns PCAP_ERROR.  That becomes "Generic error", which
is not very helpful.  The real pcap_set_set_immediate never
returns PCAP_ERROR, so this turns it into a more informative
message.
2015-05-01 21:40:53 +01:00
Matthias Radestock a587fef9c4 fix package name following move 2014-10-15 15:20:49 +01:00
Matthias Radestock e2fd1fda31 move router code 2014-10-15 15:07:42 +01:00