[ovs-discuss] Is there an API to add/delete port in sw?

Ben Pfaff blp at nicira.com
Wed May 21 14:20:53 UTC 2014


Please don't drop the list.

You can read the source of ovs-vsctl.c to see an example of using the
OVSDB API for C.

On Wed, May 21, 2014 at 07:57:45AM +0000, Ellen Rapaport wrote:
> Ovs-vsctl provides CLI, not an API.
> 
> I'll be more specific: 
> I am porting OpenFlow to a router. The router has physical Ethernet interfaces. A subset of those interfaces are configured to support Open Flow. The interfaces may be inactive. I want to be able to configure an interface as an open flow port (a.k.a add-port), when receiving netlink notification that the interface becomes active and remove open flow port configuration (a.k.a del-port) when the interface is inactive.
> 
> Currently in order to add port I am using ovs-vsctl add-port CLI command manually, which obviously doesn't provide me that functionality.
> 
> One option to do what I need is:
> Write a lib that provides the same functionality as ovs-vsctl, while handling the OVSDB transactions internally. 
> My question is if such a lib/API set already exists.
> 
> Maybe API for OVSDB is what I need, if it provides an ability to add specific entries to the DB whilst taking care of transactions. 
> Can you be more specific on that? BTW, I'm using C.
> 
> 
> 
> -----Original Message-----
> From: Ben Pfaff [mailto:blp at nicira.com] 
> Sent: 20 May 2014 17:39
> To: Ellen Rapaport
> Cc: discuss at openvswitch.org
> Subject: Re: [ovs-discuss] Is there an API to add/delete port in sw?
> 
> On Tue, May 20, 2014 at 05:15:49AM +0000, Ellen Rapaport wrote:
> > I'm talking about ovs-vsctl add-port/del-port utility.   
> > Using this utility the user can configure (CLI) which ports he wants to use with openvswitch.
> > I need same functionality, but in software.
> 
> This is fairly vague: what is "more software" than ovs-vsctl?  But maybe this will help: Open vSwitch comes with C and Python APIs for OVSDB.  I suspect that other interfaces exist for other languages, too.



More information about the discuss mailing list