Commit Graph
205 Commits
Author SHA1 Message Date
Ben Pfaff 489d9ca0be dhcp: Break out netdev configuration from DHCP binding.
This allows us to have DHCP clients that don't actually bind or unbind
a network device's IP address.  This is useful for doing controller
discovery without actually reconfiguring a network device.
2008-07-22 14:01:01 -07:00
Ben Pfaff 67a603dde8 Make openflow.h SWIG-friendly. 2008-07-21 11:39:39 -07:00
Ben Pfaff 6d841e9f81 Implement DHCP client. 2008-07-18 14:16:40 -07:00
Ben Pfaff d838ee2e03 vconn: Make errors in vconn names non-fatal errors.
This prevents bad vconn names obtained via discovery from killing
the secure channel.
2008-07-18 14:16:40 -07:00
Ben Pfaff d07d22508e vconn: New function vconn_ssl_is_configured().
The secure channel, in discovery mode, wants to enable TCP connections
by default only if SSL has not been configured.  This function allows
it to do that.
2008-07-18 14:16:40 -07:00
Ben Pfaff 1297ff43df vconn: Add new function vconn_transact() and use it to simplify dpctl.c. 2008-07-18 14:16:38 -07:00
Ben Pfaff 4d90ee6aef vconn: Add utility functions make_openflow() and update_openflow_length().
Use these functions to simplify code that creates and sends
OpenFlow packets.
2008-07-18 14:08:18 -07:00
Ben Pfaff c57a8d1089 rconn: Add questionability. 2008-07-18 14:07:03 -07:00
Ben Pfaff b8769714c1 rconn: Rewrite to use explicit state machine. 2008-07-18 14:07:03 -07:00
Ben Pfaff e334e4e0e7 rconn: Add new max_backoff argument to rconn_new().
This allows the caller more control over reconnection backoff.
2008-07-18 14:07:03 -07:00
Ben Pfaff bc286c00ea netdev: add ability to set IPv4 addresses and add a default gateway. 2008-07-18 14:07:03 -07:00
Ben Pfaff 2afec34627 netdev: Add ability to permanently set device flags. 2008-07-18 13:55:12 -07:00
Ben Pfaff 24eb1d1546 netdev: Add more functions for manipulating device flags.
These are convenient for use in secchan and elsewhere.
2008-07-18 13:43:41 -07:00
Ben Pfaff 9dc091a35f netdev: New function netdev_drain(). 2008-07-18 13:42:38 -07:00
Ben Pfaff e55d52c988 netdev: Add argument to netdev_open() to specify Ethernet type to capture.
This is needed by the controller, which wants to listen only for
OpenFlow discovery BPDUs on its network devices.

Also, update all existing callers.
2008-07-18 13:42:38 -07:00
Ben Pfaff b563a5247c netdev: Do not modify the caller's buffer in netdev_send().
This makes it possible to use a buffer whose contents are stack-allocated.
2008-07-18 13:42:38 -07:00
Ben Pfaff f422511c1a packets: Make flow_extract() output a pointer to L7 data also.
Useful for the DHCP client, which wants to pick apart UDP packets
and extract the DHCP payload.
2008-07-18 13:42:38 -07:00
Ben Pfaff cc57cfe85c packets: New macros for detecting IP fragments. 2008-07-18 13:42:38 -07:00
Ben Pfaff 7470a21307 packets: Move IP checksum functionality into new csum.c, csum.h. 2008-07-18 13:42:38 -07:00
Ben Pfaff 841ae14767 packets: Distinguish max Ethernet length with and without VLAN header. 2008-07-18 13:42:37 -07:00
Ben Pfaff 6231bb85af packets: New IP header macros. 2008-07-18 13:42:37 -07:00
Ben Pfaff 49d9301d46 packets: Make Ethernet broadcast address available as a global object. 2008-07-18 13:42:37 -07:00
Ben Pfaff 0ad4720dc6 buffer: New functions buffer_reserve(), buffer_push(),
buffer_try_pull().
2008-07-18 13:42:37 -07:00
Ben Pfaff 86ad61454e buffer: Rename buffer_reserve_headroom to buffer_prealloc_headroom.
Similarly for buffer_reserve_tailroom.

