2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 13:27:59 +00:00

229 Commits

Author SHA1 Message Date
Ben Pfaff
622ee2cf64 netdev: New functions for interpreting "enum ofp_port_features" bitmaps. 2009-12-21 16:28:01 -08:00
Jesse Gross
a740f0de5b gre: Add userspace GRE support.
This implements the userspace portion of GRE on Linux. It communicates
with the kernel module to setup tunnels using either Netlink or ioctls
as appropriate based on the kernel version.

Significant portions of this commit were actually written by
Justin Pettit.
2009-12-07 12:48:08 -08:00
Justin Pettit
6c88d577e8 netdev: Allow explicit creation of netdev objects
This change adds netdev_create() and netdev_destroy() functions to allow
the creation of network devices through the netdev library.  Previously,
network devices had to already exist or be created on demand through
netdev_open().  This caused problems such as not being able to specify
TAP devices as ports in ovs-vswitchd, which this patch fixes.

This also lays the groundwork for adding GRE and VDE support.
2009-12-01 19:01:01 -08:00
Ben Pfaff
9ab3d9a3c2 netdev: New function netdev_get_ifindex().
sFlow needs the ifindex of an interface, so this commit adds a function
to retrieve it.
2009-11-23 12:25:08 -08:00
Ben Pfaff
7671589afb netdev: Really set output values to 0 on failure in netdev_get_features().
The comment on netdev_get_features() claimed that all of the passed-in
values were set to 0 on failure, but the implementation didn't live up
to the promise.

CC: Paul Ingram <paul@nicira.com>
2009-11-19 13:32:59 -08:00
Jesse Gross
0a6d2aa673 netdev: Add classes which don't require initialization.
If a class requires does not require initialization, still add it
to the list of netdev classes.
2009-09-30 12:43:19 -07:00
Jesse Gross
effb3acf60 netdev: Fix memory leak in netdev_open.
The name of the netdev is copied but is never freed.
2009-09-30 12:42:10 -07:00
Ben Pfaff
f1acd62b54 Merge citrix branch into master. 2009-09-02 10:14:53 -07:00
Justin Pettit
13063c3b38 netdev: Add netdev_get_next_hop call
Add ability to determine the next hop IP address and device used to
reach a given host.
2009-09-01 14:48:34 -07:00
Justin Pettit
f10725fea5 Return netmask along with IP address when querying through netdev
The call netdev_get_in4() now allows the caller to also retrieve the
associated netmask.
2009-09-01 14:48:34 -07:00
Justin Pettit
7f329488c5 netdev: Fix reversed arguments in netdev_recv warning. 2009-09-01 14:48:33 -07:00
Ben Pfaff
559843ed53 rtnetlink: Move into separate source and header file.
Now that rtnetlink isn't named similarly to netdev_linux, it might as well
have its own source and header files to avoid confusing everyone.
2009-07-30 16:07:15 -07:00
Ben Pfaff
8b61709d5e netdev: Implement an abstract interface to network devices.
This new abstraction layer allows multiple implementations of network
devices in a single running process.  This will be useful, for example, to
support network devices that are simulated entirely in the running process
or that communicate with other processes over Unix domain sockets, etc.

The reimplemented tap device support in this commit has not been tested.
2009-07-30 16:07:14 -07:00
Ben Pfaff
b1bf7d43b3 netdev: Remove netdev_nodev_*() functions.
These functions are now unused, so they may be deleted.
2009-07-30 16:07:14 -07:00
Ben Pfaff
b2f17b151d netdev: Make netdev_get_vlan_vid() take a netdev instead of a name.
For consistency, it's best if every netdev function takes a netdev instead
of a device name.  The netdev_nodev_*() functions have always been a bit
ugly.
2009-07-30 16:07:14 -07:00
Ben Pfaff
c752217a1e netdev: Make netdev_find_dev_by_in4() use netdevs, not device names.
The netdev_nodev_*() functions have always been a bit of a kluge.  It's
better to keep a network device open than to open it every time that it is
needed.

Also updates the only user of netdev_find_dev_by_in4().
2009-07-30 16:07:14 -07:00
Ben Pfaff
0efaf4b50c netdev: Add 'netdev' parameter to netdev_add_router().
When there is the possibility of multiple classes of netdevs,
netdev_add_router() needs to know which of these to use, so it needs a
"struct netdev *" parameter.
2009-07-30 16:07:14 -07:00
Ben Pfaff
5bfc0cd3c6 netdev: New function netdev_exists().
This new function allows cleanup of code that was using
netdev_nodev_get_flags() or ad-hoc methods to detect whether a network
device with the given name exists.
2009-07-30 16:07:13 -07:00
Ben Pfaff
e33e4d356d netdev: Get rid of netdev_open_tap().
netdev_open() can always be used in place of netdev_open_tap().  The
former is going to be generalized to support pluggable network device
types, so it makes sense to use it everywhere.
2009-07-30 16:07:13 -07:00
Ben Pfaff
6b9bd97900 netdev: Change netdev_get_in4() to return an error code.
Until now, netdev_get_in4() and netdev_nodev_get_in4() have returned a
bool that represents success or failure.  This commit changes the return
value to an int that can indicate what kind of error occurred, which is
both more consistent with the rest of the netdev interfaces and more
meaningful, and updates all callers to the new interface.

(Currently netdev_get_in4() won't ever return an error, but other future
implementations might.)
2009-07-30 16:07:13 -07:00
Ben Pfaff
3d222126b4 netdev: Change netdev_get_mtu() to return an error code.
To make the netdev code more portable, it needs to support returning error
codes from functions that don't have them.  This commit changes
netdev_get_mtu() to return an error code and updates its caller.

(Currently netdev_get_mtu() won't ever return an error, but other future
implementations might.)
2009-07-30 16:07:13 -07:00
Ben Pfaff
80992a3577 netdev: Change netdev_get_etheraddr() to return an error code.
To make the netdev code more portable, it needs to support returning error
codes from functions that don't have them.  This commit changes
netdev_get_etheraddr() to return an error code and updates all of its
callers.

(Currently netdev_get_etheraddr() won't ever return an error, but other
future implementations might.)
2009-07-30 16:07:13 -07:00
Ben Pfaff
3b01baa397 Merge citrix branch into master. 2009-07-16 11:54:37 -07:00
Justin Pettit
79c720a830 Provide method to locate device by IP and add more nodev functions to netdev
In some cases we need to be able to locate a device by its IPv4 address.
There doesn't seem to be an easy way to do this on Linux, so we iterate
through all devices until it's found.  The caller can provide a hint as
to the device, so subsequent checks can be quicker.

This checkin also adds nodev versions of functions to lookup ARP entries
and the IPv4 address of a device.
2009-07-08 11:19:52 -07:00
Ben Pfaff
e9e28be359 Introduce general-purpose ways to wait for dpif and netdev changes.
The dpif and netdev code has had various ways to check for changes to
dpifs and netdevs over the course of Open vSwitch development.  All of
these have been thus far fairly specific to the Linux implementation.  This
commit is the start of a more general API for watching for such changes.
The dpif-related parts seem fairly mature and so they are documented,
the netdev parts will probably need to change somewhat and so they are
not documented yet.
2009-07-06 09:07:24 -07:00
Justin Pettit
887fd0ba64 Add some comments to description to netdev functions.
A few of the netdev functions lacked descriptions, so this adds them.
2009-06-22 19:01:34 -07:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
460923cf8b netdev: New function netdev_nodev_get_carrier(). 2009-06-05 14:26:42 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00