The new name better reflects what they do, and make way for a different
use of the term "reserve" in the upcoming buffer_reserve() function.
2008-07-18 13:42:37 -07:00
Ben Pfaff d6ea83302a buffer: Make buffer_pull() return the start of the pulled data.
Some callers find this useful.
2008-07-18 13:42:37 -07:00
Ben Pfaff 47cebfdbef New function xmemdup0(). 2008-07-18 13:42:37 -07:00
Ben Pfaff f10a48ce3a New function ds_clear(). 2008-07-18 13:42:37 -07:00
Ben Pfaff 61e2e15051 New function random_range(). 2008-07-18 13:42:37 -07:00
Ben Pfaff 1e0f761030 New header file timeval.h for time-related functionality. 2008-07-18 13:42:37 -07:00
Ben Pfaff fd90251602 New header file "type-props.h" for testing properties of types. 2008-07-18 13:42:37 -07:00
Ben Pfaff 792576de01 Log an error when the time is negative at vlog startup. 2008-07-18 13:24:16 -07:00
Ben Pfaff f81c152daf New function eth_addr_is_zero(). 2008-07-18 13:23:23 -07:00
Ben Pfaff a92ae5b340 New function netdev_arp_lookup().
The secchan needs to handle ARP requests from the controller itself, so
it has to translate the controller's IP address into a MAC address to
allow it to match those packets on dl_src.  (OpenFlow doesn't allow us
to look into ARP packets and match on the encapsulated IP addresses, so
this is the best we can do.)
2008-07-18 13:23:23 -07:00
Ben Pfaff 4532f9cdfb New function rconn_get_ip(). 2008-07-18 13:23:23 -07:00
Ben Pfaff 809743618e New function vconn_get_ip().
The secchan needs to know the IP address of the peer so that it can
handles ARP requests from the controller by itself.
2008-07-18 13:23:23 -07:00
Ben Pfaff e88c18152d Assert on structure sizes in openflow.h.
This causes the build to fail if structures are not the sizes that we
expect.
2008-07-17 09:47:25 -07:00
Ben Pfaff b993fa9c2b Adjust OpenFlow to have same structure layout on 32- and 64-bit platforms.
Pointed out by "Brandon Heller" <brandon.heller@gmail.com>.
2008-07-17 09:47:25 -07:00
Ben Pfaff 70cb7e7e05 Fix typo in comment. 2008-07-08 18:48:29 -07:00
Ben Pfaff bebf175930 Make the secure channel and controller send out keepalives.
It can happen that the secure channel thinks that it is connected
to the controller, but in fact the connection has dropped.  For
example, a switch intermediate between the secure channel and the
controller could have a flow inserted, due to a malfunction, that
causes packets in one direction or the other to be dropped.  When
this happens, the Linux kernel's TCP implementation will continue
retransmitting packets for somewhere between 13 and 30 minutes,
depending on the connection's retransmission timeout (according
to linux/Documentation/networking/ip-sysctl.txt) with the default
Linux settings.

We want to detect the lost connection and re-connect much faster
than that.  We use OpenFlow echo request and reply messages: if
no message is received from the controller for N seconds, we
send out an echo request.  If no reply (actually, any message at
all) is received for an additional N seconds, then we assume
that the connection has been lost, and reconnect.
2008-07-01 11:14:45 -07:00
Ben Pfaff 88df6edbfa Drop "benchmark" netlink message and "benchmark-nl" dpctl command.
The new OFPT_ECHO_REQUEST and OFPT_ECHO_REPLY OpenFlow messages
have the same functionality and are more general (in that they
are not Netlink-specific).
2008-07-01 10:59:04 -07:00
Ben Pfaff 258f32a084 Respond to echo requests in OpenFlow implementations.
Nothing yet sends such requests.  This is preparation for their
use in following commits.
2008-07-01 10:51:50 -07:00
Ben Pfaff 7225d06a78 Add utility functions for generating random numbers, and use where appropriate. 2008-07-01 10:51:47 -07:00
Ben Pfaff 5aca80fab9 Add --max-idle option to secchan and controller. 2008-06-26 09:26:50 -07:00
Ben Pfaff fe867d8d71 Add --detach and --pidfile options to daemons. 2008-06-13 13:03:51 -07:00
Ben Pfaff 7b351ea076 Factor learning switch out of controller into library.
This prepares for adding "fail-open" support to the secchan, which
will require the secchan to act as a learning switch.
2008-06-09 10:27:49 -07:00
Ben Pfaff b2f43905ea Make in-band communication work. 2008-05-28 10:46:54 -07:00
Ben Pfaff 59ba307325 Make the OFPP_LOCAL port work in the kernel OpenFlow implementation. 2008-05-28 10:46:54 -07:00
Ben Pfaff 711c48de9d Break MAC learning out of controller into library.
This is preparation for use of MAC learning in the secure channel.
2008-05-28 10:46:54 -07:00
Ben Pfaff 23e054dcb6 New functions for getting and setting network device flags.
This allows us to open network devices without bringing them up
and setting them for promiscuous mode, which will be useful in the
secchan for in-band communication.
2008-05-28 10:46:54 -07:00
Ben Pfaff 6b8436f66b Expose device IP addresses through netdev.
This will be useful for the secure channel later.
2008-05-28 10:46:54 -07:00