├── .gitignore ├── .travis.yml ├── .travis ├── build.sh └── prepare.sh ├── AUTHORS ├── CONTRIBUTING ├── COPYING ├── CodingStyle ├── DESIGN ├── FAQ ├── INSTALL ├── INSTALL.DPDK ├── INSTALL.Debian ├── INSTALL.Docker ├── INSTALL.Fedora ├── INSTALL.KVM ├── INSTALL.Libvirt ├── INSTALL.NetBSD ├── INSTALL.RHEL ├── INSTALL.SSL ├── INSTALL.Windows ├── INSTALL.XenServer ├── INSTALL.userspace ├── IntegrationGuide ├── Makefile.am ├── NEWS ├── NOTICE ├── OPENFLOW-1.1+ ├── PORTING ├── README-lisp ├── README.md ├── REPORTING-BUGS ├── TODO ├── WHY-OVS ├── acinclude.m4 ├── boot.sh ├── build-aux ├── .gitignore ├── cccl ├── check-structs ├── extract-odp-netlink-h ├── extract-odp-netlink-windows-dp-h ├── extract-ofp-actions ├── extract-ofp-errors ├── extract-ofp-fields ├── extract-ofp-msgs ├── sodepends.pl ├── soexpand.pl └── thread-safety-blacklist ├── configure.ac ├── datapath-windows ├── .gitignore ├── CodingStyle ├── DESIGN ├── Package │ ├── package.VcxProj │ └── package.VcxProj.user ├── automake.mk ├── include │ ├── OvsDpInterfaceExt.h │ ├── OvsPub.h │ └── automake.mk ├── misc │ ├── OVS.psm1 │ ├── install.cmd │ └── uninstall.cmd ├── ovsext.sln └── ovsext │ ├── Actions.c │ ├── Atomic.h │ ├── BufferMgmt.c │ ├── BufferMgmt.h │ ├── Checksum.c │ ├── Checksum.h │ ├── Datapath.c │ ├── Datapath.h │ ├── Debug.c │ ├── Debug.h │ ├── Driver.c │ ├── Ethernet.h │ ├── Event.c │ ├── Event.h │ ├── Flow.c │ ├── Flow.h │ ├── Ioctl.c │ ├── Ioctl.h │ ├── IpHelper.c │ ├── IpHelper.h │ ├── Jhash.c │ ├── Jhash.h │ ├── NetProto.h │ ├── Netlink │ ├── Netlink.c │ ├── Netlink.h │ ├── NetlinkBuf.c │ ├── NetlinkBuf.h │ ├── NetlinkError.h │ └── NetlinkProto.h │ ├── Oid.c │ ├── Oid.h │ ├── PacketIO.c │ ├── PacketIO.h │ ├── PacketParser.c │ ├── PacketParser.h │ ├── Switch.c │ ├── Switch.h │ ├── Tunnel.c │ ├── Tunnel.h │ ├── TunnelFilter.c │ ├── TunnelIntf.h │ ├── Types.h │ ├── User.c │ ├── User.h │ ├── Util.c │ ├── Util.h │ ├── Vport.c │ ├── Vport.h │ ├── Vxlan.c │ ├── Vxlan.h │ ├── ovsext.inf │ ├── ovsext.rc │ ├── ovsext.vcxproj │ ├── ovsext.vcxproj.user │ ├── precomp.h │ └── precompsrc.c ├── datapath ├── .gitignore ├── Makefile.am ├── Modules.mk ├── README ├── actions.c ├── compat.h ├── datapath.c ├── datapath.h ├── dp_notify.c ├── flow.c ├── flow.h ├── flow_netlink.c ├── flow_netlink.h ├── flow_table.c ├── flow_table.h ├── linux │ ├── .gitignore │ ├── Kbuild.in │ ├── Makefile.in │ ├── Makefile.main.in │ ├── Modules.mk │ └── compat │ │ ├── dev-openvswitch.c │ │ ├── exthdrs_core.c │ │ ├── flex_array.c │ │ ├── flow_dissector.c │ │ ├── genetlink-openvswitch.c │ │ ├── gre.c │ │ ├── gso.c │ │ ├── gso.h │ │ ├── hash-x86.c │ │ ├── hash.c │ │ ├── include │ │ ├── asm │ │ │ └── hash.h │ │ ├── linux │ │ │ ├── bug.h │ │ │ ├── compiler-gcc.h │ │ │ ├── compiler.h │ │ │ ├── cpumask.h │ │ │ ├── err.h │ │ │ ├── etherdevice.h │ │ │ ├── flex_array.h │ │ │ ├── hash.h │ │ │ ├── icmp.h │ │ │ ├── icmpv6.h │ │ │ ├── if.h │ │ │ ├── if_arp.h │ │ │ ├── if_ether.h │ │ │ ├── if_vlan.h │ │ │ ├── in.h │ │ │ ├── ip.h │ │ │ ├── ipv6.h │ │ │ ├── jiffies.h │ │ │ ├── kconfig.h │ │ │ ├── kernel.h │ │ │ ├── list.h │ │ │ ├── log2.h │ │ │ ├── net.h │ │ │ ├── netdev_features.h │ │ │ ├── netdevice.h │ │ │ ├── netlink.h │ │ │ ├── openvswitch.h │ │ │ ├── percpu.h │ │ │ ├── poison.h │ │ │ ├── random.h │ │ │ ├── rculist.h │ │ │ ├── rcupdate.h │ │ │ ├── reciprocal_div.h │ │ │ ├── rtnetlink.h │ │ │ ├── sctp.h │ │ │ ├── skbuff.h │ │ │ ├── stddef.h │ │ │ ├── tcp.h │ │ │ ├── types.h │ │ │ ├── u64_stats_sync.h │ │ │ ├── udp.h │ │ │ └── workqueue.h │ │ └── net │ │ │ ├── checksum.h │ │ │ ├── dst.h │ │ │ ├── flow_keys.h │ │ │ ├── genetlink.h │ │ │ ├── geneve.h │ │ │ ├── gre.h │ │ │ ├── inet_frag.h │ │ │ ├── ip.h │ │ │ ├── ip_tunnels.h │ │ │ ├── ipv6.h │ │ │ ├── net_namespace.h │ │ │ ├── netfilter │ │ │ └── nf_conntrack.h │ │ │ ├── netlink.h │ │ │ ├── sctp │ │ │ └── checksum.h │ │ │ ├── sock.h │ │ │ ├── udp.h │ │ │ └── vxlan.h │ │ ├── ip_tunnels_core.c │ │ ├── net_namespace.c │ │ ├── netdevice.c │ │ ├── nf_conntrack_core.c │ │ ├── reciprocal_div.c │ │ ├── skbuff-openvswitch.c │ │ ├── utils.c │ │ └── vxlan.c ├── mpls.h ├── vlan.h ├── vport-geneve.c ├── vport-gre.c ├── vport-internal_dev.c ├── vport-internal_dev.h ├── vport-lisp.c ├── vport-netdev.c ├── vport-netdev.h ├── vport-vxlan.c ├── vport.c └── vport.h ├── debian ├── .gitignore ├── automake.mk ├── changelog ├── compat ├── control ├── control.modules.in ├── copyright.in ├── dirs ├── dkms.conf.in ├── ifupdown.sh ├── openvswitch-common.dirs ├── openvswitch-common.docs ├── openvswitch-common.install ├── openvswitch-common.manpages ├── openvswitch-datapath-dkms.postinst ├── openvswitch-datapath-dkms.prerm ├── openvswitch-datapath-module-_KVERS_.postinst.modules.in ├── openvswitch-datapath-source.README.Debian ├── openvswitch-datapath-source.copyright ├── openvswitch-datapath-source.dirs ├── openvswitch-datapath-source.install ├── openvswitch-ipsec.dirs ├── openvswitch-ipsec.init ├── openvswitch-ipsec.install ├── openvswitch-pki.dirs ├── openvswitch-pki.postinst ├── openvswitch-pki.postrm ├── openvswitch-switch.README.Debian ├── openvswitch-switch.dirs ├── openvswitch-switch.init ├── openvswitch-switch.install ├── openvswitch-switch.links ├── openvswitch-switch.logrotate ├── openvswitch-switch.manpages ├── openvswitch-switch.postinst ├── openvswitch-switch.postrm ├── openvswitch-switch.template ├── openvswitch-test.dirs ├── openvswitch-test.install ├── openvswitch-test.manpages ├── openvswitch-testcontroller.README.Debian ├── openvswitch-testcontroller.default ├── openvswitch-testcontroller.dirs ├── openvswitch-testcontroller.init ├── openvswitch-testcontroller.install ├── openvswitch-testcontroller.manpages ├── openvswitch-testcontroller.postinst ├── openvswitch-testcontroller.postrm ├── openvswitch-vtep.default ├── openvswitch-vtep.dirs ├── openvswitch-vtep.init ├── openvswitch-vtep.install ├── openvswitch-vtep.manpages ├── ovs-monitor-ipsec ├── python-openvswitch.dirs ├── python-openvswitch.install ├── rules ├── rules.modules └── source │ └── format ├── include ├── .gitignore ├── automake.mk ├── openflow │ ├── .gitignore │ ├── automake.mk │ ├── nicira-ext.h │ ├── openflow-1.0.h │ ├── openflow-1.1.h │ ├── openflow-1.2.h │ ├── openflow-1.3.h │ ├── openflow-1.4.h │ ├── openflow-common.h │ └── openflow.h ├── openvswitch │ ├── automake.mk │ └── types.h ├── sparse │ ├── arpa │ │ └── inet.h │ ├── assert.h │ ├── automake.mk │ ├── math.h │ ├── netinet │ │ ├── in.h │ │ └── ip6.h │ ├── netpacket │ │ └── packet.h │ ├── pthread.h │ └── sys │ │ ├── socket.h │ │ └── wait.h └── windows │ ├── arpa │ └── inet.h │ ├── automake.mk │ ├── dirent.h │ ├── getopt.h │ ├── linux │ ├── pkt_sched.h │ └── types.h │ ├── net │ └── if.h │ ├── netdb.h │ ├── netinet │ ├── icmp6.h │ ├── in.h │ ├── in_systm.h │ ├── ip.h │ ├── ip6.h │ └── tcp.h │ ├── netpacket │ └── packet.h │ ├── poll.h │ ├── strings.h │ ├── sys │ ├── epoll.h │ ├── ioctl.h │ ├── resource.h │ ├── socket.h │ ├── time.h │ ├── uio.h │ ├── un.h │ └── wait.h │ ├── syslog.h │ ├── unistd.h │ └── windefs.h ├── lib ├── .gitignore ├── aes128.c ├── aes128.h ├── async-append-aio.c ├── async-append-null.c ├── async-append.h ├── automake.mk ├── backtrace.c ├── backtrace.h ├── bfd.c ├── bfd.h ├── bitmap.h ├── bundle.c ├── bundle.h ├── byte-order.h ├── byteq.c ├── byteq.h ├── cfm.c ├── cfm.h ├── classifier.c ├── classifier.h ├── cmap.c ├── cmap.h ├── command-line.c ├── command-line.h ├── common-syn.man ├── common.man ├── compiler.h ├── connectivity.c ├── connectivity.h ├── coverage-unixctl.man ├── coverage.c ├── coverage.h ├── crc32c.c ├── crc32c.h ├── csum.c ├── csum.h ├── daemon-private.h ├── daemon-syn.man ├── daemon-unix.c ├── daemon-windows.c ├── daemon.c ├── daemon.h ├── daemon.man ├── dh1024.pem ├── dh2048.pem ├── dh4096.pem ├── dhcp.h ├── dhparams.h ├── dirs.c.in ├── dirs.h ├── dpctl.c ├── dpctl.h ├── dpctl.man ├── dpif-netdev.c ├── dpif-netdev.h ├── dpif-netlink.c ├── dpif-netlink.h ├── dpif-provider.h ├── dpif.c ├── dpif.h ├── dummy.c ├── dummy.h ├── dynamic-string.c ├── dynamic-string.h ├── entropy.c ├── entropy.h ├── fat-rwlock.c ├── fat-rwlock.h ├── fatal-signal.c ├── fatal-signal.h ├── flow.c ├── flow.h ├── getopt_long.c ├── getrusage-windows.c ├── guarded-list.c ├── guarded-list.h ├── hash.c ├── hash.h ├── heap.c ├── heap.h ├── hindex.c ├── hindex.h ├── hmap.c ├── hmap.h ├── hmapx.c ├── hmapx.h ├── jhash.c ├── jhash.h ├── json.c ├── json.h ├── jsonrpc.c ├── jsonrpc.h ├── lacp.c ├── lacp.h ├── latch-unix.c ├── latch-windows.c ├── latch.h ├── learn.c ├── learn.h ├── learning-switch.c ├── learning-switch.h ├── list.c ├── list.h ├── lockfile.c ├── lockfile.h ├── mac-learning.c ├── mac-learning.h ├── match.c ├── match.h ├── mcast-snooping.c ├── mcast-snooping.h ├── memory-unixctl.man ├── memory.c ├── memory.h ├── meta-flow.c ├── meta-flow.h ├── multipath.c ├── multipath.h ├── netdev-bsd.c ├── netdev-dpdk.c ├── netdev-dpdk.h ├── netdev-dummy.c ├── netdev-linux.c ├── netdev-linux.h ├── netdev-provider.h ├── netdev-vport.c ├── netdev-vport.h ├── netdev-windows.c ├── netdev.c ├── netdev.h ├── netflow.h ├── netlink-notifier.c ├── netlink-notifier.h ├── netlink-protocol.h ├── netlink-socket.c ├── netlink-socket.h ├── netlink.c ├── netlink.h ├── nx-match.c ├── nx-match.h ├── odp-execute.c ├── odp-execute.h ├── odp-util.c ├── odp-util.h ├── ofp-actions.c ├── ofp-actions.h ├── ofp-errors.c ├── ofp-errors.h ├── ofp-msgs.c ├── ofp-msgs.h ├── ofp-parse.c ├── ofp-parse.h ├── ofp-print.c ├── ofp-print.h ├── ofp-util.c ├── ofp-util.h ├── ofp-version-opt.c ├── ofp-version-opt.h ├── ofp-version.man ├── ofpbuf.c ├── ofpbuf.h ├── ovs-atomic-c11.h ├── ovs-atomic-clang.h ├── ovs-atomic-flag-gcc4.7+.h ├── ovs-atomic-gcc4+.h ├── ovs-atomic-gcc4.7+.h ├── ovs-atomic-i586.h ├── ovs-atomic-locked.c ├── ovs-atomic-locked.h ├── ovs-atomic-msvc.h ├── ovs-atomic-pthreads.h ├── ovs-atomic-x86_64.h ├── ovs-atomic.h ├── ovs-numa.c ├── ovs-numa.h ├── ovs-rcu.c ├── ovs-rcu.h ├── ovs-thread.c ├── ovs-thread.h ├── ovs.tmac ├── ovsdb-data.c ├── ovsdb-data.h ├── ovsdb-error.c ├── ovsdb-error.h ├── ovsdb-idl-provider.h ├── ovsdb-idl.c ├── ovsdb-idl.h ├── ovsdb-parser.c ├── ovsdb-parser.h ├── ovsdb-types.c ├── ovsdb-types.h ├── packet-dpif.c ├── packet-dpif.h ├── packets.c ├── packets.h ├── pcap-file.c ├── pcap-file.h ├── poll-loop.c ├── poll-loop.h ├── process.c ├── process.h ├── pvector.c ├── pvector.h ├── random.c ├── random.h ├── rconn.c ├── rconn.h ├── reconnect.c ├── reconnect.h ├── route-table-bsd.c ├── route-table-stub.c ├── route-table.c ├── route-table.h ├── rstp-common.h ├── rstp-state-machines.c ├── rstp-state-machines.h ├── rstp.c ├── rstp.h ├── rtbsd.c ├── rtbsd.h ├── rtnetlink-link.c ├── rtnetlink-link.h ├── sat-math.h ├── seq.c ├── seq.h ├── service-syn.man ├── service.man ├── sflow.h ├── sflow_agent.c ├── sflow_api.h ├── sflow_poller.c ├── sflow_receiver.c ├── sflow_sampler.c ├── sha1.c ├── sha1.h ├── shash.c ├── shash.h ├── signals.c ├── signals.h ├── simap.c ├── simap.h ├── smap.c ├── smap.h ├── socket-util-unix.c ├── socket-util.c ├── socket-util.h ├── sort.c ├── sort.h ├── sset.c ├── sset.h ├── ssl-bootstrap-syn.man ├── ssl-bootstrap.man ├── ssl-peer-ca-cert.man ├── ssl-syn.man ├── ssl.man ├── stdio.c ├── stdio.h.in ├── stp.c ├── stp.h ├── stream-fd.c ├── stream-fd.h ├── stream-nossl.c ├── stream-provider.h ├── stream-ssl.c ├── stream-ssl.h ├── stream-tcp.c ├── stream-unix.c ├── stream.c ├── stream.h ├── string.c ├── string.h.in ├── strsep.c ├── svec.c ├── svec.h ├── table.c ├── table.h ├── table.man ├── tag.c ├── tag.h ├── timer.c ├── timer.h ├── timeval.c ├── timeval.h ├── token-bucket.c ├── token-bucket.h ├── type-props.h ├── unaligned.h ├── unicode.c ├── unicode.h ├── unixctl-syn.man ├── unixctl.c ├── unixctl.h ├── unixctl.man ├── util.c ├── util.h ├── uuid.c ├── uuid.h ├── valgrind.h ├── vconn-active.man ├── vconn-passive.man ├── vconn-provider.h ├── vconn-stream.c ├── vconn.c ├── vconn.h ├── vlan-bitmap.c ├── vlan-bitmap.h ├── vlandev.c ├── vlandev.h ├── vlog-syn.man ├── vlog-unixctl.man ├── vlog.c ├── vlog.h ├── vlog.man ├── vswitch-idl.ann └── vtep-idl.ann ├── m4 ├── .gitignore ├── absolute-header.m4 ├── automake.mk ├── ax_check_openssl.m4 ├── ax_func_posix_memalign.m4 ├── compat.at ├── include_next.m4 └── openvswitch.m4 ├── manpages.mk ├── ofproto ├── .gitignore ├── automake.mk ├── bond.c ├── bond.h ├── bundles.c ├── bundles.h ├── collectors.c ├── collectors.h ├── connmgr.c ├── connmgr.h ├── fail-open.c ├── fail-open.h ├── in-band.c ├── in-band.h ├── ipfix-enterprise-entities.def ├── ipfix-gen-entities ├── ipfix.xml ├── names.c ├── netflow.c ├── netflow.h ├── ofproto-dpif-ipfix.c ├── ofproto-dpif-ipfix.h ├── ofproto-dpif-mirror.c ├── ofproto-dpif-mirror.h ├── ofproto-dpif-monitor.c ├── ofproto-dpif-monitor.h ├── ofproto-dpif-rid.c ├── ofproto-dpif-rid.h ├── ofproto-dpif-sflow.c ├── ofproto-dpif-sflow.h ├── ofproto-dpif-unixctl.man ├── ofproto-dpif-upcall.c ├── ofproto-dpif-upcall.h ├── ofproto-dpif-xlate.c ├── ofproto-dpif-xlate.h ├── ofproto-dpif.c ├── ofproto-dpif.h ├── ofproto-provider.h ├── ofproto-unixctl.man ├── ofproto.c ├── ofproto.h ├── pinsched.c ├── pinsched.h ├── pktbuf.c ├── pktbuf.h ├── tunnel.c └── tunnel.h ├── ovsdb ├── .gitignore ├── automake.mk ├── column.c ├── column.h ├── condition.c ├── condition.h ├── dot2pic ├── execution.c ├── file.c ├── file.h ├── jsonrpc-server.c ├── jsonrpc-server.h ├── log.c ├── log.h ├── mutation.c ├── mutation.h ├── ovsdb-client.1.in ├── ovsdb-client.c ├── ovsdb-doc ├── ovsdb-dot.in ├── ovsdb-idlc.1 ├── ovsdb-idlc.in ├── ovsdb-server.1.in ├── ovsdb-server.c ├── ovsdb-tool.1.in ├── ovsdb-tool.c ├── ovsdb.c ├── ovsdb.h ├── query.c ├── query.h ├── remote-active.man ├── remote-passive.man ├── row.c ├── row.h ├── server.c ├── server.h ├── table.c ├── table.h ├── transaction.c ├── transaction.h ├── trigger.c └── trigger.h ├── python ├── automake.mk ├── compat │ ├── argparse.py │ ├── automake.mk │ └── uuid.py ├── ovs │ ├── .gitignore │ ├── __init__.py │ ├── daemon.py │ ├── db │ │ ├── __init__.py │ │ ├── data.py │ │ ├── error.py │ │ ├── idl.py │ │ ├── parser.py │ │ ├── schema.py │ │ └── types.py │ ├── dirs.py │ ├── dirs.py.template │ ├── fatal_signal.py │ ├── json.py │ ├── jsonrpc.py │ ├── ovsuuid.py │ ├── poller.py │ ├── process.py │ ├── reconnect.py │ ├── socket_util.py │ ├── stream.py │ ├── timeval.py │ ├── unixctl │ │ ├── __init__.py │ │ ├── client.py │ │ └── server.py │ ├── util.py │ └── vlog.py └── ovstest │ ├── __init__.py │ ├── args.py │ ├── rpcserver.py │ ├── tcp.py │ ├── tests.py │ ├── udp.py │ ├── util.py │ └── vswitch.py ├── rhel ├── .gitignore ├── README.RHEL ├── automake.mk ├── etc_init.d_openvswitch ├── etc_logrotate.d_openvswitch ├── etc_sysconfig_network-scripts_ifdown-ovs ├── etc_sysconfig_network-scripts_ifup-ovs ├── openvswitch-fedora.spec.in ├── openvswitch-kmod-fedora.spec.in ├── openvswitch-kmod-rhel6.spec.in ├── openvswitch-kmod.files ├── openvswitch.spec.in ├── usr_lib_systemd_system_openvswitch-nonetwork.service ├── usr_lib_systemd_system_openvswitch.service ├── usr_share_openvswitch_scripts_sysconfig.template └── usr_share_openvswitch_scripts_systemd_sysconfig.template ├── tests ├── .gitignore ├── MockXenAPI.py ├── aes128.at ├── appctl.py ├── atlocal.in ├── automake.mk ├── bfd.at ├── bridge.at ├── bundle.at ├── cfm.at ├── check-structs.at ├── classifier.at ├── daemon-py.at ├── daemon.at ├── dpif-netdev.at ├── file_name.at ├── flowgen.pl ├── glibc.supp ├── heap.at ├── idltest.ann ├── idltest.ovsschema ├── interface-reconfigure.at ├── json.at ├── jsonrpc-py.at ├── jsonrpc.at ├── lacp.at ├── learn.at ├── library.at ├── lockfile.at ├── multipath.at ├── odp.at ├── ofp-actions.at ├── ofp-errors.at ├── ofp-print.at ├── ofp-util.at ├── ofproto-dpif.at ├── ofproto-macros.at ├── ofproto.at ├── openssl.supp ├── ovs-monitor-ipsec.at ├── ovs-ofctl.at ├── ovs-vsctl.at ├── ovs-vswitchd.at ├── ovs-xapi-sync.at ├── ovs_client │ └── ovs_client.c ├── ovsdb-column.at ├── ovsdb-condition.at ├── ovsdb-data.at ├── ovsdb-execution.at ├── ovsdb-idl.at ├── ovsdb-log.at ├── ovsdb-macros.at ├── ovsdb-monitor-sort.pl ├── ovsdb-monitor.at ├── ovsdb-mutation.at ├── ovsdb-query.at ├── ovsdb-row.at ├── ovsdb-schema.at ├── ovsdb-server.at ├── ovsdb-table.at ├── ovsdb-tool.at ├── ovsdb-transaction.at ├── ovsdb-trigger.at ├── ovsdb-types.at ├── ovsdb.at ├── ovstest.c ├── ovstest.h ├── reconnect.at ├── rstp.at ├── run-oftest ├── run-ryu ├── stp.at ├── test-aes128.c ├── test-atomic.c ├── test-bitmap.c ├── test-bundle.c ├── test-byte-order.c ├── test-classifier.c ├── test-cmap.c ├── test-csum.c ├── test-daemon.py ├── test-flows.c ├── test-hash.c ├── test-heap.c ├── test-hindex.c ├── test-hmap.c ├── test-json.c ├── test-json.py ├── test-jsonrpc.c ├── test-jsonrpc.py ├── test-list.c ├── test-lockfile.c ├── test-multipath.c ├── test-netflow.c ├── test-odp.c ├── test-ovsdb.c ├── test-ovsdb.py ├── test-packets.c ├── test-random.c ├── test-reconnect.c ├── test-reconnect.py ├── test-rstp.c ├── test-sflow.c ├── test-sha1.c ├── test-stp.c ├── test-strtok_r.c ├── test-type-props.c ├── test-unix-socket.c ├── test-unix-socket.py ├── test-unixctl.py ├── test-util.c ├── test-uuid.c ├── test-vconn.c ├── test-vlog.py ├── testsuite.at ├── tunnel.at ├── unixctl-py.at ├── uuid.at ├── uuidfilt.pl ├── valgrind-wrapper.in ├── vconn.at ├── vlan-splinters.at ├── vlog.at └── vtep-ctl.at ├── third-party ├── .gitignore ├── README ├── automake.mk └── ofp-tcpdump.patch ├── tutorial ├── .gitignore ├── Tutorial ├── automake.mk ├── ovs-sandbox ├── t-setup ├── t-stage0 ├── t-stage1 ├── t-stage2 ├── t-stage3 └── t-stage4 ├── utilities ├── .gitignore ├── automake.mk ├── bugtool │ ├── .gitignore │ ├── automake.mk │ ├── ovs-bugtool-bfd-show │ ├── ovs-bugtool-bond-show │ ├── ovs-bugtool-cfm-show │ ├── ovs-bugtool-coverage-show │ ├── ovs-bugtool-daemons-ver │ ├── ovs-bugtool-fdb-show │ ├── ovs-bugtool-lacp-show │ ├── ovs-bugtool-list-dbs │ ├── ovs-bugtool-memory-show │ ├── ovs-bugtool-ovs-appctl-dpif │ ├── ovs-bugtool-ovs-ofctl-dump-flows │ ├── ovs-bugtool-ovs-ofctl-show │ ├── ovs-bugtool-ovsdb-dump │ ├── ovs-bugtool-tc-class-show │ ├── ovs-bugtool-vsctl-show │ ├── ovs-bugtool.8.in │ ├── ovs-bugtool.in │ └── plugins │ │ ├── kernel-info │ │ └── openvswitch.xml │ │ ├── network-status │ │ └── openvswitch.xml │ │ ├── system-configuration.xml │ │ ├── system-configuration │ │ └── openvswitch.xml │ │ └── system-logs │ │ └── openvswitch.xml ├── nlmon.c ├── ovs-appctl.8.in ├── ovs-appctl.c ├── ovs-benchmark.1.in ├── ovs-benchmark.c ├── ovs-check-dead-ifs.in ├── ovs-ctl.8 ├── ovs-ctl.in ├── ovs-dev.py ├── ovs-docker ├── ovs-dpctl-top.8.in ├── ovs-dpctl-top.in ├── ovs-dpctl.8.in ├── ovs-dpctl.c ├── ovs-l3ping.8.in ├── ovs-l3ping.in ├── ovs-lib.in ├── ovs-ofctl.8.in ├── ovs-ofctl.c ├── ovs-parse-backtrace.8 ├── ovs-parse-backtrace.in ├── ovs-pcap.1.in ├── ovs-pcap.in ├── ovs-pki.8.in ├── ovs-pki.in ├── ovs-save ├── ovs-tcpundump.1.in ├── ovs-tcpundump.in ├── ovs-test.8.in ├── ovs-test.in ├── ovs-testcontroller.8.in ├── ovs-testcontroller.c ├── ovs-vlan-bug-workaround.8.in ├── ovs-vlan-bug-workaround.c ├── ovs-vlan-bugs.man ├── ovs-vlan-test.8.in ├── ovs-vlan-test.in ├── ovs-vsctl.8.in └── ovs-vsctl.c ├── vswitchd ├── .gitignore ├── INTERNALS ├── automake.mk ├── bridge.c ├── bridge.h ├── ovs-vswitchd.8.in ├── ovs-vswitchd.c ├── system-stats.c ├── system-stats.h ├── vswitch.ovsschema ├── vswitch.xml ├── xenserver.c └── xenserver.h ├── vtep ├── .gitignore ├── README.ovs-vtep ├── automake.mk ├── ovs-vtep ├── vtep-ctl.8.in ├── vtep-ctl.c ├── vtep.ovsschema └── vtep.xml └── xenserver ├── .gitignore ├── GPLv2 ├── LICENSE ├── README ├── automake.mk ├── etc_init.d_openvswitch ├── etc_init.d_openvswitch-xapi-update ├── etc_logrotate.d_openvswitch ├── etc_profile.d_openvswitch.sh ├── etc_xapi.d_plugins_openvswitch-cfg-update ├── etc_xensource_scripts_vif ├── openvswitch-xen.spec.in ├── opt_xensource_libexec_InterfaceReconfigure.py ├── opt_xensource_libexec_InterfaceReconfigureBridge.py ├── opt_xensource_libexec_InterfaceReconfigureVswitch.py ├── opt_xensource_libexec_interface-reconfigure ├── usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py ├── usr_share_openvswitch_scripts_ovs-xapi-sync └── usr_share_openvswitch_scripts_sysconfig.template /.gitignore: -------------------------------------------------------------------------------- 1 | #*# 2 | *.a 3 | *.d 4 | *.ko 5 | *.la 6 | *.lo 7 | *.loT 8 | *.mod.c 9 | *.o 10 | *.obj 11 | *.exe 12 | *.exp 13 | *.ilk 14 | *.lib 15 | *.pdb 16 | *.pyc 17 | *.so 18 | *.suo 19 | *~ 20 | *,cover 21 | .#* 22 | .*.cmd 23 | .*.swp 24 | .coverage 25 | .deps 26 | .dirstamp 27 | .libs 28 | .tmp_versions 29 | .gitattributes 30 | /Makefile 31 | /Makefile.in 32 | /aclocal.m4 33 | /all-distfiles 34 | /all-gitfiles 35 | /autom4te.cache 36 | /build-arch-stamp 37 | /build-indep-stamp 38 | /compile 39 | /config.guess 40 | /config.h 41 | /config.h.in 42 | /config.log 43 | /config.status 44 | /config.sub 45 | /configure 46 | /configure-stamp 47 | /depcomp 48 | /distfiles 49 | /install-sh 50 | /libtool 51 | /manpage-check 52 | /missing 53 | /missing-distfiles 54 | /package.m4 55 | /stamp-h1 56 | /_build-gcc 57 | /_build-clang 58 | Module.symvers 59 | TAGS 60 | cscope.* 61 | tags 62 | _debian 63 | odp-netlink.h 64 | OvsDpInterface.h 65 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: 3 | - gcc 4 | - clang 5 | 6 | before_install: ./.travis/prepare.sh 7 | 8 | env: 9 | - OPTS="--disable-ssl" 10 | - TESTSUITE=1 KERNEL=1 OPTS="--with-linux=./linux-3.16.2" 11 | - KERNEL=1 DPDK=1 OPTS="--with-dpdk=./dpdk-1.7.1/build" 12 | 13 | script: ./.travis/build.sh $OPTS 14 | 15 | notifications: 16 | email: 17 | recipients: 18 | - secure: V7W+NdS3L1aXCMUo2EBmOIHeQHT76r78p3f25XFISz8D4a2FnXA2ydwQVbhiZxa+TRgrskY/iB5GU1fS70+qmIaGxnGAVRV8lIQVshoiaKuxvMcha0FdN4d44i1AmLiM2DK8r5k3+fEWTQCvq9mrXQnDJVEPpYfVGj5+b+9oBx8= 19 | -------------------------------------------------------------------------------- /.travis/prepare.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo apt-get update -qq 4 | sudo apt-get install -qq libssl-dev llvm-dev 5 | 6 | wget https://www.kernel.org/pub/software/devel/sparse/dist/sparse-0.5.0.tar.gz 7 | tar -xzvf sparse-0.5.0.tar.gz 8 | cd sparse-0.5.0 && make && sudo make install PREFIX=/usr && cd .. 9 | -------------------------------------------------------------------------------- /INSTALL.NetBSD: -------------------------------------------------------------------------------- 1 | How to Install Open vSwitch on NetBSD 2 | ===================================== 3 | 4 | On NetBSD, you might want to install requirements from pkgsrc. 5 | In that case, you need at least the following packages. 6 | 7 | automake 8 | libtool-base 9 | gmake 10 | python27 11 | py27-xml 12 | pkg_alternatives 13 | 14 | Some components have additional requirements. (See INSTALL) 15 | 16 | Assuming you are running NetBSD/amd64 6.1.2, you can download and 17 | install pre-built binary packages as the following. 18 | (You might get some warnings about minor version mismatch. Don't care.) 19 | 20 | # PKG_PATH=http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.2/All/ 21 | # export PKG_PATH 22 | # pkg_add automake libtool-base gmake python27 py27-xml pkg_alternatives 23 | 24 | NetBSD's /usr/bin/make is not GNU make. GNU make is installed as 25 | /usr/pkg/bin/gmake by the above mentioned 'gmake' package. 26 | 27 | As all executables installed with pkgsrc are placed in /usr/pkg/bin/ 28 | directory, it might be a good idea to add it to your PATH. 29 | 30 | Open vSwitch on NetBSD is currently "userspace switch" implementation 31 | in the sense described in INSTALL.userspace and PORTING. 32 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | This file is included in compliance with the Apache 2.0 license, 2 | available at http://www.apache.org/licenses/LICENSE-2.0.html 3 | 4 | Open vSwitch 5 | Copyright (c) 2007, 2008, 2009, 2010, 2011, 2013 Nicira, Inc. 6 | 7 | Open vSwitch BSD port 8 | Copyright (c) 2011 Gaetano Catalli 9 | 10 | Apache Portable Runtime 11 | Copyright 2008 The Apache Software Foundation. 12 | 13 | This product includes software developed by 14 | The Apache Software Foundation (http://www.apache.org/). 15 | 16 | Portions of this software were developed at the National Center 17 | for Supercomputing Applications (NCSA) at the University of 18 | Illinois at Urbana-Champaign. 19 | 20 | lib/ovs.tmac includes troff macros written by Eric S. Raymond 21 | and Werner Lemberg. 22 | 23 | m4/include_next.m4 and m4/absolute-header.m4 24 | Copyright (C) 2006-2013 Free Software Foundation, Inc. 25 | 26 | Rapid Spanning Tree Protocol (RSTP) implementation 27 | Copyright (c) 2011-2014 M3S, Srl - Italy 28 | -------------------------------------------------------------------------------- /boot.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | autoreconf --install --force 3 | -------------------------------------------------------------------------------- /build-aux/.gitignore: -------------------------------------------------------------------------------- 1 | /compile 2 | /config.guess 3 | /config.sub 4 | /depcomp 5 | /install-sh 6 | /ltmain.sh 7 | /missing 8 | -------------------------------------------------------------------------------- /build-aux/extract-odp-netlink-h: -------------------------------------------------------------------------------- 1 | # This is a "sed" script that transforms into a 2 | # form that is suitable for inclusion within the Open vSwitch tree on 3 | # both Linux and non-Linux systems. 4 | 5 | # Add a header warning that this is a generated file. It might save somebody 6 | # some frustration (maybe even me!). 7 | 1i\ 8 | /* -*- mode: c; buffer-read-only: t -*- */\ 9 | /* Generated automatically from -- do not modify! */\ 10 | \ 11 | \ 12 | 13 | 14 | # Avoid using reserved names in header guards. 15 | s/_LINUX_OPENVSWITCH_H/ODP_NETLINK_H/ 16 | 17 | # Include platform extensions header file on Win32. 18 | $i\ 19 | #ifdef _WIN32\ 20 | #include "OvsDpInterfaceExt.h"\ 21 | #endif\ 22 | 23 | 24 | # Transform most Linux-specific __u types into C99 uint_t types, 25 | # and most Linux-specific __be into Open vSwitch ovs_be, 26 | # and use the appropriate userspace header. 27 | s,,"openvswitch/types.h", 28 | s/__u32/uint32_t/g 29 | s/__u16/uint16_t/g 30 | s/__u8/uint8_t/g 31 | s/__be32/ovs_be32/g 32 | s/__be16/ovs_be16/g 33 | 34 | # Transform 64-bit Linux-specific types into Open vSwitch specialized 35 | # types for 64-bit numbers that might only be aligned on a 32-bit 36 | # boundary. 37 | s/__u64/ovs_32aligned_u64/g 38 | s/__be64/ovs_32aligned_be64/g 39 | 40 | # Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN. 41 | s,,"packets.h", 42 | s/ETH_ALEN/ETH_ADDR_LEN/ 43 | -------------------------------------------------------------------------------- /build-aux/extract-odp-netlink-windows-dp-h: -------------------------------------------------------------------------------- 1 | # This is a "sed" script that transforms into a 2 | # form that is suitable for inclusion within the Open vSwitch tree on 3 | # windows system. The transformed header file can be included by windows 4 | # driver modules. 5 | 6 | # Add a header warning that this is a generated file. 7 | 1i\ 8 | /* -*- mode: c; buffer-read-only: t -*- */\ 9 | /* Generated automatically from -- do not modify! */\ 10 | \ 11 | \ 12 | 13 | # Avoid using reserved names in header guards. 14 | s/_LINUX_OPENVSWITCH_H/__OVS_DP_INTERFACE_H_/ 15 | 16 | # and use the appropriate userspace header. 17 | s,,"Types.h", 18 | 19 | # Add ETH_ADDR_LEN macro to avoid including userspace packet.h 20 | s,#include ,\n#ifndef ETH_ADDR_LEN \ 21 | #define ETH_ADDR_LEN 6 \n#endif \ 22 | \n#ifndef IFNAMSIZ \n#define IFNAMSIZ 16 \n#endif, 23 | 24 | # Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN. 25 | s/ETH_ALEN/ETH_ADDR_LEN/ 26 | -------------------------------------------------------------------------------- /build-aux/soexpand.pl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2008 Nicira, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | use strict; 16 | use warnings; 17 | use Getopt::Long; 18 | 19 | my ($exit_code) = 0; 20 | my (@include_dirs); 21 | Getopt::Long::Configure ("bundling"); 22 | GetOptions("I|include=s" => \@include_dirs) or exit(1); 23 | @include_dirs = ('.') if !@include_dirs; 24 | OUTER: while () { 25 | if (my ($name) = /^\.so (\S+)$/) { 26 | foreach my $dir (@include_dirs, '.') { 27 | if (open(INNER, "$dir/$name")) { 28 | while () { 29 | print $_; 30 | } 31 | close(INNER); 32 | next OUTER; 33 | } 34 | } 35 | print STDERR "$name not found in: ", join(' ', @include_dirs), "\n"; 36 | $exit_code = 1; 37 | } 38 | print $_; 39 | } 40 | exit $exit_code; 41 | -------------------------------------------------------------------------------- /datapath-windows/.gitignore: -------------------------------------------------------------------------------- 1 | /Package/x64/ 2 | *.opensdf 3 | *.sdf 4 | /ovsext/x64/ 5 | /x64 6 | -------------------------------------------------------------------------------- /datapath-windows/Package/package.VcxProj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TestSign 5 | 6 | 7 | TestSign 8 | 9 | 10 | TestSign 11 | 12 | 13 | TestSign 14 | 15 | 16 | -------------------------------------------------------------------------------- /datapath-windows/include/automake.mk: -------------------------------------------------------------------------------- 1 | BUILT_SOURCES += $(srcdir)/datapath-windows/include/OvsDpInterface.h 2 | 3 | $(srcdir)/datapath-windows/include/OvsDpInterface.h: \ 4 | datapath/linux/compat/include/linux/openvswitch.h \ 5 | build-aux/extract-odp-netlink-windows-dp-h 6 | $(AM_V_GEN)sed -f $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h < $< > $@ 7 | 8 | EXTRA_DIST += $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h 9 | 10 | CLEANFILES += $(srcdir)/datapath-windows/include/OvsDpInterface.h 11 | -------------------------------------------------------------------------------- /datapath-windows/misc/install.cmd: -------------------------------------------------------------------------------- 1 | netcfg -l .\ovsext.inf -c s -i OVSExt 2 | 3 | net stop vmms 4 | net start vmms 5 | -------------------------------------------------------------------------------- /datapath-windows/misc/uninstall.cmd: -------------------------------------------------------------------------------- 1 | netcfg -u OVSExt 2 | -------------------------------------------------------------------------------- /datapath-windows/ovsext/Atomic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 VMware, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __ATOMIC_H_ 18 | #define __ATOMIC_H_ 1 19 | 20 | static __inline UINT64 21 | atomic_add64(UINT64 *ptr, UINT32 val) 22 | { 23 | return InterlockedAdd64((LONGLONG volatile *) ptr, (LONGLONG) val); 24 | } 25 | 26 | static __inline UINT64 27 | atomic_inc64(UINT64 *ptr) 28 | { 29 | return InterlockedIncrement64((LONGLONG volatile *) ptr); 30 | } 31 | 32 | #endif /* __ATOMIC_H_ */ 33 | -------------------------------------------------------------------------------- /datapath-windows/ovsext/Jhash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2009, 2010, 2012, 2014 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __JHASH_H_ 18 | #define __JHASH_H_ 1 19 | 20 | /* This is the public domain lookup3 hash by Bob Jenkins from 21 | * http://burtleburtle.net/bob/c/lookup3.c, modified for style. 22 | * 23 | * Use the functions in hash.h instead if you can. These are here just for 24 | * places where we've exposed a hash function "on the wire" and don't want it 25 | * to change. */ 26 | 27 | uint32_t OvsJhashWords(const uint32_t *, size_t n_word, uint32_t basis); 28 | uint32_t OvsJhashBytes(const void *, size_t n_bytes, uint32_t basis); 29 | 30 | #endif /* __JHASH_H_ */ 31 | -------------------------------------------------------------------------------- /datapath-windows/ovsext/Oid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 VMware, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __OID_H_ 18 | #define __OID_H_ 1 19 | 20 | NDIS_STATUS OvsQuerySwitchActivationComplete(POVS_SWITCH_CONTEXT switchContext, 21 | BOOLEAN *switchActive); 22 | NDIS_STATUS OvsGetPortsOnSwitch(POVS_SWITCH_CONTEXT switchContext, 23 | PNDIS_SWITCH_PORT_ARRAY *portArrayOut); 24 | NDIS_STATUS OvsGetNicsOnSwitch(POVS_SWITCH_CONTEXT switchContext, 25 | PNDIS_SWITCH_NIC_ARRAY *nicArrayOut); 26 | #endif /* __OID_H_ */ 27 | -------------------------------------------------------------------------------- /datapath-windows/ovsext/TunnelIntf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 VMware, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __TUNNEL_INTF_H_ 18 | #define __TUNNEL_INTF_H_ 1 19 | 20 | /* Tunnel callout driver load/unload functions */ 21 | NTSTATUS OvsTunnelFilterInitialize(PDRIVER_OBJECT driverObject); 22 | 23 | VOID OvsTunnelFilterUninitialize(PDRIVER_OBJECT driverObject); 24 | 25 | #endif /* __TUNNEL_INTF_H_ */ 26 | -------------------------------------------------------------------------------- /datapath-windows/ovsext/ovsext.rc: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All Rights Reserved. 3 | // 4 | 5 | #include 6 | #include 7 | 8 | /*-----------------------------------------------*/ 9 | /* the following lines are specific to this file */ 10 | /*-----------------------------------------------*/ 11 | 12 | /* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR 13 | * and VER_INTERNALNAME_STR must be defined before including COMMON.VER 14 | * The strings don't need a '\0', since common.ver has them. 15 | */ 16 | #define VER_FILETYPE VFT_DRV 17 | #define VER_FILESUBTYPE VFT2_DRV_NETWORK 18 | #define VER_FILEDESCRIPTION_STR "VMWare OVS Extension" 19 | #define VER_INTERNALNAME_STR "OVSExt.SYS" 20 | #define VER_ORIGINALFILENAME_STR "OVSExt.SYS" 21 | #define VER_LANGNEUTRAL 22 | 23 | #include "common.ver" 24 | -------------------------------------------------------------------------------- /datapath-windows/ovsext/ovsext.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TestSign 5 | 6 | 7 | TestSign 8 | 9 | 10 | TestSign 11 | 12 | 13 | TestSign 14 | 15 | 16 | -------------------------------------------------------------------------------- /datapath-windows/ovsext/precomp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 VMware, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "Types.h" 25 | 26 | #include "..\include\OvsDpInterface.h" 27 | 28 | #include "Util.h" 29 | #include "Netlink/NetlinkError.h" 30 | #include "Netlink/Netlink.h" 31 | #include "Netlink/NetlinkProto.h" 32 | 33 | #if defined OVS_USE_NL_INTERFACE && OVS_USE_NL_INTERFACE == 1 34 | #include "..\include\OvsDpInterfaceExt.h" 35 | #endif 36 | 37 | #include "..\include\OvsPub.h" 38 | -------------------------------------------------------------------------------- /datapath-windows/ovsext/precompsrc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 VMware, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "precomp.h" 18 | -------------------------------------------------------------------------------- /datapath/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | *.cmd 4 | *.ko 5 | *.mod.c 6 | Module.symvers 7 | /distfiles 8 | -------------------------------------------------------------------------------- /datapath/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = 2 | if LINUX_ENABLED 3 | SUBDIRS += linux 4 | endif 5 | 6 | EXTRA_DIST = $(dist_headers) $(dist_sources) $(dist_extras) 7 | 8 | # Suppress warnings about GNU extensions in Modules.mk files. 9 | AUTOMAKE_OPTIONS = -Wno-portability 10 | 11 | include Modules.mk 12 | include linux/Modules.mk 13 | 14 | # The following is based on commands for the Automake "distdir" target. 15 | distfiles: Makefile 16 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 17 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 18 | list='$(DISTFILES)'; \ 19 | for file in $$list; do echo $$file; done | \ 20 | sed -e "s|^$$srcdirstrip/||;t" \ 21 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@ 22 | CLEANFILES = distfiles 23 | -------------------------------------------------------------------------------- /datapath/Modules.mk: -------------------------------------------------------------------------------- 1 | # Some modules should be built and distributed, e.g. openvswitch. 2 | # 3 | # Some modules should be built but not distributed, e.g. third-party 4 | # hwtable modules. 5 | both_modules = openvswitch 6 | build_modules = $(both_modules) # Modules to build 7 | dist_modules = $(both_modules) # Modules to distribute 8 | 9 | openvswitch_sources = \ 10 | actions.c \ 11 | datapath.c \ 12 | dp_notify.c \ 13 | flow.c \ 14 | flow_netlink.c \ 15 | flow_table.c \ 16 | vport.c \ 17 | vport-geneve.c \ 18 | vport-gre.c \ 19 | vport-internal_dev.c \ 20 | vport-lisp.c \ 21 | vport-netdev.c \ 22 | vport-vxlan.c 23 | 24 | openvswitch_headers = \ 25 | compat.h \ 26 | datapath.h \ 27 | flow.h \ 28 | flow_netlink.h \ 29 | flow_table.h \ 30 | mpls.h \ 31 | vlan.h \ 32 | vport.h \ 33 | vport-internal_dev.h \ 34 | vport-netdev.h 35 | 36 | openvswitch_extras = \ 37 | README 38 | 39 | dist_sources = $(foreach module,$(dist_modules),$($(module)_sources)) 40 | dist_headers = $(foreach module,$(dist_modules),$($(module)_headers)) 41 | dist_extras = $(foreach module,$(dist_modules),$($(module)_extras)) 42 | build_sources = $(foreach module,$(build_modules),$($(module)_sources)) 43 | build_headers = $(foreach module,$(build_modules),$($(module)_headers)) 44 | build_links = $(notdir $(build_sources)) 45 | build_objects = $(notdir $(patsubst %.c,%.o,$(build_sources))) 46 | -------------------------------------------------------------------------------- /datapath/linux/.gitignore: -------------------------------------------------------------------------------- 1 | /Kbuild 2 | /Makefile 3 | /Makefile.main 4 | /Module.markers 5 | /actions.c 6 | /addrconf_core-openvswitch.c 7 | /checksum.c 8 | /dev-openvswitch.c 9 | /dp_sysfs_dp.c 10 | /dp_sysfs_if.c 11 | /datapath.c 12 | /dp_dev.c 13 | /dp_notify.c 14 | /exthdrs_core.c 15 | /flex_array.c 16 | /flow.c 17 | /flow_dissector.c 18 | /flow_netlink.c 19 | /flow_table.c 20 | /genetlink-openvswitch.c 21 | /genl_exec.c 22 | /gre.c 23 | /gso.c 24 | /hash.c 25 | /hash-x86.c 26 | /ip_output-openvswitch.c 27 | /ip_tunnels_core.c 28 | /kcompat.h 29 | /kmemdup.c 30 | /loop_counter.c 31 | /modules.order 32 | /netdevice.c 33 | /net_namespace.c 34 | /random32.c 35 | /reciprocal_div.c 36 | /skbuff-openvswitch.c 37 | /table.c 38 | /time.c 39 | /tmp 40 | /tunnel.c 41 | /utils.c 42 | /vlan.c 43 | /vport-generic.c 44 | /vport-geneve.c 45 | /vport-gre.c 46 | /vport-internal_dev.c 47 | /vport-lisp.c 48 | /vport-netdev.c 49 | /vport-patch.c 50 | /vport-vxlan.c 51 | /vport.c 52 | /vxlan.c 53 | /workqueue.c 54 | -------------------------------------------------------------------------------- /datapath/linux/Kbuild.in: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | export builddir = @abs_builddir@ 3 | export srcdir = @abs_srcdir@ 4 | export top_srcdir = @abs_top_srcdir@ 5 | export VERSION = @VERSION@ 6 | 7 | include $(srcdir)/../Modules.mk 8 | include $(srcdir)/Modules.mk 9 | 10 | EXTRA_CFLAGS := -DVERSION=\"$(VERSION)\" 11 | EXTRA_CFLAGS += -I$(srcdir)/.. 12 | EXTRA_CFLAGS += -I$(builddir)/.. 13 | EXTRA_CFLAGS += -g 14 | EXTRA_CFLAGS += -include $(builddir)/kcompat.h 15 | 16 | # These include directories have to go before -I$(KSRC)/include. 17 | # NOSTDINC_FLAGS just happens to be a variable that goes in the 18 | # right place, even though it's conceptually incorrect. 19 | NOSTDINC_FLAGS += -I$(top_srcdir)/include -I$(srcdir)/compat -I$(srcdir)/compat/include 20 | 21 | obj-m := $(patsubst %,%.o,$(build_modules)) 22 | 23 | define module_template 24 | $(1)-y = $$(notdir $$(patsubst %.c,%.o,$($(1)_sources))) 25 | endef 26 | 27 | $(foreach module,$(build_modules),$(eval $(call module_template,$(module)))) 28 | -------------------------------------------------------------------------------- /datapath/linux/Makefile.in: -------------------------------------------------------------------------------- 1 | ifeq ($(KERNELRELEASE),) 2 | # We're being called directly by running make in this directory. 3 | include Makefile.main 4 | else 5 | # We're being included by the Linux kernel build system 6 | include Kbuild 7 | endif 8 | 9 | 10 | -------------------------------------------------------------------------------- /datapath/linux/compat/hash.c: -------------------------------------------------------------------------------- 1 | /* General purpose hashing library 2 | * 3 | * That's a start of a kernel hashing library, which can be extended 4 | * with further algorithms in future. arch_fast_hash{2,}() will 5 | * eventually resolve to an architecture optimized implementation. 6 | * 7 | * Copyright 2013 Francesco Fusco 8 | * Copyright 2013 Daniel Borkmann 9 | * Copyright 2013 Thomas Graf 10 | * Licensed under the GNU General Public License, version 2.0 (GPLv2) 11 | */ 12 | 13 | #include 14 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | static struct fast_hash_ops arch_hash_ops __read_mostly = { 23 | .hash = jhash, 24 | .hash2 = jhash2, 25 | }; 26 | 27 | static bool arch_inited __read_mostly; 28 | static void init_arch(void) 29 | { 30 | if (likely(arch_inited)) 31 | return; 32 | 33 | setup_arch_fast_hash(&arch_hash_ops); 34 | arch_inited = true; 35 | } 36 | 37 | u32 arch_fast_hash(const void *data, u32 len, u32 seed) 38 | { 39 | init_arch(); 40 | 41 | return arch_hash_ops.hash(data, len, seed); 42 | } 43 | 44 | u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed) 45 | { 46 | init_arch(); 47 | 48 | return arch_hash_ops.hash2(data, len, seed); 49 | } 50 | 51 | #endif /* < 3.14 */ 52 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/asm/hash.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_HASH_WRAPPER_H 2 | #define _ASM_HASH_WRAPPER_H 3 | 4 | #include 5 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) 6 | #include_next 7 | #else 8 | 9 | struct fast_hash_ops; 10 | #ifdef CONFIG_X86 11 | extern void setup_arch_fast_hash(struct fast_hash_ops *ops); 12 | #else 13 | static inline void setup_arch_fast_hash(struct fast_hash_ops *ops) { } 14 | #endif 15 | 16 | #endif /* < 3.14 */ 17 | 18 | #endif /* _ASM_HASH_WRAPPER_H */ 19 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/bug.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_BUG_WRAPPER_H 2 | #define __LINUX_BUG_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifdef __CHECKER__ 7 | #ifndef BUILD_BUG_ON_INVALID 8 | #define BUILD_BUG_ON_INVALID(e) (0) 9 | #endif 10 | 11 | #endif /* __CHECKER__ */ 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/compiler-gcc.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_COMPILER_H 2 | #error "Please don't include directly, include instead." 3 | #endif 4 | 5 | #include_next 6 | 7 | #ifndef __packed 8 | #define __packed __attribute__((packed)) 9 | #endif 10 | 11 | #ifndef __always_unused 12 | #define __always_unused __attribute__((unused)) 13 | #endif 14 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_COMPILER_WRAPPER_H 2 | #define __LINUX_COMPILER_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef __percpu 7 | #define __percpu 8 | #endif 9 | 10 | #ifndef __rcu 11 | #define __rcu 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/cpumask.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_CPUMASK_WRAPPER_H 2 | #define __LINUX_CPUMASK_WRAPPER_H 3 | 4 | #include_next 5 | 6 | /* for_each_cpu was renamed for_each_possible_cpu in 2.6.18. */ 7 | #ifndef for_each_possible_cpu 8 | #define for_each_possible_cpu for_each_cpu 9 | #endif 10 | 11 | #endif /* linux/cpumask.h wrapper */ 12 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/err.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_ERR_WRAPPER_H 2 | #define __LINUX_ERR_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_ERR_CAST 7 | /** 8 | * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type 9 | * @ptr: The pointer to cast. 10 | * 11 | * Explicitly cast an error-valued pointer to another pointer type in such a 12 | * way as to make it clear that's what's going on. 13 | */ 14 | static inline void *ERR_CAST(const void *ptr) 15 | { 16 | /* cast away the const */ 17 | return (void *) ptr; 18 | } 19 | #endif /* HAVE_ERR_CAST */ 20 | 21 | #ifndef HAVE_IS_ERR_OR_NULL 22 | static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr) 23 | { 24 | return !ptr || IS_ERR_VALUE((unsigned long)ptr); 25 | } 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/hash.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_HASH_WRAPPER_H 2 | #define _LINUX_HASH_WRAPPER_H 3 | 4 | #include_next 5 | #include 6 | 7 | #ifndef HAVE_FAST_HASH_OPS 8 | 9 | struct fast_hash_ops { 10 | u32 (*hash)(const void *data, u32 len, u32 seed); 11 | u32 (*hash2)(const u32 *data, u32 len, u32 seed); 12 | }; 13 | 14 | /** 15 | * arch_fast_hash - Caclulates a hash over a given buffer that can have 16 | * arbitrary size. This function will eventually use an 17 | * architecture-optimized hashing implementation if 18 | * available, and trades off distribution for speed. 19 | * 20 | * @data: buffer to hash 21 | * @len: length of buffer in bytes 22 | * @seed: start seed 23 | * 24 | * Returns 32bit hash. 25 | */ 26 | extern u32 arch_fast_hash(const void *data, u32 len, u32 seed); 27 | 28 | /** 29 | * arch_fast_hash2 - Caclulates a hash over a given buffer that has a 30 | * size that is of a multiple of 32bit words. This 31 | * function will eventually use an architecture- 32 | * optimized hashing implementation if available, 33 | * and trades off distribution for speed. 34 | * 35 | * @data: buffer to hash (must be 32bit padded) 36 | * @len: number of 32bit words 37 | * @seed: start seed 38 | * 39 | * Returns 32bit hash. 40 | */ 41 | extern u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed); 42 | #endif /* !HASH_FAST_HASH_OPS */ 43 | 44 | #endif /* _LINUX_HASH_WRAPPER_H */ 45 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/icmp.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_ICMP_WRAPPER_H 2 | #define __LINUX_ICMP_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_SKBUFF_HEADER_HELPERS 7 | static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb) 8 | { 9 | return (struct icmphdr *)skb_transport_header(skb); 10 | } 11 | #endif 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/icmpv6.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_ICMPV6_WRAPPER_H 2 | #define __LINUX_ICMPV6_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_ICMP6_HDR 7 | static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb) 8 | { 9 | return (struct icmp6hdr *)skb_transport_header(skb); 10 | } 11 | #endif 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/if.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_IF_WRAPPER_H 2 | #define __LINUX_IF_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/if_arp.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_IF_ARP_WRAPPER_H 2 | #define __LINUX_IF_ARP_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_SKBUFF_HEADER_HELPERS 7 | #include 8 | 9 | static inline struct arphdr *arp_hdr(const struct sk_buff *skb) 10 | { 11 | return (struct arphdr *)skb_network_header(skb); 12 | } 13 | #endif /* !HAVE_SKBUFF_HEADER_HELPERS */ 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/if_ether.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_IF_ETHER_WRAPPER_H 2 | #define __LINUX_IF_ETHER_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef ETH_P_802_3_MIN 7 | #define ETH_P_802_3_MIN 0x0600 8 | #endif 9 | 10 | #ifndef ETH_P_8021AD 11 | #define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */ 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/in.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_IN_WRAPPER_H 2 | #define __LINUX_IN_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) 8 | static inline int proto_ports_offset(int proto) 9 | { 10 | switch (proto) { 11 | case IPPROTO_TCP: 12 | case IPPROTO_UDP: 13 | case IPPROTO_DCCP: 14 | case IPPROTO_ESP: /* SPI */ 15 | case IPPROTO_SCTP: 16 | case IPPROTO_UDPLITE: 17 | return 0; 18 | case IPPROTO_AH: /* SPI */ 19 | return 4; 20 | default: 21 | return -EINVAL; 22 | } 23 | } 24 | #endif 25 | 26 | #ifndef HAVE_IPV4_IS_MULTICAST 27 | 28 | static inline bool ipv4_is_loopback(__be32 addr) 29 | { 30 | return (addr & htonl(0xff000000)) == htonl(0x7f000000); 31 | } 32 | 33 | static inline bool ipv4_is_multicast(__be32 addr) 34 | { 35 | return (addr & htonl(0xf0000000)) == htonl(0xe0000000); 36 | } 37 | 38 | static inline bool ipv4_is_local_multicast(__be32 addr) 39 | { 40 | return (addr & htonl(0xffffff00)) == htonl(0xe0000000); 41 | } 42 | 43 | static inline bool ipv4_is_lbcast(__be32 addr) 44 | { 45 | /* limited broadcast */ 46 | return addr == htonl(INADDR_BROADCAST); 47 | } 48 | 49 | static inline bool ipv4_is_zeronet(__be32 addr) 50 | { 51 | return (addr & htonl(0xff000000)) == htonl(0x00000000); 52 | } 53 | 54 | #endif /* !HAVE_IPV4_IS_MULTICAST */ 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/ip.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_IP_WRAPPER_H 2 | #define __LINUX_IP_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_SKBUFF_HEADER_HELPERS 7 | #include 8 | static inline struct iphdr *ip_hdr(const struct sk_buff *skb) 9 | { 10 | return (struct iphdr *)skb_network_header(skb); 11 | } 12 | 13 | static inline unsigned int ip_hdrlen(const struct sk_buff *skb) 14 | { 15 | return ip_hdr(skb)->ihl * 4; 16 | } 17 | #endif /* !HAVE_SKBUFF_HEADER_HELPERS */ 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/ipv6.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_IPV6_WRAPPER_H 2 | #define __LINUX_IPV6_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_SKBUFF_HEADER_HELPERS 7 | static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb) 8 | { 9 | return (struct ipv6hdr *)skb_network_header(skb); 10 | } 11 | #endif 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/jiffies.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_JIFFIES_WRAPPER_H 2 | #define __LINUX_JIFFIES_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | 8 | /* Same as above, but does so with platform independent 64bit types. 9 | * These must be used when utilizing jiffies_64 (i.e. return value of 10 | * get_jiffies_64() */ 11 | 12 | #ifndef time_after64 13 | #define time_after64(a, b) \ 14 | (typecheck(__u64, a) && \ 15 | typecheck(__u64, b) && \ 16 | ((__s64)(b) - (__s64)(a) < 0)) 17 | #endif 18 | 19 | #ifndef time_before64 20 | #define time_before64(a, b) time_after64(b, a) 21 | #endif 22 | 23 | #ifndef time_after_eq64 24 | #define time_after_eq64(a, b) \ 25 | (typecheck(__u64, a) && \ 26 | typecheck(__u64, b) && \ 27 | ((__s64)(a) - (__s64)(b) >= 0)) 28 | #endif 29 | 30 | #ifndef time_before_eq64 31 | #define time_before_eq64(a, b) time_after_eq64(b, a) 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/list.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_LIST_WRAPPER_H 2 | #define __LINUX_LIST_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef hlist_entry_safe 7 | #define hlist_entry_safe(ptr, type, member) \ 8 | ({ typeof(ptr) ____ptr = (ptr); \ 9 | ____ptr ? hlist_entry(____ptr, type, member) : NULL; \ 10 | }) 11 | 12 | #undef hlist_for_each_entry 13 | #define hlist_for_each_entry(pos, head, member) \ 14 | for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\ 15 | pos; \ 16 | pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) 17 | 18 | #undef hlist_for_each_entry_safe 19 | #define hlist_for_each_entry_safe(pos, n, head, member) \ 20 | for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\ 21 | pos && ({ n = pos->member.next; 1; }); \ 22 | pos = hlist_entry_safe(n, typeof(*pos), member)) 23 | 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/log2.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_LOG2_WRAPPER 2 | #define __LINUX_LOG2_WRAPPER 3 | 4 | #ifdef HAVE_LOG2_H 5 | #include_next 6 | #else 7 | /* This is very stripped down because log2.h has far too many dependencies. */ 8 | 9 | extern __attribute__((const, noreturn)) 10 | int ____ilog2_NaN(void); 11 | 12 | #define ilog2(n) ((n) == 4 ? 2 : \ 13 | (n) == 8 ? 3 : \ 14 | ____ilog2_NaN()) 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/netdev_features.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_NETDEV_FEATURES_WRAPPER_H 2 | #define __LINUX_NETDEV_FEATURES_WRAPPER_H 3 | 4 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) 5 | #include_next 6 | #endif 7 | 8 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) 9 | #define NETIF_F_HW_VLAN_CTAG_TX NETIF_F_HW_VLAN_TX 10 | #endif 11 | 12 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) 13 | #define NETIF_F_GSO_ENCAP_ALL 0 14 | 15 | #else 16 | 17 | #ifndef NETIF_F_GSO_GRE 18 | #define NETIF_F_GSO_GRE 0 19 | #endif 20 | 21 | #ifndef NETIF_F_GSO_GRE_CSUM 22 | #define NETIF_F_GSO_GRE_CSUM 0 23 | #endif 24 | 25 | #ifndef NETIF_F_GSO_IPIP 26 | #define NETIF_F_GSO_IPIP 0 27 | #endif 28 | 29 | #ifndef NETIF_F_GSO_SIT 30 | #define NETIF_F_GSO_SIT 0 31 | #endif 32 | 33 | #ifndef NETIF_F_GSO_UDP_TUNNEL 34 | #define NETIF_F_GSO_UDP_TUNNEL 0 35 | #endif 36 | 37 | #ifndef NETIF_F_GSO_UDP_TUNNEL_CSUM 38 | #define NETIF_F_GSO_UDP_TUNNEL_CSUM 0 39 | #endif 40 | 41 | #ifndef NETIF_F_GSO_MPLS 42 | #define NETIF_F_GSO_MPLS 0 43 | #endif 44 | 45 | #define NETIF_F_GSO_ENCAP_ALL (NETIF_F_GSO_GRE | \ 46 | NETIF_F_GSO_GRE_CSUM | \ 47 | NETIF_F_GSO_IPIP | \ 48 | NETIF_F_GSO_SIT | \ 49 | NETIF_F_GSO_UDP_TUNNEL | \ 50 | NETIF_F_GSO_UDP_TUNNEL_CSUM | \ 51 | NETIF_F_GSO_MPLS) 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/netlink.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_NETLINK_WRAPPER_H 2 | #define __LINUX_NETLINK_WRAPPER_H 1 3 | 4 | #include 5 | #include_next 6 | 7 | #ifndef NLA_TYPE_MASK 8 | #define NLA_F_NESTED (1 << 15) 9 | #define NLA_F_NET_BYTEORDER (1 << 14) 10 | #define NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)) 11 | #endif 12 | 13 | #include 14 | 15 | #ifndef NLMSG_DEFAULT_SIZE 16 | #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/percpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_PERCPU_WRAPPER_H 2 | #define __LINUX_PERCPU_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #if !defined this_cpu_ptr 7 | #define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id()) 8 | #endif 9 | 10 | #if !defined this_cpu_read 11 | #define this_cpu_read(ptr) percpu_read(ptr) 12 | #endif 13 | 14 | #if !defined this_cpu_inc 15 | #define this_cpu_inc(ptr) percpu_add(ptr, 1) 16 | #endif 17 | 18 | #if !defined this_cpu_dec 19 | #define this_cpu_dec(ptr) percpu_sub(ptr, 1) 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/poison.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_POISON_WRAPPER_H 2 | #define __LINUX_POISON_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef FLEX_ARRAY_FREE 7 | /********** lib/flex_array.c **********/ 8 | #define FLEX_ARRAY_FREE 0x6c /* for use-after-free poisoning */ 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/random.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_RANDOM_WRAPPER_H 2 | #define __LINUX_RANDOM_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_PRANDOM_U32 7 | #define prandom_u32() random32() 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/rculist.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_RCULIST_WRAPPER_H 2 | #define __LINUX_RCULIST_WRAPPER_H 3 | 4 | #include_next 5 | 6 | #ifndef hlist_first_rcu 7 | #define hlist_first_rcu(head) (*((struct hlist_node __rcu **)(&(head)->first))) 8 | #define hlist_next_rcu(node) (*((struct hlist_node __rcu **)(&(node)->next))) 9 | #define hlist_pprev_rcu(node) (*((struct hlist_node __rcu **)((node)->pprev))) 10 | #endif 11 | 12 | #undef hlist_for_each_entry_rcu 13 | #define hlist_for_each_entry_rcu(pos, head, member) \ 14 | for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\ 15 | typeof(*(pos)), member); \ 16 | pos; \ 17 | pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\ 18 | &(pos)->member)), typeof(*(pos)), member)) 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/rcupdate.h: -------------------------------------------------------------------------------- 1 | #ifndef __RCUPDATE_WRAPPER_H 2 | #define __RCUPDATE_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef rcu_dereference_check 7 | #define rcu_dereference_check(p, c) rcu_dereference(p) 8 | #endif 9 | 10 | #ifndef rcu_dereference_protected 11 | #define rcu_dereference_protected(p, c) (p) 12 | #endif 13 | 14 | #ifndef rcu_dereference_raw 15 | #define rcu_dereference_raw(p) rcu_dereference_check(p, 1) 16 | #endif 17 | 18 | #ifndef rcu_access_pointer 19 | #define rcu_access_pointer(p) rcu_dereference(p) 20 | #endif 21 | 22 | #ifndef HAVE_RCU_READ_LOCK_HELD 23 | static inline int rcu_read_lock_held(void) 24 | { 25 | return 1; 26 | } 27 | #endif 28 | 29 | #ifndef RCU_INITIALIZER 30 | #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v) 31 | #endif 32 | 33 | #ifndef RCU_INIT_POINTER 34 | #define RCU_INIT_POINTER(p, v) \ 35 | do { \ 36 | p = RCU_INITIALIZER(v); \ 37 | } while (0) 38 | 39 | #endif 40 | 41 | #endif /* linux/rcupdate.h wrapper */ 42 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/reciprocal_div.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_RECIPROCAL_DIV_WRAPPER_H 2 | #define _LINUX_RECIPROCAL_DIV_WRAPPER_H 1 3 | 4 | #include 5 | 6 | /* 7 | * This algorithm is based on the paper "Division by Invariant 8 | * Integers Using Multiplication" by Torbjörn Granlund and Peter 9 | * L. Montgomery. 10 | * 11 | * The assembler implementation from Agner Fog, which this code is 12 | * based on, can be found here: 13 | * http://www.agner.org/optimize/asmlib.zip 14 | * 15 | * This optimization for A/B is helpful if the divisor B is mostly 16 | * runtime invariant. The reciprocal of B is calculated in the 17 | * slow-path with reciprocal_value(). The fast-path can then just use 18 | * a much faster multiplication operation with a variable dividend A 19 | * to calculate the division A/B. 20 | */ 21 | 22 | #define reciprocal_value rpl_reciprocal_value 23 | struct reciprocal_value { 24 | u32 m; 25 | u8 sh1, sh2; 26 | }; 27 | 28 | struct reciprocal_value reciprocal_value(u32 d); 29 | 30 | #define reciprocal_divide rpl_reciprocal_divide 31 | static inline u32 reciprocal_divide(u32 a, struct reciprocal_value R) 32 | { 33 | u32 t = (u32)(((u64)a * R.m) >> 32); 34 | return (t + ((a - t) >> R.sh1)) >> R.sh2; 35 | } 36 | 37 | #endif /* _LINUX_RECIPROCAL_DIV_WRAPPER_H */ 38 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/rtnetlink.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTNETLINK_WRAPPER_H 2 | #define __RTNETLINK_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_LOCKDEP_RTNL_IS_HELD 7 | #ifdef CONFIG_PROVE_LOCKING 8 | static inline int lockdep_rtnl_is_held(void) 9 | { 10 | return 1; 11 | } 12 | #endif 13 | #endif 14 | 15 | #ifndef rcu_dereference_rtnl 16 | /** 17 | * rcu_dereference_rtnl - rcu_dereference with debug checking 18 | * @p: The pointer to read, prior to dereferencing 19 | * 20 | * Do an rcu_dereference(p), but check caller either holds rcu_read_lock() 21 | * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() 22 | */ 23 | #define rcu_dereference_rtnl(p) \ 24 | rcu_dereference_check(p, rcu_read_lock_held() || \ 25 | lockdep_rtnl_is_held()) 26 | #endif 27 | 28 | #ifndef rtnl_dereference 29 | /** 30 | * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL 31 | * @p: The pointer to read, prior to dereferencing 32 | * 33 | * Return the value of the specified RCU-protected pointer, but omit 34 | * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because 35 | * caller holds RTNL. 36 | */ 37 | #define rtnl_dereference(p) \ 38 | rcu_dereference_protected(p, lockdep_rtnl_is_held()) 39 | #endif 40 | 41 | #endif /* linux/rtnetlink.h wrapper */ 42 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/sctp.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_SCTP_WRAPPER_H 2 | #define __LINUX_SCTP_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_SKBUFF_HEADER_HELPERS 7 | static inline struct sctphdr *sctp_hdr(const struct sk_buff *skb) 8 | { 9 | return (struct sctphdr *)skb_transport_header(skb); 10 | } 11 | #endif /* HAVE_SKBUFF_HEADER_HELPERS */ 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_STDDEF_WRAPPER_H 2 | #define __LINUX_STDDEF_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifdef __KERNEL__ 7 | 8 | #ifndef HAVE_BOOL_TYPE 9 | enum { 10 | false = 0, 11 | true = 1 12 | }; 13 | #endif /* !HAVE_BOOL_TYPE */ 14 | 15 | #endif /* __KERNEL__ */ 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_TCP_WRAPPER_H 2 | #define __LINUX_TCP_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_SKBUFF_HEADER_HELPERS 7 | static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) 8 | { 9 | return (struct tcphdr *)skb_transport_header(skb); 10 | } 11 | 12 | static inline unsigned int tcp_hdrlen(const struct sk_buff *skb) 13 | { 14 | return tcp_hdr(skb)->doff * 4; 15 | } 16 | #endif /* !HAVE_SKBUFF_HEADER_HELPERS */ 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/types.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_TYPES_WRAPPER_H 2 | #define __LINUX_TYPES_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_CSUM_TYPES 7 | typedef __u16 __bitwise __sum16; 8 | typedef __u32 __bitwise __wsum; 9 | #endif 10 | 11 | #ifndef HAVE_BOOL_TYPE 12 | typedef _Bool bool; 13 | #endif /* !HAVE_BOOL_TYPE */ 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/udp.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_UDP_WRAPPER_H 2 | #define __LINUX_UDP_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_SKBUFF_HEADER_HELPERS 7 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) 8 | { 9 | return (struct udphdr *)skb_transport_header(skb); 10 | } 11 | #endif /* HAVE_SKBUFF_HEADER_HELPERS */ 12 | 13 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) 14 | static inline void udp_encap_enable(void) 15 | { 16 | } 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/linux/workqueue.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_WORKQUEUE_WRAPPER_H 2 | #define __LINUX_WORKQUEUE_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) 7 | #define queue_work(wq, dw) schedule_work(dw); 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/checksum.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_CHECKSUM_WRAPPER_H 2 | #define __NET_CHECKSUM_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_CSUM_UNFOLD 7 | static inline __wsum csum_unfold(__sum16 n) 8 | { 9 | return (__force __wsum)n; 10 | } 11 | #endif /* !HAVE_CSUM_UNFOLD */ 12 | 13 | /* Workaround for debugging included in certain versions of XenServer. It only 14 | * applies to 32-bit x86. 15 | */ 16 | #if defined(HAVE_CSUM_COPY_DBG) && defined(CONFIG_X86_32) 17 | #define csum_and_copy_to_user(src, dst, len, sum, err_ptr) \ 18 | csum_and_copy_to_user(src, dst, len, sum, NULL, err_ptr) 19 | #endif 20 | 21 | #ifndef HAVE_CSUM_REPLACE4 22 | static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to) 23 | { 24 | __be32 diff[] = { ~from, to }; 25 | 26 | *sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum))); 27 | } 28 | 29 | static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to) 30 | { 31 | csum_replace4(sum, (__force __be32)from, (__force __be32)to); 32 | } 33 | #endif 34 | 35 | #ifndef CSUM_MANGLED_0 36 | #define CSUM_MANGLED_0 ((__force __sum16)0xffff) 37 | #endif 38 | 39 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) 40 | void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, 41 | const __be32 *from, const __be32 *to, 42 | int pseudohdr); 43 | #endif 44 | #endif /* checksum.h */ 45 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/dst.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_DST_WRAPPER_H 2 | #define __NET_DST_WRAPPER_H 1 3 | 4 | #include 5 | #include_next 6 | 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) && \ 8 | LINUX_VERSION_CODE > KERNEL_VERSION(3,0,20) 9 | 10 | #define dst_get_neighbour_noref dst_get_neighbour 11 | 12 | #endif 13 | 14 | #ifndef HAVE_SKB_DST_ACCESSOR_FUNCS 15 | 16 | static inline void skb_dst_drop(struct sk_buff *skb) 17 | { 18 | if (skb->dst) 19 | dst_release(skb_dst(skb)); 20 | skb->dst = NULL; 21 | } 22 | 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/flow_keys.h: -------------------------------------------------------------------------------- 1 | #ifndef _NET_FLOW_KEYS_WRAPPER_H 2 | #define _NET_FLOW_KEYS_WRAPPER_H 3 | 4 | #include 5 | 6 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) 7 | #include_next 8 | #else 9 | struct flow_keys { 10 | /* (src,dst) must be grouped, in the same way than in IP header */ 11 | __be32 src; 12 | __be32 dst; 13 | union { 14 | __be32 ports; 15 | __be16 port16[2]; 16 | }; 17 | u16 thoff; 18 | u8 ip_proto; 19 | }; 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/geneve.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_GENEVE_WRAPPER_H 2 | #define __NET_GENEVE_WRAPPER_H 1 3 | 4 | /* Not yet upstream. */ 5 | #define GENEVE_CRIT_OPT_TYPE (1 << 7) 6 | struct geneve_opt { 7 | __be16 opt_class; 8 | u8 type; 9 | #ifdef __LITTLE_ENDIAN_BITFIELD 10 | u8 length:5; 11 | u8 r3:1; 12 | u8 r2:1; 13 | u8 r1:1; 14 | #else 15 | u8 r1:1; 16 | u8 r2:1; 17 | u8 r3:1; 18 | u8 length:5; 19 | #endif 20 | u8 opt_data[]; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/inet_frag.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_INET_FRAG_WRAPPER_H 2 | #define __NET_INET_FRAG_WRAPPER_H 1 3 | 4 | #include 5 | #include_next 6 | 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) 8 | #define inet_frag_evictor(nf, f, force) \ 9 | do { \ 10 | if (force || atomic_read(&nf->mem) > nf->high_thresh) { \ 11 | inet_frag_evictor(nf, f); \ 12 | } \ 13 | } while (0) 14 | #endif 15 | 16 | #endif /* inet_frag.h */ 17 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/ip.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_IP_WRAPPER_H 2 | #define __NET_IP_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | 8 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0) 9 | static inline bool ip_is_fragment(const struct iphdr *iph) 10 | { 11 | return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0; 12 | } 13 | #endif 14 | 15 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) 16 | static inline void rpl_inet_get_local_port_range(struct net *net, int *low, 17 | int *high) 18 | { 19 | inet_get_local_port_range(low, high); 20 | } 21 | #define inet_get_local_port_range rpl_inet_get_local_port_range 22 | 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/netfilter/nf_conntrack.h: -------------------------------------------------------------------------------- 1 | #ifndef __NF_CONNTRACK_WRAPPER_H 2 | #define __NF_CONNTRACK_WRAPPER_H 1 3 | 4 | #include 5 | #include_next 6 | 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) 8 | void nf_conntrack_tmpl_insert(struct net *net, struct nf_conn *tmpl); 9 | #endif 10 | 11 | #endif /* net/netfilter/nf_conntrack.h */ 12 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/sctp/checksum.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCTP_CHECKSUM_WRAPPER_H 2 | #define __SCTP_CHECKSUM_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_SCTP_COMPUTE_CKSUM 7 | static inline __le32 sctp_compute_cksum(const struct sk_buff *skb, 8 | unsigned int offset) 9 | { 10 | const struct sk_buff *iter; 11 | 12 | __u32 crc32 = sctp_start_cksum(skb->data + offset, 13 | skb_headlen(skb) - offset); 14 | skb_walk_frags(skb, iter) 15 | crc32 = sctp_update_cksum((__u8 *) iter->data, 16 | skb_headlen(iter), crc32); 17 | 18 | /* Open-code sctp_end_cksum() to avoid a sparse warning due to a bug in 19 | * sparse annotations in Linux fixed in 3.10 in commit eee1d5a14 (sctp: 20 | * Correct type and usage of sctp_end_cksum()). */ 21 | return cpu_to_le32(~crc32); 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/sock.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_SOCK_WRAPPER_H 2 | #define __NET_SOCK_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef __sk_user_data 7 | #define __sk_user_data(sk) ((*((void __rcu **)&(sk)->sk_user_data))) 8 | 9 | #define rcu_dereference_sk_user_data(sk) rcu_dereference(__sk_user_data((sk))) 10 | #define rcu_assign_sk_user_data(sk, ptr) rcu_assign_pointer(__sk_user_data((sk)), ptr) 11 | #endif 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /datapath/linux/compat/include/net/udp.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_UDP_WRAPPER_H 2 | #define __NET_UDP_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_UDP_FLOW_SRC_PORT 7 | static inline __be16 udp_flow_src_port(struct net *net, struct sk_buff *skb, 8 | int min, int max, bool use_eth) 9 | { 10 | u32 hash; 11 | 12 | if (min >= max) { 13 | /* Use default range */ 14 | inet_get_local_port_range(net, &min, &max); 15 | } 16 | 17 | hash = skb_get_hash(skb); 18 | if (unlikely(!hash) && use_eth) { 19 | /* Can't find a normal hash, caller has indicated an Ethernet 20 | * packet so use that to compute a hash. 21 | */ 22 | hash = jhash(skb->data, 2 * ETH_ALEN, 23 | (__force u32) skb->protocol); 24 | } 25 | 26 | /* Since this is being sent on the wire obfuscate hash a bit 27 | * to minimize possbility that any useful information to an 28 | * attacker is leaked. Only upper 16 bits are relevant in the 29 | * computation for 16 bit port value. 30 | */ 31 | hash ^= hash << 16; 32 | 33 | return htons((((u64) hash * (max - min)) >> 32) + min); 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /datapath/linux/compat/net_namespace.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) 7 | 8 | int compat_init_net(struct net *net, struct rpl_pernet_operations *pnet) 9 | { 10 | int err; 11 | void *ovs_net = kzalloc(pnet->size, GFP_KERNEL); 12 | 13 | if (!ovs_net) 14 | return -ENOMEM; 15 | 16 | err = net_assign_generic(net, *pnet->id, ovs_net); 17 | if (err) 18 | goto err; 19 | 20 | if (pnet->init) { 21 | err = pnet->init(net); 22 | if (err) 23 | goto err; 24 | } 25 | 26 | return 0; 27 | err: 28 | kfree(ovs_net); 29 | return err; 30 | } 31 | 32 | void compat_exit_net(struct net *net, struct rpl_pernet_operations *pnet) 33 | { 34 | void *ovs_net = net_generic(net, *pnet->id); 35 | 36 | if (pnet->exit) 37 | pnet->exit(net); 38 | kfree(ovs_net); 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /datapath/linux/compat/reciprocal_div.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* 6 | * For a description of the algorithm please have a look at 7 | * include/linux/reciprocal_div.h 8 | */ 9 | 10 | struct reciprocal_value reciprocal_value(u32 d) 11 | { 12 | struct reciprocal_value R; 13 | u64 m; 14 | int l; 15 | 16 | l = fls(d - 1); 17 | m = ((1ULL << 32) * ((1ULL << l) - d)); 18 | do_div(m, d); 19 | ++m; 20 | R.m = (u32)m; 21 | R.sh1 = min(l, 1); 22 | R.sh2 = max(l - 1, 0); 23 | 24 | return R; 25 | } 26 | -------------------------------------------------------------------------------- /datapath/mpls.h: -------------------------------------------------------------------------------- 1 | #ifndef MPLS_H 2 | #define MPLS_H 1 3 | 4 | #include 5 | 6 | #define MPLS_BOS_MASK 0x00000100 7 | #define MPLS_HLEN 4 8 | 9 | static inline bool eth_p_mpls(__be16 eth_type) 10 | { 11 | return eth_type == htons(ETH_P_MPLS_UC) || 12 | eth_type == htons(ETH_P_MPLS_MC); 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /datapath/vport-internal_dev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2011 Nicira, Inc. 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of version 2 of the GNU General Public 6 | * License as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software 15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 16 | * 02110-1301, USA 17 | */ 18 | 19 | #ifndef VPORT_INTERNAL_DEV_H 20 | #define VPORT_INTERNAL_DEV_H 1 21 | 22 | #include "datapath.h" 23 | #include "vport.h" 24 | 25 | int ovs_is_internal_dev(const struct net_device *); 26 | struct vport *ovs_internal_dev_get_vport(struct net_device *); 27 | 28 | #endif /* vport-internal_dev.h */ 29 | -------------------------------------------------------------------------------- /datapath/vport-netdev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2011 Nicira, Inc. 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of version 2 of the GNU General Public 6 | * License as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software 15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 16 | * 02110-1301, USA 17 | */ 18 | 19 | #ifndef VPORT_NETDEV_H 20 | #define VPORT_NETDEV_H 1 21 | 22 | #include 23 | #include 24 | 25 | #include "vport.h" 26 | 27 | struct vport *ovs_netdev_get_vport(struct net_device *dev); 28 | 29 | struct netdev_vport { 30 | struct rcu_head rcu; 31 | 32 | struct net_device *dev; 33 | }; 34 | 35 | static inline struct netdev_vport * 36 | netdev_vport_priv(const struct vport *vport) 37 | { 38 | return vport_priv(vport); 39 | } 40 | 41 | const char *ovs_netdev_get_name(const struct vport *); 42 | void ovs_netdev_detach_dev(struct vport *); 43 | 44 | #endif /* vport_netdev.h */ 45 | -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | *.debhelper 2 | *.debhelper.log 3 | *.substvars 4 | /control 5 | /copyright 6 | /files 7 | /nicira-switch 8 | /openvswitch 9 | /openvswitch-common 10 | /openvswitch-common.copyright 11 | /openvswitch-datapath-source 12 | /openvswitch-datapath-dkms 13 | /openvswitch-dbg 14 | /openvswitch-ipsec 15 | /openvswitch-pki 16 | /openvswitch-switch 17 | /openvswitch-switch.copyright 18 | /openvswitch-test 19 | /openvswitch-testcontroller 20 | /openvswitch-vtep 21 | /python-openvswitch 22 | /tmp 23 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /debian/control.modules.in: -------------------------------------------------------------------------------- 1 | Source: openvswitch 2 | Section: net 3 | Priority: extra 4 | Maintainer: Open vSwitch developers 5 | Build-Depends: debhelper (>= 5.0.37) 6 | Standards-Version: 3.7.3 7 | 8 | Package: openvswitch-datapath-module-_KVERS_ 9 | Architecture: any 10 | Recommends: kernel-image-_KVERS_, openvswitch-switch 11 | Provides: openvswitch-datapath-module 12 | Description: Open vSwitch Linux datapath kernel module 13 | This package contains the Open vSwitch loadable datapath kernel modules for 14 | the kernel-image-_KVERS_ package. 15 | . 16 | If you compiled a custom kernel, you will most likely need to compile 17 | a custom version of this module as well. The 18 | openvswitch-datapath-source package has been provided for this 19 | purpose. Refer to README.Debian provided in that package for further 20 | instructions. 21 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/sbin 3 | -------------------------------------------------------------------------------- /debian/dkms.conf.in: -------------------------------------------------------------------------------- 1 | PACKAGE_NAME="openvswitch" 2 | PACKAGE_VERSION="__VERSION__" 3 | MAKE="./configure --with-linux='${kernel_source_dir}' && make -C datapath/linux" 4 | BUILT_MODULE_NAME[0]=openvswitch 5 | BUILT_MODULE_LOCATION[0]=datapath/linux/ 6 | DEST_MODULE_LOCATION[0]=/kernel/drivers/net/openvswitch/ 7 | AUTOINSTALL=yes 8 | -------------------------------------------------------------------------------- /debian/openvswitch-common.dirs: -------------------------------------------------------------------------------- 1 | var/log/openvswitch 2 | -------------------------------------------------------------------------------- /debian/openvswitch-common.docs: -------------------------------------------------------------------------------- 1 | FAQ 2 | INSTALL.DPDK 3 | -------------------------------------------------------------------------------- /debian/openvswitch-common.install: -------------------------------------------------------------------------------- 1 | usr/bin/ovs-appctl 2 | usr/bin/ovs-benchmark 3 | usr/bin/ovs-docker 4 | usr/bin/ovs-ofctl 5 | usr/bin/ovs-parse-backtrace 6 | usr/bin/ovs-pki 7 | usr/bin/ovsdb-client 8 | usr/sbin/ovs-bugtool 9 | usr/share/openvswitch/bugtool-plugins 10 | usr/share/openvswitch/scripts/ovs-bugtool-* 11 | -------------------------------------------------------------------------------- /debian/openvswitch-common.manpages: -------------------------------------------------------------------------------- 1 | _debian/ovsdb/ovsdb-client.1 2 | _debian/ovsdb/ovsdb-tool.1 3 | _debian/utilities/ovs-appctl.8 4 | _debian/utilities/ovs-benchmark.1 5 | _debian/utilities/ovs-ofctl.8 6 | _debian/utilities/ovs-pki.8 7 | _debian/utilities/bugtool/ovs-bugtool.8 8 | utilities/ovs-parse-backtrace.8 9 | -------------------------------------------------------------------------------- /debian/openvswitch-datapath-dkms.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | package=openvswitch-datapath-dkms 6 | name=openvswitch 7 | 8 | version=`dpkg-query -W -f='${Version}' "$package" \ 9 | |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"` 10 | 11 | isadded=`dkms status -m "$name" -v "$version"` 12 | 13 | if [ "x${isadded}" = "x" ] ; then 14 | dkms add -m "$name" -v "$version" 15 | fi 16 | 17 | if [ "$1" = 'configure' ] ; then 18 | dkms build -m "$name" -v "$version" && dkms install -m "$name" -v "$version" || true 19 | fi 20 | 21 | #DEBHELPER# 22 | -------------------------------------------------------------------------------- /debian/openvswitch-datapath-dkms.prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | package=openvswitch-datapath-dkms 6 | name=openvswitch 7 | 8 | version=`dpkg-query -W -f='${Version}' "$package" \ 9 | |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"` 10 | 11 | dkms remove -m "$name" -v "$version" --all || true 12 | 13 | #DEBHELPER# 14 | 15 | exit 0 16 | -------------------------------------------------------------------------------- /debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for #PACKAGE# 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | #DEBHELPER# 9 | 10 | # If the kernel module is already loaded, we have nothing to do here. 11 | # A force-reload-kmod should be run manually to use the new kernel module. 12 | if [ -e /sys/module/openvswitch ] || [ -e /sys/module/openvswitch_mod ]; then 13 | exit 0 14 | fi 15 | 16 | # If the kernel module is not loaded, then it is likely because none 17 | # was installed before and therefore Open vSwitch couldn't be started. 18 | # Try to start it now. 19 | # 20 | # (Ideally we'd only want to do this if this package corresponds to the 21 | # running kernel, but I don't know a reliable way to check.) 22 | INIT=/etc/init.d/openvswitch-switch 23 | if test -x $INIT; then 24 | $INIT start || true 25 | fi 26 | 27 | exit 0 28 | -------------------------------------------------------------------------------- /debian/openvswitch-datapath-source.README.Debian: -------------------------------------------------------------------------------- 1 | Open vSwitch for Debian 2 | ---------------------- 3 | 4 | * How do I build this module the Debian way? 5 | 6 | - Building with module-assistant: 7 | 8 | $ module-assistant auto-install openvswitch-datapath 9 | or 10 | $ m-a a-i openvswitch-datapath 11 | 12 | If kernel source or headers are in a non-standard directory, add 13 | the option -k /path/to/kernel/source with the correct path. 14 | 15 | - Building with make-kpkg 16 | 17 | $ cd /usr/src/ 18 | $ tar jxvf openvswitch.tar.bz2 19 | $ cd /usr/src/kernel-source-2.6.26 20 | $ make-kpkg --added-modules=openvswitch modules 21 | 22 | - Building without make-kpkg 23 | 24 | $ cd /usr/src/ 25 | $ tar jxvf openvswitch.tar.bz2 26 | $ cd modules/openvswitch 27 | $ fakeroot debian/rules kdist_image 28 | 29 | If you run this as root, fakeroot is not needed. 30 | 31 | -- Ben Pfaff , Wed, 22 Jun 2011 09:51:28 -0700 32 | -------------------------------------------------------------------------------- /debian/openvswitch-datapath-source.copyright: -------------------------------------------------------------------------------- 1 | Upstream Authors: 2 | 3 | Nicira, Inc. 4 | 5 | Copyright: 6 | 7 | Copyright (C) 2008 Nicira, Inc. 8 | 9 | License: 10 | 11 | Files in the datapath/ and its sub-directories are covered under the GNU 12 | General Public License Version 2. 13 | 14 | On Debian systems, the complete text of the GNU General 15 | Public License can be found in `/usr/share/common-licenses/GPL'. 16 | -------------------------------------------------------------------------------- /debian/openvswitch-datapath-source.dirs: -------------------------------------------------------------------------------- 1 | usr/src/modules/openvswitch-datapath/debian 2 | -------------------------------------------------------------------------------- /debian/openvswitch-datapath-source.install: -------------------------------------------------------------------------------- 1 | debian/changelog usr/src/modules/openvswitch-datapath/debian 2 | debian/control usr/src/modules/openvswitch-datapath/debian 3 | debian/compat usr/src/modules/openvswitch-datapath/debian 4 | debian/*.modules.in usr/src/modules/openvswitch-datapath/debian 5 | _debian/openvswitch.tar.gz usr/src/modules/openvswitch-datapath 6 | -------------------------------------------------------------------------------- /debian/openvswitch-ipsec.dirs: -------------------------------------------------------------------------------- 1 | usr/share/openvswitch/scripts 2 | -------------------------------------------------------------------------------- /debian/openvswitch-ipsec.install: -------------------------------------------------------------------------------- 1 | debian/ovs-monitor-ipsec usr/share/openvswitch/scripts 2 | -------------------------------------------------------------------------------- /debian/openvswitch-pki.dirs: -------------------------------------------------------------------------------- 1 | /var/lib/openvswitch 2 | -------------------------------------------------------------------------------- /debian/openvswitch-pki.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for openvswitch-pki 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see http://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | 22 | case "$1" in 23 | purge) 24 | rm -f /var/log/openvswitch/ovs-pki.log* || true 25 | 26 | # Remove backward compatibility symlink, if present. 27 | if test -h /usr/share/openvswitch/pki; then 28 | rm -f /usr/share/openvswitch/pki 29 | fi 30 | ;; 31 | 32 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 33 | ;; 34 | 35 | *) 36 | echo "postrm called with unknown argument \`$1'" >&2 37 | exit 1 38 | ;; 39 | esac 40 | 41 | # dh_installdeb will replace this with shell code automatically 42 | # generated by other debhelper scripts. 43 | 44 | #DEBHELPER# 45 | 46 | exit 0 47 | 48 | 49 | -------------------------------------------------------------------------------- /debian/openvswitch-switch.dirs: -------------------------------------------------------------------------------- 1 | /etc/openvswitch 2 | /usr/share/openvswitch/switch 3 | -------------------------------------------------------------------------------- /debian/openvswitch-switch.install: -------------------------------------------------------------------------------- 1 | usr/bin/ovs-dpctl 2 | usr/bin/ovs-dpctl-top 3 | usr/bin/ovs-pcap 4 | usr/bin/ovs-tcpundump 5 | usr/bin/ovs-vlan-test 6 | usr/bin/ovs-vsctl 7 | usr/bin/ovsdb-tool 8 | usr/sbin/ovs-vswitchd 9 | usr/sbin/ovsdb-server 10 | usr/share/openvswitch/scripts/ovs-check-dead-ifs 11 | usr/share/openvswitch/scripts/ovs-ctl 12 | usr/share/openvswitch/scripts/ovs-lib 13 | usr/share/openvswitch/scripts/ovs-save 14 | usr/share/openvswitch/vswitch.ovsschema 15 | debian/ifupdown.sh usr/share/openvswitch/scripts 16 | -------------------------------------------------------------------------------- /debian/openvswitch-switch.links: -------------------------------------------------------------------------------- 1 | usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-pre-up.d/openvswitch 2 | usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-post-down.d/openvswitch 3 | -------------------------------------------------------------------------------- /debian/openvswitch-switch.logrotate: -------------------------------------------------------------------------------- 1 | /var/log/openvswitch/*.log { 2 | daily 3 | compress 4 | create 640 root adm 5 | delaycompress 6 | missingok 7 | rotate 30 8 | postrotate 9 | # Tell Open vSwitch daemons to reopen their log files 10 | if [ -d /var/run/openvswitch ]; then 11 | for pidfile in `cd /var/run/openvswitch && echo *.pid`; do 12 | ovs-appctl -t "${pidfile%%.pid}" vlog/reopen 13 | done 14 | fi 15 | endscript 16 | } 17 | -------------------------------------------------------------------------------- /debian/openvswitch-switch.manpages: -------------------------------------------------------------------------------- 1 | _debian/ovsdb/ovsdb-server.1 2 | _debian/utilities/ovs-dpctl.8 3 | _debian/utilities/ovs-dpctl-top.8 4 | _debian/utilities/ovs-pcap.1 5 | _debian/utilities/ovs-tcpundump.1 6 | _debian/utilities/ovs-vlan-test.8 7 | _debian/utilities/ovs-vsctl.8 8 | _debian/vswitchd/ovs-vswitchd.8 9 | _debian/vswitchd/ovs-vswitchd.conf.db.5 10 | utilities/ovs-ctl.8 11 | -------------------------------------------------------------------------------- /debian/openvswitch-switch.template: -------------------------------------------------------------------------------- 1 | # This is a POSIX shell fragment -*- sh -*- 2 | 3 | # FORCE_COREFILES: If 'yes' then core files will be enabled. 4 | # FORCE_COREFILES=yes 5 | 6 | # OVS_CTL_OPTS: Extra options to pass to ovs-ctl. This is, for example, 7 | # a suitable place to specify --ovs-vswitchd-wrapper=valgrind. 8 | # OVS_CTL_OPTS= 9 | -------------------------------------------------------------------------------- /debian/openvswitch-test.dirs: -------------------------------------------------------------------------------- 1 | usr/share/pyshared/ovstest/ 2 | -------------------------------------------------------------------------------- /debian/openvswitch-test.install: -------------------------------------------------------------------------------- 1 | usr/share/openvswitch/python/ovstest usr/lib/python2.6/dist-packages/ 2 | usr/bin/ovs-test 3 | usr/bin/ovs-l3ping 4 | -------------------------------------------------------------------------------- /debian/openvswitch-test.manpages: -------------------------------------------------------------------------------- 1 | _debian/utilities/ovs-test.8 2 | _debian/utilities/ovs-l3ping.8 3 | -------------------------------------------------------------------------------- /debian/openvswitch-testcontroller.README.Debian: -------------------------------------------------------------------------------- 1 | README.Debian for openvswitch-testcontroller 2 | -------------------------------------------- 3 | 4 | The controller in this package enables OpenFlow switches that connect 5 | to it to act as MAC-learning Ethernet switches. It can be used for 6 | initial testing of OpenFlow networks. It is not a necessary or 7 | desirable part of a production OpenFlow deployment. 8 | 9 | To (re)configure the controller, edit /etc/default/openvswitch-testcontroller 10 | and run "/etc/init.d/openvswitch-testcontroller restart". 11 | 12 | -- Ben Pfaff , Thu, 14 Aug 2014 10:49:34 -0700 13 | -------------------------------------------------------------------------------- /debian/openvswitch-testcontroller.default: -------------------------------------------------------------------------------- 1 | # This is a POSIX shell fragment -*- sh -*- 2 | 3 | # LISTEN: What OpenFlow connection methods should the controller listen on? 4 | # 5 | # This is a space-delimited list of connection methods: 6 | # 7 | # * "pssl:[PORT]": Listen for SSL connections on the specified PORT 8 | # (default: 6633). The private key, certificate, and CA certificate 9 | # must be specified below. 10 | # 11 | # * "ptcp:[PORT]": Listen for TCP connections on the specified PORT 12 | # (default: 6633). Not recommended for security reasons. 13 | # 14 | LISTEN="pssl:" 15 | 16 | # PRIVKEY: Name of file containing controller's private key. 17 | # Required if SSL enabled. 18 | PRIVKEY=/etc/openvswitch-testcontroller/privkey.pem 19 | 20 | # CERT: Name of file containing certificate for private key. 21 | # Required if SSL enabled. 22 | CERT=/etc/openvswitch-testcontroller/cert.pem 23 | 24 | # CACERT: Name of file containing switch CA certificate. 25 | # Required if SSL enabled. 26 | CACERT=/etc/openvswitch-testcontroller/cacert.pem 27 | 28 | # Additional options to pass to ovs-testcontroller, e.g. "--hub" 29 | DAEMON_OPTS="" 30 | -------------------------------------------------------------------------------- /debian/openvswitch-testcontroller.dirs: -------------------------------------------------------------------------------- 1 | etc/openvswitch-testcontroller 2 | -------------------------------------------------------------------------------- /debian/openvswitch-testcontroller.install: -------------------------------------------------------------------------------- 1 | usr/bin/ovs-testcontroller 2 | -------------------------------------------------------------------------------- /debian/openvswitch-testcontroller.manpages: -------------------------------------------------------------------------------- 1 | _debian/utilities/ovs-testcontroller.8 2 | -------------------------------------------------------------------------------- /debian/openvswitch-testcontroller.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for openvswitch-testcontroller 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see http://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | 22 | case "$1" in 23 | purge) 24 | if cd /etc/openvswitch-testcontroller; then 25 | rm -f cacert.pem cert.pem privkey.pem req.pem 26 | rm -f tmp-privkey.pem tmp-cert.pem tmp-req.pem 27 | fi 28 | ;; 29 | 30 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 31 | ;; 32 | 33 | *) 34 | echo "postrm called with unknown argument \`$1'" >&2 35 | exit 1 36 | ;; 37 | esac 38 | 39 | # dh_installdeb will replace this with shell code automatically 40 | # generated by other debhelper scripts. 41 | 42 | #DEBHELPER# 43 | 44 | exit 0 45 | -------------------------------------------------------------------------------- /debian/openvswitch-vtep.default: -------------------------------------------------------------------------------- 1 | # This is a POSIX shell fragment -*- sh -*- 2 | 3 | # ENABLE_OVS_VTEP: Whether to start ovs-vtep. 4 | ENABLE_OVS_VTEP="false" 5 | -------------------------------------------------------------------------------- /debian/openvswitch-vtep.dirs: -------------------------------------------------------------------------------- 1 | /usr/share/openvswitch 2 | -------------------------------------------------------------------------------- /debian/openvswitch-vtep.install: -------------------------------------------------------------------------------- 1 | _debian/vtep/vtep-ctl usr/bin 2 | usr/share/openvswitch/vtep.ovsschema 3 | usr/share/openvswitch/scripts/ovs-vtep 4 | -------------------------------------------------------------------------------- /debian/openvswitch-vtep.manpages: -------------------------------------------------------------------------------- 1 | _debian/vtep/vtep-ctl.8 2 | -------------------------------------------------------------------------------- /debian/python-openvswitch.dirs: -------------------------------------------------------------------------------- 1 | usr/share/pyshared/ovs/ 2 | usr/share/pyshared/ovs/db/ 3 | -------------------------------------------------------------------------------- /debian/python-openvswitch.install: -------------------------------------------------------------------------------- 1 | usr/share/openvswitch/python/ovs usr/lib/python2.6/dist-packages/ 2 | -------------------------------------------------------------------------------- /debian/rules.modules: -------------------------------------------------------------------------------- 1 | #! /usr/bin/make -f 2 | 3 | PACKAGE=openvswitch-datapath-module 4 | MA_DIR ?= /usr/share/modass 5 | -include $(MA_DIR)/include/generic.make 6 | -include $(MA_DIR)/include/common-rules.make 7 | 8 | DATAPATH_CONFIGURE_OPTS = 9 | 10 | kdist_clean: 11 | dh_testdir 12 | dh_testroot 13 | dh_clean 14 | rm -rf openvswitch 15 | 16 | .PHONY: kdist_config 17 | kdist_config: prep-deb-files 18 | 19 | .PHONY: binary-modules 20 | binary-modules: DSTDIR = $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel 21 | binary-modules: prep-deb-files 22 | dh_testdir 23 | dh_testroot 24 | dh_clean -k 25 | tar xzf openvswitch.tar.gz 26 | cd openvswitch && ./configure --with-linux=$(KSRC) $(DATAPATH_CONFIGURE_OPTS) 27 | cd openvswitch && $(MAKE) -C datapath/linux 28 | install -d -m755 $(DSTDIR) 29 | install -m644 openvswitch/datapath/linux/*.ko $(DSTDIR)/ 30 | dh_installmodules 31 | dh_installdocs 32 | dh_installchangelogs 33 | dh_compress 34 | dh_fixperms 35 | dh_installdeb 36 | dh_gencontrol 37 | dh_md5sums 38 | dh_builddeb --destdir=$(DEB_DESTDIR) 39 | 40 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /include/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | -------------------------------------------------------------------------------- /include/automake.mk: -------------------------------------------------------------------------------- 1 | BUILT_SOURCES += include/odp-netlink.h 2 | 3 | include/odp-netlink.h: datapath/linux/compat/include/linux/openvswitch.h \ 4 | build-aux/extract-odp-netlink-h 5 | $(AM_V_GEN)sed -f $(srcdir)/build-aux/extract-odp-netlink-h < $< > $@ 6 | EXTRA_DIST += build-aux/extract-odp-netlink-h 7 | CLEANFILES += include/odp-netlink.h 8 | 9 | include include/openflow/automake.mk 10 | include include/openvswitch/automake.mk 11 | include include/sparse/automake.mk 12 | include include/windows/automake.mk 13 | -------------------------------------------------------------------------------- /include/openflow/.gitignore: -------------------------------------------------------------------------------- 1 | *.hstamp 2 | -------------------------------------------------------------------------------- /include/openflow/openflow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OPENFLOW_OPENFLOW_H 18 | #define OPENFLOW_OPENFLOW_H 1 19 | 20 | #include "openflow/openflow-1.0.h" 21 | #include "openflow/openflow-1.1.h" 22 | #include "openflow/openflow-1.2.h" 23 | #include "openflow/openflow-1.3.h" 24 | #include "openflow/openflow-1.4.h" 25 | 26 | #endif /* openflow/openflow.h */ 27 | -------------------------------------------------------------------------------- /include/openvswitch/automake.mk: -------------------------------------------------------------------------------- 1 | noinst_HEADERS += \ 2 | include/openvswitch/types.h 3 | 4 | -------------------------------------------------------------------------------- /include/sparse/arpa/inet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CHECKER__ 18 | #error "Use this header only with sparse. It is not a correct implementation." 19 | #endif 20 | 21 | #include 22 | -------------------------------------------------------------------------------- /include/sparse/assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CHECKER__ 18 | #error "Use this header only with sparse. It is not a correct implementation." 19 | #endif 20 | 21 | extern void __ovs_assert(_Bool); 22 | #define assert(EXPRESSION) __ovs_assert(EXPRESSION) 23 | -------------------------------------------------------------------------------- /include/sparse/automake.mk: -------------------------------------------------------------------------------- 1 | noinst_HEADERS += \ 2 | include/sparse/arpa/inet.h \ 3 | include/sparse/assert.h \ 4 | include/sparse/math.h \ 5 | include/sparse/netinet/in.h \ 6 | include/sparse/netinet/ip6.h \ 7 | include/sparse/netpacket/packet.h \ 8 | include/sparse/pthread.h \ 9 | include/sparse/sys/socket.h \ 10 | include/sparse/sys/wait.h 11 | -------------------------------------------------------------------------------- /include/sparse/netpacket/packet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CHECKER__ 18 | #error "Use this header only with sparse. It is not a correct implementation." 19 | #endif 20 | 21 | #ifndef __NETPACKET_PACKET_SPARSE 22 | #define __NETPACKET_PACKET_SPARSE 1 23 | 24 | #include "openvswitch/types.h" 25 | 26 | struct sockaddr_ll 27 | { 28 | unsigned short int sll_family; 29 | ovs_be16 sll_protocol; 30 | int sll_ifindex; 31 | unsigned short int sll_hatype; 32 | unsigned char sll_pkttype; 33 | unsigned char sll_halen; 34 | unsigned char sll_addr[8]; 35 | }; 36 | 37 | #endif /* sparse */ 38 | -------------------------------------------------------------------------------- /include/sparse/pthread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CHECKER__ 18 | #error "Use this header only with sparse. It is not a correct implementation." 19 | #endif 20 | 21 | /* Get actual definitions for us to annotate and build on. */ 22 | #include_next 23 | 24 | /* Sparse complains about the proper PTHREAD_*_INITIALIZER definitions. 25 | * Luckily, it's not a real compiler so we can overwrite it with something 26 | * simple. */ 27 | #undef PTHREAD_MUTEX_INITIALIZER 28 | #define PTHREAD_MUTEX_INITIALIZER {} 29 | 30 | #undef PTHREAD_RWLOCK_INITIALIZER 31 | #define PTHREAD_RWLOCK_INITIALIZER {} 32 | 33 | #undef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP 34 | #define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP {} 35 | -------------------------------------------------------------------------------- /include/sparse/sys/wait.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CHECKER__ 18 | #error "Use this header only with sparse. It is not a correct implementation." 19 | #endif 20 | 21 | #ifndef __SYS_WAIT_SPARSE 22 | #define __SYS_WAIT_SPARSE 1 23 | 24 | #include_next 25 | 26 | #undef wait 27 | #define wait(a) rpl_wait(a) 28 | pid_t rpl_wait(int *); 29 | 30 | #undef waitpid 31 | #define waitpid(a, b, c) rpl_waitpid(a, b, c) 32 | pid_t rpl_waitpid(pid_t, int *, int); 33 | 34 | #endif /* for sparse */ 35 | -------------------------------------------------------------------------------- /include/windows/arpa/inet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/arpa/inet.h -------------------------------------------------------------------------------- /include/windows/automake.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Nicira, Inc. 2 | # 3 | # Copying and distribution of this file, with or without modification 4 | # are permitted in any medium without royalty provided the copyright 5 | # notice and this notice are preserved. This file is offered as-is, 6 | # without warranty of any kind. 7 | 8 | noinst_HEADERS += \ 9 | include/windows/arpa/inet.h \ 10 | include/windows/dirent.h \ 11 | include/windows/getopt.h \ 12 | include/windows/linux/pkt_sched.h \ 13 | include/windows/linux/types.h \ 14 | include/windows/net/if.h \ 15 | include/windows/netdb.h \ 16 | include/windows/netpacket/packet.h \ 17 | include/windows/netinet/icmp6.h \ 18 | include/windows/netinet/in.h \ 19 | include/windows/netinet/in_systm.h \ 20 | include/windows/netinet/ip.h \ 21 | include/windows/netinet/ip6.h \ 22 | include/windows/netinet/tcp.h \ 23 | include/windows/poll.h \ 24 | include/windows/strings.h \ 25 | include/windows/syslog.h \ 26 | include/windows/sys/epoll.h \ 27 | include/windows/sys/ioctl.h \ 28 | include/windows/sys/resource.h \ 29 | include/windows/sys/socket.h \ 30 | include/windows/sys/time.h \ 31 | include/windows/sys/uio.h \ 32 | include/windows/sys/un.h \ 33 | include/windows/sys/wait.h \ 34 | include/windows/unistd.h \ 35 | include/windows/windefs.h 36 | -------------------------------------------------------------------------------- /include/windows/dirent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/dirent.h -------------------------------------------------------------------------------- /include/windows/linux/pkt_sched.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Cloudbase Solutions Srl 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __LINUX_PKT_SCHED_H 18 | #define __LINUX_PKT_SCHED_H 1 19 | 20 | #define TC_H_MAJ_MASK (0xFFFF0000U) 21 | 22 | #define TC_H_MIN_MASK (0x0000FFFFU) 23 | 24 | #define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK)) 25 | 26 | #endif /* linux/pkt_sched.h */ 27 | -------------------------------------------------------------------------------- /include/windows/linux/types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/linux/types.h -------------------------------------------------------------------------------- /include/windows/netdb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/netdb.h -------------------------------------------------------------------------------- /include/windows/netinet/in.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __NETINET_IN_H 18 | #define __NETINET_IN_H 1 19 | 20 | #define IPPROTO_GRE 47 21 | 22 | #endif /* netinet/in.h */ 23 | -------------------------------------------------------------------------------- /include/windows/netinet/in_systm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/netinet/in_systm.h -------------------------------------------------------------------------------- /include/windows/netinet/ip.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __NETINET_IP_H 18 | #define __NETINET_IP_H 1 19 | 20 | #define IPTOS_PREC_INTERNETCONTROL 0xc0 21 | #define MAXTTL 255 22 | #define IPTOS_LOWDELAY 0x10 23 | #define IPTOS_THROUGHPUT 0x08 24 | 25 | #endif /* netinet/ip.h */ 26 | -------------------------------------------------------------------------------- /include/windows/netinet/tcp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/netinet/tcp.h -------------------------------------------------------------------------------- /include/windows/netpacket/packet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Cloudbase Solutions Srl 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __NETPACKET_PACKET_H 18 | #define __NETPACKET_PACKET_H 1 19 | 20 | struct iovec 21 | { 22 | void *iov_base; 23 | unsigned int iov_len; 24 | }; 25 | 26 | struct msghdr 27 | { 28 | void *msg_name; 29 | socklen_t msg_namelen; 30 | 31 | struct iovec *msg_iov; 32 | size_t msg_iovlen; 33 | 34 | void *msg_control; 35 | size_t msg_controllen; 36 | 37 | int msg_flags; 38 | }; 39 | 40 | #endif /* netpacket/packet.h */ 41 | -------------------------------------------------------------------------------- /include/windows/poll.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/poll.h -------------------------------------------------------------------------------- /include/windows/strings.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/strings.h -------------------------------------------------------------------------------- /include/windows/sys/epoll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Cloudbase Solutions Srl 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __SYS_EPOLL_H 18 | #define __SYS_EPOLL_H 1 19 | 20 | #define EPOLLIN 0x00001 21 | 22 | typedef union data { 23 | uint32_t u32; 24 | } data_t; 25 | 26 | struct epoll_event { 27 | uint32_t events; 28 | data_t data; 29 | }; 30 | 31 | #endif /* sys/epoll.h */ 32 | -------------------------------------------------------------------------------- /include/windows/sys/ioctl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/sys/ioctl.h -------------------------------------------------------------------------------- /include/windows/sys/socket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __SYS_SOCKET_H 18 | #define __SYS_SOCKET_H 1 19 | 20 | typedef unsigned short int sa_family_t; 21 | 22 | #endif /* sys/socket.h */ 23 | -------------------------------------------------------------------------------- /include/windows/sys/time.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/sys/time.h -------------------------------------------------------------------------------- /include/windows/sys/uio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Cloudbase Solutions Srl 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __SYS_UIO_H 18 | #define __SYS_UIO_H 1 19 | 20 | #include 21 | 22 | #endif /* sys/uio.h */ 23 | -------------------------------------------------------------------------------- /include/windows/sys/un.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/sys/un.h -------------------------------------------------------------------------------- /include/windows/sys/wait.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinpettit/ovs/6222a93f60a15f7f1dc960facfc73fcefb0749ad/include/windows/sys/wait.h -------------------------------------------------------------------------------- /include/windows/windefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef WINDEFS_H 18 | #define WINDEFS_H 1 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #pragma comment(lib, "advapi32") 29 | 30 | #define inline __inline 31 | #define __func__ __FUNCTION__ 32 | #define ssize_t SSIZE_T 33 | #define u_int8_t uint8_t 34 | #define u_int16_t uint16_t 35 | #define u_int32_t uint32_t 36 | #define u_int64_t uint64_t 37 | 38 | typedef int pid_t; 39 | 40 | char *strsep(char **stringp, const char *delim); 41 | 42 | #define srandom srand 43 | #define random rand 44 | 45 | #endif /* windefs.h */ 46 | -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /dhparams.c 4 | /dirs.c 5 | /coverage-counters.c 6 | /meta-flow.inc 7 | /nx-match.inc 8 | /ofp-actions.inc1 9 | /ofp-actions.inc2 10 | /ofp-errors.inc 11 | /ofp-msgs.inc 12 | /stdio.h 13 | /string.h 14 | /vswitch-idl.c 15 | /vswitch-idl.h 16 | /vswitch-idl.ovsidl 17 | /vtep-idl.c 18 | /vtep-idl.h 19 | /vtep-idl.ovsidl 20 | -------------------------------------------------------------------------------- /lib/aes128.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Based on rijndael.txt by Philip J. Erdelsky, downloaded from 19 | * http://www.efgh.com/software/rijndael.htm on September 24, 2009. The 20 | * license information there is: "Public domain; no restrictions on use." 21 | * The Apache license above applies only to Nicira's modifications to the 22 | * original code. 23 | */ 24 | 25 | #ifndef AES128_H 26 | #define AES128_H 27 | 28 | #include 29 | 30 | struct aes128 { 31 | uint32_t rk[128/8 + 28]; 32 | }; 33 | 34 | void aes128_schedule(struct aes128 *, const uint8_t key[16]); 35 | void aes128_encrypt(const struct aes128 *, const void *, void *); 36 | 37 | #endif /* aes128.h */ 38 | -------------------------------------------------------------------------------- /lib/command-line.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2009, 2010 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef COMMAND_LINE_H 18 | #define COMMAND_LINE_H 1 19 | 20 | /* Utilities for command-line parsing. */ 21 | 22 | #include "compiler.h" 23 | 24 | struct option; 25 | 26 | struct command { 27 | const char *name; 28 | int min_args; 29 | int max_args; 30 | void (*handler)(int argc, char *argv[]); 31 | }; 32 | 33 | char *long_options_to_short_options(const struct option *options); 34 | void run_command(int argc, char *argv[], const struct command[]); 35 | 36 | void proctitle_init(int argc, char **argv); 37 | #if defined(__FreeBSD__) || defined(__NetBSD__) 38 | #define proctitle_set setproctitle 39 | #else 40 | void proctitle_set(const char *, ...) 41 | PRINTF_FORMAT(1, 2); 42 | #endif 43 | void proctitle_restore(void); 44 | 45 | #endif /* command-line.h */ 46 | -------------------------------------------------------------------------------- /lib/common-syn.man: -------------------------------------------------------------------------------- 1 | .IP "Common options:" 2 | [\fB\-h\fR | \fB\-\-help\fR] 3 | [\fB\-V\fR | \fB\-\-version\fR] 4 | 5 | -------------------------------------------------------------------------------- /lib/common.man: -------------------------------------------------------------------------------- 1 | .de IQ 2 | . br 3 | . ns 4 | . IP "\\$1" 5 | .. 6 | .IP "\fB\-h\fR" 7 | .IQ "\fB\-\-help\fR" 8 | Prints a brief help message to the console. 9 | . 10 | .IP "\fB\-V\fR" 11 | .IQ "\fB\-\-version\fR" 12 | Prints version information to the console. 13 | -------------------------------------------------------------------------------- /lib/connectivity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CONNECTIVITY_H 18 | #define CONNECTIVITY_H 1 19 | 20 | #include 21 | 22 | /* For tracking connectivity changes globally. */ 23 | struct seq *connectivity_seq_get(void); 24 | 25 | #endif /* connectivity.h */ 26 | -------------------------------------------------------------------------------- /lib/coverage-unixctl.man: -------------------------------------------------------------------------------- 1 | .SS "COVERAGE COMMANDS" 2 | These commands manage \fB\*(PN\fR's ``coverage counters,'' which count 3 | the number of times particular events occur during a daemon's runtime. 4 | In addition to these commands, \fB\*(PN\fR automatically logs coverage 5 | counter values, at \fBINFO\fR level, when it detects that the daemon's 6 | main loop takes unusually long to run. 7 | .PP 8 | Coverage counters are useful mainly for performance analysis and 9 | debugging. 10 | .IP "\fBcoverage/show\fR" 11 | Displays the averaged per-second rates for the last few seconds, the 12 | last minute and the last hour, and the total counts of all of the 13 | coverage counters. 14 | -------------------------------------------------------------------------------- /lib/crc32c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The University of Waikato. 3 | * Author: Joe Stringer 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef CRC32C_H 19 | #define CRC32C_H 1 20 | 21 | #include "openvswitch/types.h" 22 | 23 | ovs_be32 crc32c(const uint8_t *data, size_t); 24 | 25 | #endif /* crc32c.h */ 26 | -------------------------------------------------------------------------------- /lib/csum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2011 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CSUM_H 18 | #define CSUM_H 1 19 | 20 | #include 21 | #include 22 | #include "openvswitch/types.h" 23 | 24 | ovs_be16 csum(const void *, size_t); 25 | uint32_t csum_add16(uint32_t partial, ovs_be16); 26 | uint32_t csum_add32(uint32_t partial, ovs_be32); 27 | uint32_t csum_continue(uint32_t partial, const void *, size_t); 28 | ovs_be16 csum_finish(uint32_t partial); 29 | ovs_be16 recalc_csum16(ovs_be16 old_csum, ovs_be16 old_u16, ovs_be16 new_u16); 30 | ovs_be16 recalc_csum32(ovs_be16 old_csum, ovs_be32 old_u32, ovs_be32 new_u32); 31 | ovs_be16 recalc_csum128(ovs_be16 old_csum, ovs_16aligned_be32 old_u32[4], 32 | const ovs_be32 new_u32[4]); 33 | 34 | #endif /* csum.h */ 35 | -------------------------------------------------------------------------------- /lib/daemon-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef DAEMON_PRIVATE_H 18 | #define DAEMON_PRIVATE_H 1 19 | 20 | extern bool detach; 21 | extern char *pidfile; 22 | 23 | char *make_pidfile_name(const char *name); 24 | 25 | #endif /* daemon-private.h */ 26 | -------------------------------------------------------------------------------- /lib/daemon-syn.man: -------------------------------------------------------------------------------- 1 | .IP "Daemon options:" 2 | [\fB\-\-pidfile\fR[\fB=\fIpidfile\fR]] 3 | [\fB\-\-overwrite\-pidfile\fR] 4 | [\fB\-\-detach\fR] 5 | [\fB\-\-no\-chdir\fR] 6 | -------------------------------------------------------------------------------- /lib/dh1024.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIGHAoGBAPSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsY 3 | jY67VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6 4 | ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpL3jHAgEC 5 | -----END DH PARAMETERS----- 6 | 7 | These are the 1024 bit DH parameters from "Assigned Number for SKIP Protocols" 8 | (http://www.skip-vpn.org/spec/numbers.html). 9 | See there for how they were generated. 10 | Note that g is not a generator, but this is not a problem since p is a safe prime. 11 | -------------------------------------------------------------------------------- /lib/dh2048.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlLOCDaAadWoxTpj0BV 3 | 89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N286Z4VeSWc39uK50 4 | T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/RgBYK+X0iP1YTknb 5 | zSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdX 6 | Q6MdGGzeMyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqVDNmWn6vQClCbAkbT 7 | CD1mpF1Bn5x8vYlLIhkmuquiXsNV6TILOwIBAg== 8 | -----END DH PARAMETERS----- 9 | 10 | These are the 2048 bit DH parameters from "Assigned Number for SKIP Protocols" 11 | (http://www.skip-vpn.org/spec/numbers.html). 12 | See there for how they were generated. 13 | -------------------------------------------------------------------------------- /lib/dh4096.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIICCAKCAgEA+hRyUsFN4VpJ1O8JLcCo/VWr19k3BCgJ4uk+d+KhehjdRqNDNyOQ 3 | l/MOyQNQfWXPeGKmOmIig6Ev/nm6Nf9Z2B1h3R4hExf+zTiHnvVPeRBhjdQi81rt 4 | Xeoh6TNrSBIKIHfUJWBh3va0TxxjQIs6IZOLeVNRLMqzeylWqMf49HsIXqbcokUS 5 | Vt1BkvLdW48j8PPv5DsKRN3tloTxqDJGo9tKvj1Fuk74A+Xda1kNhB7KFlqMyN98 6 | VETEJ6c7KpfOo30mnK30wqw3S8OtaIR/maYX72tGOno2ehFDkq3pnPtEbD2CScxc 7 | alJC+EL7RPk5c/tgeTvCngvc1KZn92Y//EI7G9tPZtylj2b56sHtMftIoYJ9+ODM 8 | sccD5Piz/rejE3Ome8EOOceUSCYAhXn8b3qvxVI1ddd1pED6FHRhFvLrZxFvBEM9 9 | ERRMp5QqOaHJkM+Dxv8Cj6MqrCbfC4u+ZErxodzuusgDgvZiLF22uxMZbobFWyte 10 | OvOzKGtwcTqO/1wV5gKkzu1ZVswVUQd5Gg8lJicwqRWyyNRczDDoG9jVDxmogKTH 11 | AaqLulO7R8Ifa1SwF2DteSGVtgWEN8gDpN3RBmmPTDngyF2DHb5qmpnznwtFKdTL 12 | KWbuHn491xNO25CQWMtem80uKw+pTnisBRF/454n1Jnhub144YRBoN8CAQI= 13 | -----END DH PARAMETERS----- 14 | 15 | These are the 4096 bit DH parameters from "Assigned Number for SKIP Protocols" 16 | (http://www.skip-vpn.org/spec/numbers.html). 17 | See there for how they were generated. 18 | Note that g is not a generator, but this is not a problem since p is a safe prime. 19 | -------------------------------------------------------------------------------- /lib/dhparams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef DHPARAMS_H 18 | #define DHPARAMS_H 1 19 | 20 | #include 21 | 22 | DH *get_dh1024(void); 23 | DH *get_dh2048(void); 24 | DH *get_dh4096(void); 25 | 26 | #endif /* dhparams.h */ 27 | -------------------------------------------------------------------------------- /lib/dirs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef DIRS_H 18 | #define DIRS_H 1 19 | 20 | const char *ovs_sysconfdir(void); /* /usr/local/etc */ 21 | const char *ovs_pkgdatadir(void); /* /usr/local/share/openvswitch */ 22 | const char *ovs_rundir(void); /* /usr/local/var/run/openvswitch */ 23 | const char *ovs_logdir(void); /* /usr/local/var/log/openvswitch */ 24 | const char *ovs_dbdir(void); /* /usr/local/etc/openvswitch */ 25 | const char *ovs_bindir(void); /* /usr/local/bin */ 26 | 27 | #endif /* dirs.h */ 28 | -------------------------------------------------------------------------------- /lib/dummy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef DUMMY_H 18 | #define DUMMY_H 1 19 | 20 | #include 21 | 22 | /* For client programs to call directly to enable dummy support. */ 23 | void dummy_enable(bool override); 24 | 25 | /* Implementation details. */ 26 | void dpif_dummy_register(bool override); 27 | void netdev_dummy_register(bool override); 28 | void timeval_dummy_register(void); 29 | void vlandev_dummy_enable(void); 30 | 31 | #endif /* dummy.h */ 32 | -------------------------------------------------------------------------------- /lib/entropy.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef ENTROPY_H 17 | #define ENTROPY_H 1 18 | 19 | #include 20 | 21 | int get_entropy(void *, size_t); 22 | void get_entropy_or_die(void *, size_t); 23 | 24 | #endif /* entropy.h */ 25 | -------------------------------------------------------------------------------- /lib/jhash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2009, 2010, 2012 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef JHASH_H 18 | #define JHASH_H 1 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include "util.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* This is the public domain lookup3 hash by Bob Jenkins from 31 | * http://burtleburtle.net/bob/c/lookup3.c, modified for style. 32 | * 33 | * Use the functions in hash.h instead if you can. These are here just for 34 | * places where we've exposed a hash function "on the wire" and don't want it 35 | * to change. */ 36 | 37 | uint32_t jhash_words(const uint32_t *, size_t n_word, uint32_t basis); 38 | uint32_t jhash_bytes(const void *, size_t n_bytes, uint32_t basis); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* jhash.h */ 45 | -------------------------------------------------------------------------------- /lib/lockfile.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2008, 2009 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef LOCKFILE_H 17 | #define LOCKFILE_H 1 18 | 19 | struct lockfile; 20 | 21 | char *lockfile_name(const char *file); 22 | int lockfile_lock(const char *file, struct lockfile **); 23 | void lockfile_unlock(struct lockfile *); 24 | void lockfile_postfork(void); 25 | 26 | #endif /* lib/lockfile.h */ 27 | -------------------------------------------------------------------------------- /lib/memory-unixctl.man: -------------------------------------------------------------------------------- 1 | .SS "MEMORY COMMANDS" 2 | These commands report memory usage. 3 | . 4 | .IP "\fBmemory/show\fR" 5 | Displays some basic statistics about \fB\*(PN\fR's memory usage. 6 | \fB\*(PN\fR also logs this information soon after startup and 7 | periodically as its memory consumption grows. 8 | -------------------------------------------------------------------------------- /lib/netdev-dpdk.h: -------------------------------------------------------------------------------- 1 | #ifndef NETDEV_DPDK_H 2 | #define NETDEV_DPDK_H 3 | 4 | #include 5 | 6 | struct dpif_packet; 7 | 8 | #ifdef DPDK_NETDEV 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | int dpdk_init(int argc, char **argv); 24 | void netdev_dpdk_register(void); 25 | void free_dpdk_buf(struct dpif_packet *); 26 | int pmd_thread_setaffinity_cpu(int cpu); 27 | void thread_set_nonpmd(void); 28 | 29 | #else 30 | 31 | #include "util.h" 32 | 33 | static inline int 34 | dpdk_init(int argc, char **argv) 35 | { 36 | if (argc >= 2 && !strcmp(argv[1], "--dpdk")) { 37 | ovs_fatal(0, "DPDK support not built into this copy of Open vSwitch."); 38 | } 39 | return 0; 40 | } 41 | 42 | static inline void 43 | netdev_dpdk_register(void) 44 | { 45 | /* Nothing */ 46 | } 47 | 48 | static inline void 49 | free_dpdk_buf(struct dpif_packet *buf OVS_UNUSED) 50 | { 51 | /* Nothing */ 52 | } 53 | 54 | static inline int 55 | pmd_thread_setaffinity_cpu(int cpu OVS_UNUSED) 56 | { 57 | return 0; 58 | } 59 | 60 | static inline void 61 | thread_set_nonpmd(void) 62 | { 63 | /* Nothing */ 64 | } 65 | 66 | #endif /* DPDK_NETDEV */ 67 | #endif 68 | -------------------------------------------------------------------------------- /lib/netdev-linux.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011, 2013 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef NETDEV_LINUX_H 18 | #define NETDEV_LINUX_H 1 19 | 20 | #include 21 | #include 22 | 23 | /* These functions are Linux specific, so they should be used directly only by 24 | * Linux-specific code. */ 25 | 26 | struct netdev; 27 | 28 | int netdev_linux_ethtool_set_flag(struct netdev *netdev, uint32_t flag, 29 | const char *flag_name, bool enable); 30 | 31 | #endif /* netdev-linux.h */ 32 | -------------------------------------------------------------------------------- /lib/ofp-version-opt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "dynamic-string.h" 3 | #include "ofp-util.h" 4 | #include "ofp-version-opt.h" 5 | #include "ovs-thread.h" 6 | 7 | static uint32_t allowed_versions = 0; 8 | 9 | uint32_t 10 | get_allowed_ofp_versions(void) 11 | { 12 | return allowed_versions ? allowed_versions : OFPUTIL_DEFAULT_VERSIONS; 13 | } 14 | 15 | void 16 | set_allowed_ofp_versions(const char *string) 17 | { 18 | assert_single_threaded(); 19 | allowed_versions = ofputil_versions_from_string(string); 20 | } 21 | 22 | void 23 | mask_allowed_ofp_versions(uint32_t bitmap) 24 | { 25 | assert_single_threaded(); 26 | allowed_versions &= bitmap; 27 | } 28 | 29 | void 30 | ofp_version_usage(void) 31 | { 32 | struct ds msg = DS_EMPTY_INITIALIZER; 33 | 34 | ofputil_format_version_bitmap_names(&msg, OFPUTIL_DEFAULT_VERSIONS); 35 | printf( 36 | "\nOpenFlow version options:\n" 37 | " -V, --version display version information\n" 38 | " -O, --protocols set allowed OpenFlow versions\n" 39 | " (default: %s)\n", 40 | ds_cstr(&msg)); 41 | ds_destroy(&msg); 42 | } 43 | -------------------------------------------------------------------------------- /lib/ofp-version-opt.h: -------------------------------------------------------------------------------- 1 | #ifndef OFP_VERSION_H 2 | #define OFP_VERSION_H 1 3 | 4 | #include 5 | #include "util.h" 6 | #include "ofp-util.h" 7 | 8 | #define OFP_VERSION_LONG_OPTIONS \ 9 | {"version", no_argument, NULL, 'V'}, \ 10 | {"protocols", required_argument, NULL, 'O'} 11 | 12 | #define OFP_VERSION_OPTION_HANDLERS \ 13 | case 'V': \ 14 | ovs_print_version(OFP10_VERSION, OFP13_VERSION); \ 15 | exit(EXIT_SUCCESS); \ 16 | \ 17 | case 'O': \ 18 | set_allowed_ofp_versions(optarg); \ 19 | break; 20 | 21 | uint32_t get_allowed_ofp_versions(void); 22 | void set_allowed_ofp_versions(const char *string); 23 | void mask_allowed_ofp_versions(uint32_t); 24 | void ofp_version_usage(void); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/ofp-version.man: -------------------------------------------------------------------------------- 1 | .de IQ 2 | . br 3 | . ns 4 | . IP "\\$1" 5 | .. 6 | .IP "\fB\-O \fR[\fIversion\fR[\fB,\fIversion\fR]...]\fR" 7 | .IQ "\fB\-\-protocols=\fR[\fIversion\fR[\fB,\fIversion\fR]...]\fR" 8 | Sets the OpenFlow protocol versions that are allowed when establishing 9 | an OpenFlow session. 10 | . 11 | .IP 12 | The following versions are considered to be ready for general use. 13 | These protocol versions are enabled by default: 14 | . 15 | .RS 16 | .IP \(bu 17 | \fBOpenFlow10\fR, for OpenFlow 1.0. 18 | .RE 19 | . 20 | .IP 21 | Support for the following protocol versions is provided for testing 22 | and development purposes. They are not enabled by default: 23 | . 24 | .RS 25 | .IP \(bu 26 | \fBOpenFlow11\fR, for OpenFlow 1.1. 27 | . 28 | .IP \(bu 29 | \fBOpenFlow12\fR, for OpenFlow 1.2. 30 | . 31 | .IP \(bu 32 | \fBOpenFlow13\fR, for OpenFlow 1.3. 33 | .RE 34 | -------------------------------------------------------------------------------- /lib/pcap-file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef PCAP_FILE_H 18 | #define PCAP_FILE_H 1 19 | 20 | #include 21 | 22 | struct flow; 23 | struct ofpbuf; 24 | 25 | /* PCAP file reading and writing. */ 26 | FILE *ovs_pcap_open(const char *file_name, const char *mode); 27 | int ovs_pcap_read_header(FILE *); 28 | void ovs_pcap_write_header(FILE *); 29 | int ovs_pcap_read(FILE *, struct ofpbuf **, long long int *when); 30 | void ovs_pcap_write(FILE *, struct ofpbuf *); 31 | 32 | /* Extracting TCP stream data from an Ethernet packet capture. */ 33 | 34 | struct tcp_reader *tcp_reader_open(void); 35 | void tcp_reader_close(struct tcp_reader *); 36 | struct ofpbuf *tcp_reader_run(struct tcp_reader *, const struct flow *, 37 | const struct ofpbuf *); 38 | 39 | #endif /* pcap-file.h */ 40 | -------------------------------------------------------------------------------- /lib/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2009, 2010, 2012 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RANDOM_H 18 | #define RANDOM_H 1 19 | 20 | #include 21 | #include 22 | 23 | void random_init(void); 24 | void random_set_seed(uint32_t); 25 | 26 | void random_bytes(void *, size_t); 27 | uint32_t random_uint32(void); 28 | uint64_t random_uint64(void); 29 | 30 | static inline int 31 | random_range(int max) 32 | { 33 | return random_uint32() % max; 34 | } 35 | 36 | static inline uint8_t 37 | random_uint8(void) 38 | { 39 | return random_uint32(); 40 | } 41 | 42 | static inline uint16_t 43 | random_uint16(void) 44 | { 45 | return random_uint32(); 46 | } 47 | 48 | #endif /* random.h */ 49 | -------------------------------------------------------------------------------- /lib/route-table-stub.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2013, 2014 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. */ 14 | 15 | #include 16 | #include "route-table.h" 17 | 18 | #include "compiler.h" 19 | 20 | bool 21 | route_table_get_name(ovs_be32 ip OVS_UNUSED, char name[IFNAMSIZ] OVS_UNUSED) 22 | { 23 | name[0] = '\0'; 24 | return false; 25 | } 26 | 27 | uint64_t 28 | route_table_get_change_seq(void) 29 | { 30 | return 0; 31 | } 32 | 33 | void 34 | route_table_register(void) 35 | { 36 | } 37 | 38 | void 39 | route_table_unregister(void) 40 | { 41 | } 42 | 43 | void 44 | route_table_run(void) 45 | { 46 | } 47 | 48 | void 49 | route_table_wait(void) 50 | { 51 | } 52 | -------------------------------------------------------------------------------- /lib/route-table.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ROUTE_TABLE_H 18 | #define ROUTE_TABLE_H 1 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include "openvswitch/types.h" 27 | 28 | bool route_table_get_name(ovs_be32 ip, char name[IFNAMSIZ]); 29 | uint64_t route_table_get_change_seq(void); 30 | void route_table_register(void); 31 | void route_table_unregister(void); 32 | void route_table_run(void); 33 | void route_table_wait(void); 34 | 35 | #endif /* route-table.h */ 36 | -------------------------------------------------------------------------------- /lib/service-syn.man: -------------------------------------------------------------------------------- 1 | .IP "Service options:" 2 | [\fB\-\-service\fR] 3 | [\fB\-\-service\-monitor\fR] 4 | -------------------------------------------------------------------------------- /lib/service.man: -------------------------------------------------------------------------------- 1 | The following options are valid only on Windows platform. 2 | .TP 3 | \fB\-\-service\fR 4 | Causes \fB\*(PN\fR to run as a service in the background. The service 5 | should already have been created through external tools like \fBSC.exe\fR. 6 | . 7 | .TP 8 | \fB\-\-service\-monitor\fR 9 | Causes the \fB\*(PN\fR service to be automatically restarted by the Windows 10 | services manager if the service dies or exits for unexpected reasons. 11 | .IP 12 | When \fB\-\-service\fR is not specified, this option has no effect. 13 | -------------------------------------------------------------------------------- /lib/signals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2011, 2013 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SIGNALS_H 18 | #define SIGNALS_H 1 19 | 20 | #include 21 | #include 22 | #include "type-props.h" 23 | 24 | enum { SIGNAL_NAME_BUFSIZE = 7 + INT_STRLEN(int) + 1 }; 25 | const char *signal_name(int signum, char *namebuf, size_t bufsize); 26 | 27 | void xsigaction(int signum, const struct sigaction *, struct sigaction *old); 28 | 29 | #endif /* signals.h */ 30 | -------------------------------------------------------------------------------- /lib/sort.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef SORT_H 17 | #define SORT_H 1 18 | 19 | #include 20 | 21 | void sort(size_t count, 22 | int (*compare)(size_t a, size_t b, void *aux), 23 | void (*swap)(size_t a, size_t b, void *aux), 24 | void *aux); 25 | 26 | #endif /* sort.h */ 27 | -------------------------------------------------------------------------------- /lib/ssl-bootstrap-syn.man: -------------------------------------------------------------------------------- 1 | .br 2 | [\fB\-\-bootstrap\-ca\-cert=\fIcacert.pem] 3 | -------------------------------------------------------------------------------- /lib/ssl-bootstrap.man: -------------------------------------------------------------------------------- 1 | .IP "\fB\-\-bootstrap\-ca\-cert=\fIcacert.pem\fR" 2 | When \fIcacert.pem\fR exists, this option has the same effect as 3 | \fB\-C\fR or \fB\-\-ca\-cert\fR. If it does not exist, then 4 | \fB\*(PN\fR will attempt to obtain the CA certificate from the 5 | SSL peer on its first SSL connection and save it to the named PEM 6 | file. If it is successful, it will immediately drop the connection 7 | and reconnect, and from then on all SSL connections must be 8 | authenticated by a certificate signed by the CA certificate thus 9 | obtained. 10 | .IP 11 | \fBThis option exposes the SSL connection to a man-in-the-middle 12 | attack obtaining the initial CA certificate\fR, but it may be useful 13 | for bootstrapping. 14 | .IP 15 | This option is only useful if the SSL peer sends its CA certificate as 16 | part of the SSL certificate chain. The SSL protocol does not require 17 | the server to send the CA certificate. 18 | .IP 19 | This option is mutually exclusive with \fB\-C\fR and 20 | \fB\-\-ca\-cert\fR. 21 | -------------------------------------------------------------------------------- /lib/ssl-peer-ca-cert.man: -------------------------------------------------------------------------------- 1 | .IP "\fB\-\-peer\-ca\-cert=\fIpeer-cacert.pem\fR" 2 | Specifies a PEM file that contains one or more additional certificates 3 | to send to SSL peers. \fIpeer-cacert.pem\fR should be the CA 4 | certificate used to sign \fB\*(PN\fR's own certificate, that is, the 5 | certificate specified on \fB\-c\fR or \fB\-\-certificate\fR. If 6 | \fB\*(PN\fR's certificate is self-signed, then \fB\-\-certificate\fR 7 | and \fB\-\-peer\-ca\-cert\fR should specify the same file. 8 | .IP 9 | This option is not useful in normal operation, because the SSL peer 10 | must already have the CA certificate for the peer to have any 11 | confidence in \fB\*(PN\fR's identity. However, this offers a way for 12 | a new installation to bootstrap the CA certificate on its first SSL 13 | connection. 14 | -------------------------------------------------------------------------------- /lib/ssl-syn.man: -------------------------------------------------------------------------------- 1 | .IP "Public key infrastructure options:" 2 | [\fB\-\-private\-key=\fIprivkey.pem\fR] 3 | .br 4 | [\fB\-\-certificate=\fIcert.pem\fR] 5 | .br 6 | [\fB\-\-ca\-cert=\fIcacert.pem\fR] 7 | -------------------------------------------------------------------------------- /lib/ssl.man: -------------------------------------------------------------------------------- 1 | .de IQ 2 | . br 3 | . ns 4 | . IP "\\$1" 5 | .. 6 | .IP "\fB\-p\fR \fIprivkey.pem\fR" 7 | .IQ "\fB\-\-private\-key=\fIprivkey.pem\fR" 8 | Specifies a PEM file containing the private key used as \fB\*(PN\fR's 9 | identity for outgoing SSL connections. 10 | . 11 | .IP "\fB\-c\fR \fIcert.pem\fR" 12 | .IQ "\fB\-\-certificate=\fIcert.pem\fR" 13 | Specifies a PEM file containing a certificate that certifies the 14 | private key specified on \fB\-p\fR or \fB\-\-private\-key\fR to be 15 | trustworthy. The certificate must be signed by the certificate 16 | authority (CA) that the peer in SSL connections will use to verify it. 17 | . 18 | .IP "\fB\-C\fR \fIcacert.pem\fR" 19 | .IQ "\fB\-\-ca\-cert=\fIcacert.pem\fR" 20 | Specifies a PEM file containing the CA certificate that \fB\*(PN\fR 21 | should use to verify certificates presented to it by SSL peers. (This 22 | may be the same certificate that SSL peers use to verify the 23 | certificate specified on \fB\-c\fR or \fB\-\-certificate\fR, or it may 24 | be a different one, depending on the PKI design in use.) 25 | . 26 | .IP "\fB\-C none\fR" 27 | .IQ "\fB\-\-ca\-cert=none\fR" 28 | Disables verification of certificates presented by SSL peers. This 29 | introduces a security risk, because it means that certificates cannot 30 | be verified to be those of known trusted hosts. 31 | -------------------------------------------------------------------------------- /lib/string.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009, 2011 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include 20 | 21 | #ifndef HAVE_STRNLEN 22 | size_t 23 | strnlen(const char *s, size_t maxlen) 24 | { 25 | const char *end = memchr(s, '\0', maxlen); 26 | return end ? end - s : maxlen; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /lib/unixctl-syn.man: -------------------------------------------------------------------------------- 1 | .IP "Runtime management options:" 2 | \fB\-\-unixctl=\fIsocket\fR 3 | -------------------------------------------------------------------------------- /lib/unixctl.man: -------------------------------------------------------------------------------- 1 | .IP "\fB\-\-unixctl=\fIsocket\fR" 2 | Sets the name of the control socket on which \fB\*(PN\fR listens for 3 | runtime management commands (see \fBRUNTIME MANAGEMENT COMMANDS\fR, 4 | below). If \fIsocket\fR does not begin with \fB/\fR, it is 5 | interpreted as relative to \fB@RUNDIR@\fR. If \fB\-\-unixctl\fR is 6 | not used at all, the default socket is 7 | \fB@RUNDIR@/\*(PN.\fIpid\fB.ctl\fR, where \fIpid\fR is \fB\*(PN\fR's 8 | process ID. 9 | .IP 10 | On Windows, uses a kernel chosen TCP port on the localhost to listen 11 | for runtime management commands. The kernel chosen TCP port value is written 12 | in a file whose absolute path is pointed by \fIsocket\fR. If \fB\-\-unixctl\fR 13 | is not used at all, the file is created as \fB\*(PN.ctl\fR in the configured 14 | \fIOVS_RUNDIR\fR directory. 15 | .IP 16 | Specifying \fBnone\fR for \fIsocket\fR disables the control socket 17 | feature. 18 | -------------------------------------------------------------------------------- /lib/valgrind.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2009 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef VALGRIND_H 18 | #define VALGRIND_H 1 19 | 20 | #ifdef HAVE_VALGRIND_VALGRIND_H 21 | #include 22 | #else 23 | #define RUNNING_ON_VALGRIND 0 24 | #endif 25 | 26 | #endif /* valgrind.h */ 27 | -------------------------------------------------------------------------------- /lib/vconn-active.man: -------------------------------------------------------------------------------- 1 | .IP "\fBssl:\fIip\fR[\fB:\fIport\fR]" 2 | .IQ "\fBtcp:\fIip\fR[\fB:\fIport\fR]" 3 | The specified \fIport\fR on the host at the given \fIip\fR, which must 4 | be expressed as an IP address (not a DNS name) in IPv4 or IPv6 address 5 | format. Wrap IPv6 addresses in square brackets, 6 | e.g. \fBtcp:[::1]:6633\fR. For \fBssl\fR, the \fB\-\-private\-key\fR, 7 | \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory. 8 | .IP 9 | If \fIport\fR is not specified, it currently defaults to 6633. In the 10 | future, the default will change to 6653, which is the IANA-defined 11 | value. 12 | .TP 13 | \fBunix:\fIfile\fR 14 | On POSIX, a Unix domain server socket named \fIfile\fR. 15 | .IP 16 | On Windows, a localhost TCP port written in \fIfile\fR. 17 | -------------------------------------------------------------------------------- /lib/vconn-passive.man: -------------------------------------------------------------------------------- 1 | .IP "\fBpssl:\fR[\fIport\fR][\fB:\fIip\fR]" 2 | .IQ "\fBptcp:\fR[\fIport\fR][\fB:\fIip\fR]" 3 | Listens for OpenFlow connections on \fIport\fR. The default 4 | \fIport\fR is 6633, but a future version of Open vSwitch will change 5 | the default to the IANA-defined port 6653. By default, connections 6 | are allowed from any IPv4 address. Specify \fIip\fR as an IPv4 7 | address or a bracketed IPv6 address (e.g. \fBptcp:6633:[::1]\fR). DNS 8 | names may not be used. For \fBpssl\fR, the 9 | \fB\-\-private\-key\fR,\fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR 10 | options are mandatory. 11 | .IP 12 | . 13 | .IP "\fBpunix:\fIfile\fR" 14 | Listens for OpenFlow connections on the Unix domain server socket 15 | named \fIfile\fR. 16 | -------------------------------------------------------------------------------- /lib/vlog-syn.man: -------------------------------------------------------------------------------- 1 | .IP "Logging options:" 2 | [\fB\-v\fR[\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]]]\&... 3 | .br 4 | [\fB\-\-verbose[=\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]]]\&... 5 | .br 6 | [\fB\-\-log\-file\fR[\fB=\fIfile\fR]] 7 | -------------------------------------------------------------------------------- /lib/vswitch-idl.ann: -------------------------------------------------------------------------------- 1 | # -*- python -*- 2 | 3 | # This code, when invoked by "ovsdb-idlc annotate" (by the build 4 | # process), annotates vswitch.ovsschema with additional data that give 5 | # the ovsdb-idl engine information about the types involved, so that 6 | # it can generate more programmer-friendly data structures. 7 | 8 | s["idlPrefix"] = "ovsrec_" 9 | s["idlHeader"] = "\"lib/vswitch-idl.h\"" 10 | -------------------------------------------------------------------------------- /lib/vtep-idl.ann: -------------------------------------------------------------------------------- 1 | # -*- python -*- 2 | 3 | # This code, when invoked by "ovsdb-idlc annotate" (by the build 4 | # process), annotates vswitch.ovsschema with additional data that give 5 | # the ovsdb-idl engine information about the types involved, so that 6 | # it can generate more programmer-friendly data structures. 7 | 8 | s["idlPrefix"] = "vteprec_" 9 | s["idlHeader"] = "\"lib/vtep-idl.h\"" 10 | -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | /libtool.m4 2 | /ltoptions.m4 3 | /ltsugar.m4 4 | /ltversion.m4 5 | /lt~obsolete.m4 6 | -------------------------------------------------------------------------------- /m4/automake.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Nicira, Inc. 2 | # 3 | # Copying and distribution of this file, with or without modification, 4 | # are permitted in any medium without royalty provided the copyright 5 | # notice and this notice are preserved. This file is offered as-is, 6 | # without warranty of any kind. 7 | 8 | EXTRA_DIST += \ 9 | m4/absolute-header.m4 \ 10 | m4/include_next.m4 11 | -------------------------------------------------------------------------------- /m4/compat.at: -------------------------------------------------------------------------------- 1 | # -*- autoconf -*- 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | m4_ifndef([AT_CHECK_UNQUOTED], 16 | [m4_define([AT_CHECK_UNQUOTED], 17 | [_AT_CHECK([$1], [$2], AS_ESCAPE(m4_dquote(m4_expand([$3])), [""]), 18 | AS_ESCAPE(m4_dquote(m4_expand([$4])),[""]), [$5], [$6])])]) 19 | 20 | m4_ifndef([AT_SKIP_IF], 21 | [m4_define([AT_SKIP_IF], 22 | [AT_CHECK([($1) \ 23 | && exit 77 || exit 0], [0], [ignore], [ignore])])]) 24 | 25 | m4_ifndef([AT_FAIL_IF], 26 | [m4_define([AT_FAIL_IF], 27 | [AT_CHECK([($1) \ 28 | && exit 99 || exit 0], [0], [ignore], [ignore])])]) 29 | 30 | m4_ifndef([AS_VAR_COPY], 31 | [m4_define([AS_VAR_COPY], 32 | [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])]) 33 | -------------------------------------------------------------------------------- /ofproto/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /ipfix-entities.def 4 | -------------------------------------------------------------------------------- /ofproto/collectors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009, 2011 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef COLLECTORS_H 18 | #define COLLECTORS_H 1 19 | 20 | #include 21 | #include 22 | 23 | struct collectors; 24 | struct sset; 25 | 26 | int collectors_create(const struct sset *targets, uint16_t default_port, 27 | struct collectors **); 28 | void collectors_destroy(struct collectors *); 29 | 30 | void collectors_send(const struct collectors *, const void *, size_t); 31 | 32 | int collectors_count(const struct collectors *); 33 | 34 | #endif /* collectors.h */ 35 | -------------------------------------------------------------------------------- /ofproto/ipfix-enterprise-entities.def: -------------------------------------------------------------------------------- 1 | /* IPFIX enterprise entities. */ 2 | #ifndef IPFIX_ENTERPRISE_ENTITY 3 | #define IPFIX_ENTERPRISE_ENTITY(ENUM, ID, SIZE, NAME, ENTERPRISE) 4 | #endif 5 | 6 | #define IPFIX_ENTERPRISE_VMWARE 6876 7 | 8 | IPFIX_ENTERPRISE_ENTITY(TUNNEL_TYPE, 891, 1, tunnelType, IPFIX_ENTERPRISE_VMWARE) 9 | IPFIX_ENTERPRISE_ENTITY(TUNNEL_KEY, 892, 0, tunnelKey, IPFIX_ENTERPRISE_VMWARE) 10 | IPFIX_ENTERPRISE_ENTITY(TUNNEL_SOURCE_IPV4_ADDRESS, 893, 4, tunnelSourceIPv4Address, IPFIX_ENTERPRISE_VMWARE) 11 | IPFIX_ENTERPRISE_ENTITY(TUNNEL_DESTINATION_IPV4_ADDRESS, 894, 4, tunnelDestinationIPv4Address, IPFIX_ENTERPRISE_VMWARE) 12 | IPFIX_ENTERPRISE_ENTITY(TUNNEL_PROTOCOL_IDENTIFIER, 895, 1, tunnelProtocolIdentifier, IPFIX_ENTERPRISE_VMWARE) 13 | IPFIX_ENTERPRISE_ENTITY(TUNNEL_SOURCE_TRANSPORT_PORT, 896, 2, tunnelSourceTransportPort, IPFIX_ENTERPRISE_VMWARE) 14 | IPFIX_ENTERPRISE_ENTITY(TUNNEL_DESTINATION_TRANSPORT_PORT, 897, 2, tunnelDestinationTransportPort, IPFIX_ENTERPRISE_VMWARE) 15 | 16 | #undef IPFIX_ENTERPRISE_ENTITY 17 | -------------------------------------------------------------------------------- /ofproto/names.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "ofproto/ofproto.h" 20 | 21 | #include "dpif.h" 22 | 23 | /* This function is in a separate file because it is the only ofproto function 24 | * required by ovs-ofctl, which allows ovs-ofctl to avoid linking in extra 25 | * baggage. */ 26 | 27 | /* Parses 'ofproto_name', which is of the form [type@]name into component 28 | * pieces that are suitable for passing to ofproto_create(). The caller must 29 | * free 'name' and 'type'. */ 30 | void 31 | ofproto_parse_name(const char *ofproto_name, char **name, char **type) 32 | { 33 | dp_parse_name(ofproto_name, name, type); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /ofproto/ofproto-dpif-monitor.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. */ 14 | 15 | #ifndef OFPROTO_DPIF_MONITOR_H 16 | #define OFPROTO_DPIF_MONITOR_H 1 17 | 18 | #include 19 | 20 | #include "openflow/openflow.h" 21 | #include "packets.h" 22 | 23 | struct bfd; 24 | struct cfm; 25 | struct ofport_dpif; 26 | 27 | void ofproto_dpif_monitor_port_send_soon(const struct ofport_dpif *); 28 | 29 | void ofproto_dpif_monitor_port_update(const struct ofport_dpif *, 30 | struct bfd *, struct cfm *, 31 | uint8_t[OFP_ETH_ALEN]); 32 | 33 | #endif /* ofproto-dpif-monitor.h */ 34 | -------------------------------------------------------------------------------- /ofproto/pktbuf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2009, 2011, 2012 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef PKTBUF_H 18 | #define PKTBUF_H 1 19 | 20 | #include 21 | #include 22 | 23 | #include "ofp-errors.h" 24 | 25 | struct pktbuf; 26 | struct ofpbuf; 27 | 28 | int pktbuf_capacity(void); 29 | 30 | struct pktbuf *pktbuf_create(void); 31 | void pktbuf_destroy(struct pktbuf *); 32 | uint32_t pktbuf_save(struct pktbuf *, const void *buffer, size_t buffer_size, 33 | ofp_port_t in_port); 34 | uint32_t pktbuf_get_null(void); 35 | enum ofperr pktbuf_retrieve(struct pktbuf *, uint32_t id, 36 | struct ofpbuf **bufferp, ofp_port_t *in_port); 37 | void pktbuf_discard(struct pktbuf *, uint32_t id); 38 | 39 | unsigned int pktbuf_count_packets(const struct pktbuf *); 40 | 41 | #endif /* pktbuf.h */ 42 | -------------------------------------------------------------------------------- /ovsdb/.gitignore: -------------------------------------------------------------------------------- 1 | /ovsdb-client 2 | /ovsdb-client.1 3 | /ovsdb-doc 4 | /ovsdb-dot 5 | /ovsdb-idlc 6 | /ovsdb-server 7 | /ovsdb-server.1 8 | /ovsdb-tool 9 | /ovsdb-tool.1 10 | -------------------------------------------------------------------------------- /ovsdb/query.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef OVSDB_QUERY_H 17 | #define OVSDB_QUERY_H 1 18 | 19 | #include 20 | 21 | struct ovsdb_column_set; 22 | struct ovsdb_condition; 23 | struct ovsdb_row; 24 | struct ovsdb_row_set; 25 | struct ovsdb_table; 26 | struct ovsdb_txn; 27 | 28 | void ovsdb_query(struct ovsdb_table *, const struct ovsdb_condition *, 29 | bool (*output_row)(const struct ovsdb_row *, void *aux), 30 | void *aux); 31 | void ovsdb_query_row_set(struct ovsdb_table *, const struct ovsdb_condition *, 32 | struct ovsdb_row_set *); 33 | void ovsdb_query_distinct(struct ovsdb_table *, const struct ovsdb_condition *, 34 | const struct ovsdb_column_set *, 35 | struct ovsdb_row_set *); 36 | 37 | #endif /* ovsdb/query.h */ 38 | -------------------------------------------------------------------------------- /ovsdb/remote-active.man: -------------------------------------------------------------------------------- 1 | .IP "\fBssl:\fIip\fB:\fIport\fR" 2 | The specified SSL \fIport\fR on the host at the given \fIip\fR, which 3 | must be expressed as an IP address (not a DNS name) in IPv4 or IPv6 address 4 | format. If \fIip\fR is an IPv6 address, then wrap \fIip\fR with square 5 | brackets, e.g.: \fBssl:[::1]:6632\fR. 6 | The \fB\-\-private\-key\fR, \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR 7 | options are mandatory when this form is used. 8 | . 9 | .IP "\fBtcp:\fIip\fB:\fIport\fR" 10 | Connect to the given TCP \fIport\fR on \fIip\fR, where \fIip\fR can be IPv4 11 | or IPv6 address. If \fIip\fR is an IPv6 address, then wrap \fIip\fR with 12 | square brackets, e.g.: \fBtcp:[::1]:6632\fR. 13 | . 14 | .IP "\fBunix:\fIfile\fR" 15 | On POSIX, connect to the Unix domain server socket named \fIfile\fR. 16 | .IP 17 | On Windows, connect to a localhost TCP port whose value is written in 18 | \fIfile\fR. 19 | -------------------------------------------------------------------------------- /ovsdb/remote-passive.man: -------------------------------------------------------------------------------- 1 | .IP "\fBpssl:\fIport\fR[\fB:\fIip\fR]" 2 | Listen on the given SSL \fIport\fR for a connection. By default, 3 | connections are not bound to a particular local IP address and 4 | it listens only on IPv4 (but not IPv6) addresses, but 5 | specifying \fIip\fR limits connections to those from the given 6 | \fIip\fR, either IPv4 or IPv6 address. If \fIip\fR is 7 | an IPv6 address, then wrap \fIip\fR with square brackets, e.g.: 8 | \fBpssl:6632:[::1]\fR. The \fB\-\-private\-key\fR, 9 | \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory 10 | when this form is used. 11 | . 12 | .IP "\fBptcp:\fIport\fR[\fB:\fIip\fR]" 13 | Listen on the given TCP \fIport\fR for a connection. By default, 14 | connections are not bound to a particular local IP address and 15 | it listens only on IPv4 (but not IPv6) addresses, but 16 | \fIip\fR may be specified to listen only for connections to the given 17 | \fIip\fR, either IPv4 or IPv6 address. If \fIip\fR is 18 | an IPv6 address, then wrap \fIip\fR with square brackets, e.g.: 19 | \fBptcp:6632:[::1]\fR. 20 | . 21 | .IP "\fBpunix:\fIfile\fR" 22 | On POSIX, listen on the Unix domain server socket named \fIfile\fR for a 23 | connection. 24 | .IP 25 | On Windows, listen on a kernel chosen TCP port on the localhost. The kernel 26 | chosen TCP port value is written in \fIfile\fR. 27 | -------------------------------------------------------------------------------- /python/compat/automake.mk: -------------------------------------------------------------------------------- 1 | EXTRA_DIST += \ 2 | python/compat/uuid.py \ 3 | python/compat/argparse.py 4 | -------------------------------------------------------------------------------- /python/ovs/.gitignore: -------------------------------------------------------------------------------- 1 | version.py 2 | -------------------------------------------------------------------------------- /python/ovs/__init__.py: -------------------------------------------------------------------------------- 1 | # This file intentionally left blank. 2 | -------------------------------------------------------------------------------- /python/ovs/db/__init__.py: -------------------------------------------------------------------------------- 1 | # This file intentionally left blank. 2 | -------------------------------------------------------------------------------- /python/ovs/db/error.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009, 2010, 2011 Nicira, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import ovs.json 16 | 17 | 18 | class Error(Exception): 19 | def __init__(self, msg, json=None, tag=None): 20 | self.msg = msg 21 | self.json = json 22 | if tag is None: 23 | if json is None: 24 | self.tag = "ovsdb error" 25 | else: 26 | self.tag = "syntax error" 27 | else: 28 | self.tag = tag 29 | 30 | # Compose message. 31 | syntax = "" 32 | if self.json is not None: 33 | syntax = 'syntax "%s": ' % ovs.json.to_string(self.json) 34 | Exception.__init__(self, "%s%s: %s" % (syntax, self.tag, self.msg)) 35 | -------------------------------------------------------------------------------- /python/ovs/dirs.py: -------------------------------------------------------------------------------- 1 | import os 2 | PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """/usr/local/share/openvswitch""") 3 | RUNDIR = os.environ.get("OVS_RUNDIR", """/var/run""") 4 | LOGDIR = os.environ.get("OVS_LOGDIR", """/usr/local/var/log""") 5 | BINDIR = os.environ.get("OVS_BINDIR", """/usr/local/bin""") 6 | 7 | DBDIR = os.environ.get("OVS_DBDIR") 8 | if not DBDIR: 9 | sysconfdir = os.environ.get("OVS_SYSCONFDIR") 10 | if sysconfdir: 11 | DBDIR = "%s/openvswitch" % sysconfdir 12 | else: 13 | DBDIR = """/usr/local/etc/openvswitch""" 14 | -------------------------------------------------------------------------------- /python/ovs/dirs.py.template: -------------------------------------------------------------------------------- 1 | ## The @variables@ in this file are replaced by default directories for 2 | ## use in python/ovs/dirs.py in the source directory and replaced by the 3 | ## configured directories for use in the installed python/ovs/dirs.py. 4 | ## 5 | import os 6 | PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """@pkgdatadir@""") 7 | RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""") 8 | LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""") 9 | BINDIR = os.environ.get("OVS_BINDIR", """@bindir@""") 10 | 11 | DBDIR = os.environ.get("OVS_DBDIR") 12 | if not DBDIR: 13 | sysconfdir = os.environ.get("OVS_SYSCONFDIR") 14 | if sysconfdir: 15 | DBDIR = "%s/openvswitch" % sysconfdir 16 | else: 17 | DBDIR = """@DBDIR@""" 18 | -------------------------------------------------------------------------------- /python/ovstest/__init__.py: -------------------------------------------------------------------------------- 1 | # This file intentionally left blank. 2 | -------------------------------------------------------------------------------- /rhel/.gitignore: -------------------------------------------------------------------------------- 1 | openvswitch-kmod-rhel5.spec 2 | openvswitch-kmod-rhel6.spec 3 | openvswitch-kmod-fedora.spec 4 | openvswitch.spec 5 | openvswitch-fedora.spec 6 | -------------------------------------------------------------------------------- /rhel/etc_logrotate.d_openvswitch: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. 2 | # 3 | # Copying and distribution of this file, with or without modification, 4 | # are permitted in any medium without royalty provided the copyright 5 | # notice and this notice are preserved. This file is offered as-is, 6 | # without warranty of any kind. 7 | 8 | /var/log/openvswitch/*.log { 9 | daily 10 | compress 11 | sharedscripts 12 | missingok 13 | postrotate 14 | # Tell Open vSwitch daemons to reopen their log files 15 | for pidfile in `cd /var/run/openvswitch && echo *.pid`; do 16 | ovs-appctl -t "${pidfile%%.pid}" vlog/reopen 17 | done 18 | endscript 19 | } 20 | -------------------------------------------------------------------------------- /rhel/openvswitch-kmod.files: -------------------------------------------------------------------------------- 1 | %defattr(644,root,root,755) 2 | /lib/modules/%2-%1 3 | /etc/depmod.d/openvswitch.conf 4 | -------------------------------------------------------------------------------- /rhel/usr_lib_systemd_system_openvswitch-nonetwork.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Open vSwitch Internal Unit 3 | After=syslog.target 4 | PartOf=openvswitch.service 5 | Wants=openvswitch.service 6 | 7 | [Service] 8 | Type=oneshot 9 | RemainAfterExit=yes 10 | EnvironmentFile=-/etc/sysconfig/openvswitch 11 | ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start \ 12 | --system-id=random $OPTIONS 13 | ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop 14 | -------------------------------------------------------------------------------- /rhel/usr_lib_systemd_system_openvswitch.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Open vSwitch 3 | After=syslog.target network.target openvswitch-nonetwork.service 4 | Requires=openvswitch-nonetwork.service 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStart=/bin/true 9 | ExecStop=/bin/true 10 | RemainAfterExit=yes 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /rhel/usr_share_openvswitch_scripts_sysconfig.template: -------------------------------------------------------------------------------- 1 | ### Configuration options for openvswitch 2 | 3 | # Copyright (C) 2009, 2010, 2011 Nicira, Inc. 4 | 5 | # FORCE_COREFILES: If 'yes' then core files will be enabled. 6 | # FORCE_COREFILES=yes 7 | 8 | # OVSDB_SERVER_PRIORITY: "nice" priority at which to run ovsdb-server. 9 | # 10 | # OVSDB_SERVER_PRIORITY=-10 11 | 12 | # VSWITCHD_PRIORITY: "nice" priority at which to run ovs-vswitchd. 13 | # VSWITCHD_PRIORITY=-10 14 | 15 | # VSWITCHD_MLOCKALL: Whether to pass ovs-vswitchd the --mlockall option. 16 | # This option should be set to "yes" or "no". The default is "yes". 17 | # Enabling this option can avoid networking interruptions due to 18 | # system memory pressure in extraordinary situations, such as multiple 19 | # concurrent VM import operations. 20 | # VSWITCHD_MLOCKALL=yes 21 | 22 | # OVS_CTL_OPTS: Extra options to pass to ovs-ctl. This is, for example, 23 | # a suitable place to specify --ovs-vswitchd-wrapper=valgrind. 24 | # OVS_CTL_OPTS= 25 | -------------------------------------------------------------------------------- /rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template: -------------------------------------------------------------------------------- 1 | ### Configuration options for openvswitch 2 | # 3 | # Enable core files: 4 | # --force-corefiles=yes 5 | # 6 | # Set "nice" priority at which to run ovsdb-server: 7 | # --ovsdb-server-priority=-10 8 | # 9 | # Set "nice" priority at which to run ovsdb-vswitchd: 10 | # --ovs-vswitchd-priority=-10 11 | # 12 | # Pass or not --mlockall option to ovs-vswitchd. 13 | # This option should be set to "yes" or "no". The default is "yes". 14 | # Enabling this option can avoid networking interruptions due to 15 | # system memory pressure in extraordinary situations, such as multiple 16 | # concurrent VM import operations. 17 | # --mlockall=yes 18 | # 19 | # Use valgrind: 20 | # --ovs-vswitchd-wrapper=valgrind 21 | # --ovsdb-server-wrapper=valgrind 22 | # 23 | OPTIONS="" 24 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.pem 2 | /Makefile 3 | /Makefile.in 4 | /atconfig 5 | /atlocal 6 | /idltest.c 7 | /idltest.h 8 | /idltest.ovsidl 9 | /ovstest 10 | /ovs-pki.log 11 | /pki/ 12 | /test-aes128 13 | /test-atomic 14 | /test-bundle 15 | /test-byte-order 16 | /test-classifier 17 | /test-csum 18 | /test-flows 19 | /test-hash 20 | /test-heap 21 | /test-hindex 22 | /test-hmap 23 | /test-json 24 | /test-jsonrpc 25 | /test-list 26 | /test-lockfile 27 | /test-multipath 28 | /test-netflow 29 | /test-odp 30 | /test-ovsdb 31 | /test-packets 32 | /test-random 33 | /test-reconnect 34 | /test-rstp 35 | /test-sflow 36 | /test-sha1 37 | /test-stp 38 | /test-strtok_r 39 | /test-timeval 40 | /test-type-props 41 | /test-unix-socket 42 | /test-util 43 | /test-uuid 44 | /test-vconn 45 | /testsuite 46 | /testsuite.dir/ 47 | /testsuite.log 48 | -------------------------------------------------------------------------------- /tests/bridge.at: -------------------------------------------------------------------------------- 1 | AT_BANNER([bridge]) 2 | 3 | dnl When a port disappears from a datapath, e.g. because an admin used 4 | dnl "ovs-dpctl del-port", the bridge code should be resilient enough to 5 | dnl notice and add it back the next time we reconfigure. A prior version 6 | dnl of the code failed to do this, so this test guards against regression. 7 | AT_SETUP([bridge - ports that disappear get added back]) 8 | OVS_VSWITCHD_START 9 | 10 | # Add some ports and make sure that they show up in the datapath. 11 | ADD_OF_PORTS([br0], 1, 2) 12 | AT_CHECK([ovs-appctl dpif/show], [0], [dnl 13 | dummy@ovs-dummy: hit:0 missed:0 14 | br0: 15 | br0 65534/100: (dummy) 16 | p1 1/1: (dummy) 17 | p2 2/2: (dummy) 18 | ]) 19 | 20 | # Delete p1 from the datapath as if by "ovs-dpctl del-port" 21 | # and check that it disappeared. 22 | AT_CHECK([ovs-appctl dpif-dummy/delete-port ovs-dummy p1]) 23 | AT_CHECK([ovs-appctl dpif/show], [0], [dnl 24 | dummy@ovs-dummy: hit:0 missed:0 25 | br0: 26 | br0 65534/100: (dummy) 27 | p2 2/2: (dummy) 28 | ]) 29 | 30 | # Force reconfiguration and make sure that p1 got added back. 31 | AT_CHECK([ovs-vsctl del-port p2]) 32 | AT_CHECK([ovs-appctl dpif/show], [0], [dnl 33 | dummy@ovs-dummy: hit:0 missed:0 34 | br0: 35 | br0 65534/100: (dummy) 36 | p1 1/1: (dummy) 37 | ]) 38 | AT_CLEANUP 39 | -------------------------------------------------------------------------------- /tests/glibc.supp: -------------------------------------------------------------------------------- 1 | # suppress what appear to unavoidable error reports from glibc 2 | 3 | { 4 | timer_create 5 | Memcheck:Leak 6 | fun:malloc 7 | fun:timer_create 8 | } 9 | 10 | { 11 | timer_create 12 | Memcheck:Param 13 | timer_create(evp) 14 | ... 15 | fun:set_up_timer 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/heap.at: -------------------------------------------------------------------------------- 1 | AT_BANNER([heap library]) 2 | 3 | m4_define([TEST_HEAP], 4 | [AT_SETUP([heap library -- m4_bpatsubst([$1], [-], [ ])]) 5 | AT_CHECK([ovstest test-heap $1]) 6 | AT_CLEANUP]) 7 | 8 | TEST_HEAP([insert-delete-same-order]) 9 | TEST_HEAP([insert-delete-reverse-order]) 10 | TEST_HEAP([insert-delete-every-order]) 11 | TEST_HEAP([insert-delete-same-order-with-dups]) 12 | TEST_HEAP([raw-insert]) 13 | TEST_HEAP([raw-delete]) 14 | -------------------------------------------------------------------------------- /tests/idltest.ann: -------------------------------------------------------------------------------- 1 | # -*- python -*- 2 | 3 | # This code, when invoked by "ovsdb-idlc annotate" (by the build 4 | # process), annotates idltest.ovsschema with additional data that give 5 | # the ovsdb-idl engine information about the types involved, so that 6 | # it can generate more programmer-friendly data structures. 7 | 8 | s["idlPrefix"] = "idltest_" 9 | s["idlHeader"] = "\"tests/idltest.h\"" 10 | -------------------------------------------------------------------------------- /tests/openssl.supp: -------------------------------------------------------------------------------- 1 | # suppress OpenSSL errors from valgrind 2 | 3 | { 4 | BN_mod_inverse 5 | Memcheck:Cond 6 | fun:BN_mod_inverse 7 | } 8 | 9 | { 10 | BN_div 11 | Memcheck:Cond 12 | fun:BN_div 13 | } 14 | -------------------------------------------------------------------------------- /tests/ovsdb-column.at: -------------------------------------------------------------------------------- 1 | AT_BANNER([OVSDB -- columns]) 2 | 3 | OVSDB_CHECK_POSITIVE_CPY([ordinary column], 4 | [[parse-column mycol '{"type": "integer"}']], 5 | [[{"type":"integer"}]]) 6 | 7 | OVSDB_CHECK_POSITIVE_CPY([immutable column], 8 | [[parse-column mycol '{"type": "real", "mutable": false}']], 9 | [[{"mutable":false,"type":"real"}]]) 10 | 11 | OVSDB_CHECK_POSITIVE_CPY([ephemeral column], 12 | [[parse-column mycol '{"type": "uuid", "ephemeral": true}']], 13 | [[{"ephemeral":true,"type":"uuid"}]]) 14 | -------------------------------------------------------------------------------- /tests/ovsdb-macros.at: -------------------------------------------------------------------------------- 1 | dnl OVSDB_INIT([$1]) 2 | dnl 3 | dnl Creates an empty database named $1. 4 | m4_define([OVSDB_INIT], 5 | [OVS_RUNDIR=`pwd`; export OVS_RUNDIR 6 | AT_CHECK( 7 | [ovsdb-tool create $1 $abs_top_srcdir/vswitchd/vswitch.ovsschema], 8 | [0], [stdout], [ignore]) 9 | AT_CHECK( 10 | [[ovsdb-tool transact $1 \ 11 | '["Open_vSwitch", 12 | {"op": "insert", 13 | "table": "Open_vSwitch", 14 | "row": {}}]']], 15 | [0], [ignore], [ignore])]) 16 | -------------------------------------------------------------------------------- /tests/ovsdb-monitor-sort.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | # Breaks lines read from into groups using blank lines as 7 | # group separators, then sorts lines within the groups for 8 | # reproducibility. 9 | 10 | sub compare_lines { 11 | my ($a, $b) = @_; 12 | 13 | my $u = '[0-9a-fA-F]'; 14 | my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}"; 15 | if ($a =~ /^$uuid_re/) { 16 | if ($b =~ /^$uuid_re/) { 17 | return substr($a, 36) cmp substr($b, 36); 18 | } else { 19 | return 1; 20 | } 21 | } elsif ($b =~ /^$uuid_re/) { 22 | return -1; 23 | } else { 24 | return $a cmp $b; 25 | } 26 | } 27 | 28 | sub output_group { 29 | my (@group) = @_; 30 | print "$_\n" foreach sort { compare_lines($a, $b) } @group; 31 | } 32 | 33 | if ("$^O" eq "msys") { 34 | $/ = "\r\n"; 35 | } 36 | my @group = (); 37 | while () { 38 | chomp; 39 | if ($_ eq '') { 40 | output_group(@group); 41 | @group = (); 42 | print "\n"; 43 | } else { 44 | if (/^,/ && @group) { 45 | $group[$#group] .= "\n" . $_; 46 | } else { 47 | push(@group, $_); 48 | } 49 | } 50 | } 51 | 52 | output_group(@group) if @group; 53 | -------------------------------------------------------------------------------- /tests/test-strtok_r.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | /* Some versions of glibc 2.7 has a bug in strtok_r when with optimization that 22 | * can cause segfaults: 23 | * http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614. 24 | * 25 | * Open vSwitch works around this problem by supplying a replacement string.h. 26 | * This test program verifies that the workaround is in place. 27 | */ 28 | int 29 | main(void) 30 | { 31 | char string[] = ":::"; 32 | char *save_ptr = (char *) 0xc0ffee; 33 | char *token1, *token2; 34 | token1 = strtok_r(string, ":", &save_ptr); 35 | token2 = strtok_r(NULL, ":", &save_ptr); 36 | printf ("%s %s\n", token1 ? token1 : "NULL", token2 ? token2 : "NULL"); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /tests/test-uuid.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009, 2014 Nicira, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include "uuid.h" 19 | #include 20 | #include "ovstest.h" 21 | 22 | static void 23 | test_uuid_main(int argc, char *argv[]) 24 | { 25 | struct uuid uuid; 26 | 27 | if (argc == 1) { 28 | uuid_generate(&uuid); 29 | } else if (argc == 2) { 30 | if (!uuid_from_string(&uuid, argv[1])) { 31 | ovs_fatal(0, "\"%s\" is not a valid UUID", argv[1]); 32 | } 33 | } else { 34 | ovs_fatal(0, "usage: %s [UUID]", argv[0]); 35 | } 36 | 37 | printf(UUID_FMT"\n", UUID_ARGS(&uuid)); 38 | } 39 | 40 | OVSTEST_REGISTER("test-uuid", test_uuid_main); 41 | -------------------------------------------------------------------------------- /tests/uuid.at: -------------------------------------------------------------------------------- 1 | AT_BANNER([UUID unit tests]) 2 | 3 | m4_define([UUID_REGEX], 4 | [[[0-9a-f]\{8\}-[0-9a-f]\{4\}-4[0-9a-f]\{3\}-[89ab][0-9a-f]\{3\}-[0-9a-f]\{12\}$]]) 5 | 6 | m4_define([CHECK_UUID], 7 | [if expr "$uuid" : 'UUID_REGEX' > /dev/null 8 | then 9 | : 10 | else 11 | echo "$uuid: not a random UUID" 12 | exit 1 13 | fi]) 14 | 15 | AT_SETUP([UUID generation, parsing, serialization]) 16 | AT_KEYWORDS([UUID]) 17 | AT_CHECK([ 18 | uuids= 19 | for i in m4_for([count], [1], [100], [1], [count ]); do 20 | # Generate random UUID and check that it is in the expected format. 21 | uuid=`ovstest test-uuid` 22 | CHECK_UUID 23 | 24 | # Verify that $uuid does not duplicate any UUID generated so far. 25 | case $uuids in 26 | *$uuid*) 27 | echo "$uuid: generated duplicate UUID" 28 | exit 1 29 | esac 30 | uuids="$uuids $uuid" 31 | 32 | # Verify that test-uuid parses and re-serializes this UUID correctly. 33 | serialized=`ovstest test-uuid $uuid` 34 | if test "$uuid" != "$serialized"; then 35 | echo "$uuid: test-uuid serialized this as $serialized" 36 | exit 1 37 | fi 38 | done], [0]) 39 | AT_CLEANUP 40 | -------------------------------------------------------------------------------- /tests/uuidfilt.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | our %uuids; 7 | our $n_uuids = 0; 8 | sub lookup_uuid { 9 | my ($uuid) = @_; 10 | if (!exists($uuids{$uuid})) { 11 | $uuids{$uuid} = $n_uuids++; 12 | } 13 | return "<$uuids{$uuid}>"; 14 | } 15 | 16 | sub sort_set { 17 | my ($s) = @_; 18 | my (@uuids) = sort { $a <=> $b } (grep(/\d+/, split(/(\d+)/, $s))); 19 | return '["set",[' . join(',', map('["uuid","<' . $_ . '>"]', @uuids)) . ']]'; 20 | } 21 | 22 | my $u = '[0-9a-fA-F]'; 23 | my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}"; 24 | while (<>) { 25 | s/($uuid_re)/lookup_uuid($1)/eg; 26 | 27 | # Sort sets like this: 28 | # [["uuid","<1>"],["uuid","<0>"]] 29 | # to look like this: 30 | # [["uuid","<0>"],["uuid","<1>"]] 31 | s/(\["set",\[(,?\["uuid","<\d+>"\])+\]\])/sort_set($1)/ge; 32 | print $_; 33 | } 34 | -------------------------------------------------------------------------------- /tests/valgrind-wrapper.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | wrap_program=`basename '@wrap_program@'` 4 | 5 | # Strip the first directory from $PATH that contains $wrap_program, 6 | # so that below we run the real $wrap_program, not ourselves. 7 | not_found=true 8 | new_path= 9 | first=true 10 | save_IFS=$IFS 11 | IFS=: 12 | for dir in $PATH; do 13 | IFS=$save_IFS 14 | if $not_found && test -x "$dir/$wrap_program"; then 15 | not_found=false 16 | else 17 | if $first; then 18 | first=false 19 | new_path=$dir 20 | else 21 | new_path=$new_path:$dir 22 | fi 23 | fi 24 | done 25 | IFS=$save_IFS 26 | if $not_found; then 27 | echo "$0: error: cannot find $wrap_program in \$PATH" >&2 28 | exit 1 29 | fi 30 | PATH=$new_path 31 | export PATH 32 | 33 | : ${VALGRIND:=valgrind -q --log-file=valgrind.%p --leak-check=full} 34 | exec $VALGRIND $wrap_program "$@" 35 | echo "$0: failed to execute $VALGRIND $wrap_program" "$@" >&2 36 | exit 1 37 | -------------------------------------------------------------------------------- /tests/vconn.at: -------------------------------------------------------------------------------- 1 | m4_define([TEST_VCONN_CLASS], 2 | [AT_BANNER([vconn library -- $1 class]) 3 | m4_foreach( 4 | [testname], 5 | [[refuse-connection], 6 | [accept-then-close], 7 | [read-hello], 8 | [send-plain-hello], 9 | [send-long-hello], 10 | [send-echo-hello], 11 | [send-short-hello], 12 | [send-invalid-version-hello]], 13 | [AT_SETUP([$1 vconn - m4_bpatsubst(testname, [-], [ ])]) 14 | OVS_RUNDIR=`pwd`; export OVS_RUNDIR 15 | m4_if([$1], [ssl], [ 16 | AT_SKIP_IF([test "$HAVE_OPENSSL" = no]) 17 | AT_CHECK([cp $abs_top_builddir/tests/testpki*.pem .])]) 18 | AT_CHECK([ovstest test-vconn testname $1], [0], [], [ignore]) 19 | AT_CLEANUP])]) 20 | 21 | TEST_VCONN_CLASS([unix]) 22 | TEST_VCONN_CLASS([tcp]) 23 | TEST_VCONN_CLASS([ssl]) 24 | -------------------------------------------------------------------------------- /third-party/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | -------------------------------------------------------------------------------- /third-party/README: -------------------------------------------------------------------------------- 1 | This directory contains third-party software that may be useful for 2 | debugging. 3 | 4 | tcpdump 5 | ------- 6 | The "ofp-tcpdump.patch" patch adds the ability to parse OpenFlow 7 | messages to tcpdump. These instructions assume that tcpdump 4.3.0 8 | is going to be used, but it should work with other versions that are not 9 | substantially different. To begin, download tcpdump and apply the 10 | patch: 11 | 12 | wget http://www.tcpdump.org/release/tcpdump-4.3.0.tar.gz 13 | tar xzf tcpdump-4.3.0.tar.gz 14 | ln -s tcpdump-4.3.0 tcpdump 15 | patch -p0 < ofp-tcpdump.patch 16 | 17 | Then build the new version of tcpdump: 18 | 19 | cd tcpdump 20 | ./configure 21 | make 22 | 23 | Clearly, tcpdump can only parse unencrypted packets, so you will need to 24 | connect the controller and datapath using plain TCP. To look at the 25 | traffic, tcpdump will be started in a manner similar to the following: 26 | 27 | sudo ./tcpdump -s0 -i eth0 port 6633 28 | 29 | The "-s0" flag indicates that tcpdump should capture the entire packet. 30 | If the OpenFlow message is not received in its entirety, "[|openflow]" will 31 | be printed instead of the OpenFlow message contents. 32 | 33 | The verbosity of the output may be increased by adding additional "-v" 34 | flags. If "-vvv" is used, the raw OpenFlow data is also printed in 35 | hex and ASCII. 36 | -------------------------------------------------------------------------------- /third-party/automake.mk: -------------------------------------------------------------------------------- 1 | EXTRA_DIST += \ 2 | third-party/README \ 3 | third-party/ofp-tcpdump.patch 4 | -------------------------------------------------------------------------------- /tutorial/.gitignore: -------------------------------------------------------------------------------- 1 | sandbox/ 2 | -------------------------------------------------------------------------------- /tutorial/automake.mk: -------------------------------------------------------------------------------- 1 | EXTRA_DIST += \ 2 | tutorial/Tutorial \ 3 | tutorial/ovs-sandbox \ 4 | tutorial/t-setup \ 5 | tutorial/t-stage0 \ 6 | tutorial/t-stage1 \ 7 | tutorial/t-stage2 \ 8 | tutorial/t-stage3 \ 9 | tutorial/t-stage4 10 | 11 | sandbox: all 12 | cd $(srcdir)/tutorial && MAKE=$(MAKE) ./ovs-sandbox -b $(abs_builddir) 13 | -------------------------------------------------------------------------------- /tutorial/t-setup: -------------------------------------------------------------------------------- 1 | #! /bin/sh -ve 2 | 3 | ovs-vsctl add-br br0 -- set Bridge br0 fail-mode=secure 4 | 5 | for i in 1 2 3 4; do 6 | ovs-vsctl add-port br0 p$i -- set Interface p$i ofport_request=$i 7 | ovs-ofctl mod-port br0 p$i up 8 | done 9 | -------------------------------------------------------------------------------- /tutorial/t-stage0: -------------------------------------------------------------------------------- 1 | #! /bin/sh -ve 2 | 3 | ovs-ofctl add-flow br0 \ 4 | "table=0, dl_src=01:00:00:00:00:00/01:00:00:00:00:00, actions=drop" 5 | 6 | ovs-ofctl add-flow br0 \ 7 | "table=0, dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0, actions=drop" 8 | 9 | ovs-ofctl add-flow br0 "table=0, priority=0, actions=resubmit(,1)" 10 | -------------------------------------------------------------------------------- /tutorial/t-stage1: -------------------------------------------------------------------------------- 1 | #! /bin/sh -ve 2 | 3 | ovs-ofctl add-flow br0 "table=1, priority=0, actions=drop" 4 | 5 | ovs-ofctl add-flow br0 \ 6 | "table=1, priority=99, in_port=1, actions=resubmit(,2)" 7 | 8 | ovs-ofctl add-flows br0 - <<'EOF' 9 | table=1, priority=99, in_port=2, vlan_tci=0, actions=mod_vlan_vid:20, resubmit(,2) 10 | table=1, priority=99, in_port=3, vlan_tci=0, actions=mod_vlan_vid:30, resubmit(,2) 11 | table=1, priority=99, in_port=4, vlan_tci=0, actions=mod_vlan_vid:30, resubmit(,2) 12 | EOF 13 | -------------------------------------------------------------------------------- /tutorial/t-stage2: -------------------------------------------------------------------------------- 1 | #! /bin/sh -ve 2 | 3 | ovs-ofctl add-flow br0 \ 4 | "table=2 actions=learn(table=10, NXM_OF_VLAN_TCI[0..11], \ 5 | NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \ 6 | load:NXM_OF_IN_PORT[]->NXM_NX_REG0[0..15]), \ 7 | resubmit(,3)" 8 | -------------------------------------------------------------------------------- /tutorial/t-stage3: -------------------------------------------------------------------------------- 1 | #! /bin/sh -ve 2 | 3 | ovs-ofctl add-flow br0 \ 4 | "table=3 priority=50 actions=resubmit(,10), resubmit(,4)" 5 | 6 | ovs-ofctl add-flow br0 \ 7 | "table=3 priority=99 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 \ 8 | actions=resubmit(,4)" 9 | -------------------------------------------------------------------------------- /tutorial/t-stage4: -------------------------------------------------------------------------------- 1 | #! /bin/sh -ve 2 | 3 | ovs-ofctl add-flow br0 "table=4 reg0=1 actions=1" 4 | 5 | ovs-ofctl add-flows br0 - <<'EOF' 6 | table=4 reg0=2 actions=strip_vlan,2 7 | table=4 reg0=3 actions=strip_vlan,3 8 | table=4 reg0=4 actions=strip_vlan,4 9 | EOF 10 | 11 | ovs-ofctl add-flows br0 - <<'EOF' 12 | table=4 reg0=0 priority=99 dl_vlan=20 actions=1,strip_vlan,2 13 | table=4 reg0=0 priority=99 dl_vlan=30 actions=1,strip_vlan,3,4 14 | table=4 reg0=0 priority=50 actions=1 15 | EOF 16 | -------------------------------------------------------------------------------- /utilities/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /nlmon 4 | /ovs-appctl 5 | /ovs-appctl.8 6 | /ovs-benchmark 7 | /ovs-benchmark.1 8 | /ovs-cfg-mod 9 | /ovs-cfg-mod.8 10 | /ovs-check-dead-ifs 11 | /ovs-testcontroller 12 | /ovs-testcontroller.8 13 | /ovs-ctl 14 | /ovs-dpctl 15 | /ovs-dpctl.8 16 | /ovs-dpctl-top 17 | /ovs-dpctl-top.8 18 | /ovs-l3ping 19 | /ovs-l3ping.8 20 | /ovs-lib 21 | /ovs-ofctl 22 | /ovs-ofctl.8 23 | /ovs-parse-backtrace 24 | /ovs-pcap 25 | /ovs-pcap.1 26 | /ovs-pki 27 | /ovs-pki-cgi 28 | /ovs-pki.8 29 | /ovs-test 30 | /ovs-test.8 31 | /ovs-tcpundump 32 | /ovs-tcpundump.1 33 | /ovs-vlan-bug-workaround 34 | /ovs-vlan-bug-workaround.8 35 | /ovs-vlan-test 36 | /ovs-vlan-test.8 37 | /ovs-vsctl 38 | /ovs-vsctl.8 39 | -------------------------------------------------------------------------------- /utilities/bugtool/.gitignore: -------------------------------------------------------------------------------- 1 | /ovs-bugtool 2 | /ovs-bugtool.8 3 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-bfd-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2013 Nicira, Inc. 18 | 19 | ovs-appctl bfd/show 20 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-bond-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2012 Nicira, Inc. 18 | 19 | ovs-appctl bond/show 20 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-cfm-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2011 Nicira, Inc. 18 | 19 | ovs-appctl cfm/show 20 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-coverage-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2012 Nicira, Inc. 18 | 19 | ovs-appctl coverage/show 20 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-daemons-ver: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2012 Nicira, Inc. 18 | 19 | for f in `cd /var/run/openvswitch/; ls *.pid 2>/dev/null` 20 | do 21 | if [ -n "${f%.pid}" ]; then 22 | ovs-appctl -t "${f%.pid}" version 2>&1 23 | fi 24 | echo 25 | done 26 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-fdb-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2014 Nicira, Inc. 18 | 19 | for bridge in `ovs-vsctl -- --real list-br` 20 | do 21 | echo "ovs-appctl fdb/show ${bridge}" 22 | ovs-appctl fdb/show "${bridge}" 23 | echo "" 24 | done 25 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-lacp-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2011 Nicira, Inc. 18 | 19 | ovs-appctl lacp/show 20 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-list-dbs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2013 Nicira, Inc. 18 | 19 | ovs-appctl -t ovsdb-server ovsdb-server/list-dbs 20 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-memory-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2012 Nicira, Inc. 18 | 19 | ovs-appctl memory/show 20 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-ovs-appctl-dpif: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2013 Nicira, Inc. 18 | 19 | for bridge in `ovs-vsctl -- --real list-br` 20 | do 21 | echo "ovs-appctl dpif/show ${bridge}" 22 | ovs-appctl dpif/show "${bridge}" 23 | echo "ovs-appctl dpif/dump-flows ${bridge}" 24 | ovs-appctl dpif/dump-flows "$bridge" 25 | echo "" 26 | done 27 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-ovs-ofctl-dump-flows: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2013 Nicira, Inc. 18 | 19 | for bridge in `ovs-vsctl list-br` 20 | do 21 | echo "ovs-ofctl dump-flows ${bridge}" 22 | ovs-ofctl dump-flows "$bridge" 23 | echo "" 24 | done 25 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-ovs-ofctl-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2013 Nicira, Inc. 18 | 19 | for bridge in `ovs-vsctl list-br` 20 | do 21 | echo "ovs-ofctl show ${bridge}" 22 | ovs-ofctl show "$bridge" 23 | echo "" 24 | done 25 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-ovsdb-dump: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2011 Nicira, Inc. 18 | 19 | ovsdb-client -f csv dump unix:/var/run/openvswitch/db.sock Open_vSwitch 20 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-tc-class-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2011 Nicira, Inc. 18 | 19 | for iface in $(cd /sys/class/net && echo *); do 20 | if [ -d /sys/class/net/$iface ]; then 21 | echo Interface $iface: 22 | # indent tc output so it's clear which interface it pertains to 23 | /sbin/tc -s -d class show dev $iface | /bin/sed 's/^/ /' 24 | fi 25 | done 26 | -------------------------------------------------------------------------------- /utilities/bugtool/ovs-bugtool-vsctl-show: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of version 2.1 of the GNU Lesser General 5 | # Public License as published by the Free Software Foundation. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 | # USA 16 | # 17 | # Copyright (C) 2012, 2013 Nicira, Inc. 18 | 19 | ovs-vsctl show 20 | -------------------------------------------------------------------------------- /utilities/bugtool/plugins/kernel-info/openvswitch.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | /proc/slabinfo 22 | 23 | 24 | -------------------------------------------------------------------------------- /utilities/bugtool/plugins/system-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 22 | -------------------------------------------------------------------------------- /utilities/bugtool/plugins/system-configuration/openvswitch.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | date --rfc-3339=seconds 21 | /usr/share/openvswitch/scripts/ovs-bugtool-daemons-ver 22 | 23 | -------------------------------------------------------------------------------- /utilities/bugtool/plugins/system-logs/openvswitch.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | /etc/openvswitch 21 | /var/lib/openvswitch 22 | 23 | -------------------------------------------------------------------------------- /utilities/ovs-parse-backtrace.8: -------------------------------------------------------------------------------- 1 | .TH ovs\-parse\-backtrace 8 "October 2012" "Open vSwitch" "Open vSwitch Manual" 2 | . 3 | .SH NAME 4 | ovs\-parse\-backtrace \- parses ovs-appctl backtrace output 5 | . 6 | .SH SYNOPSIS 7 | \fBovs\-appctl backtrace\fR | \fBovs\-parse\-backtrace\fR [\fIbinary\fR] 8 | .P 9 | \fBovs\-parse\-backtrace\fR [\fIbinary\fR] < \fIbacktrace\fR 10 | . 11 | .SH DESCRIPTION 12 | In some configurations, many Open vSwitch daemons can produce a series of 13 | backtraces using the \fBovs\-appctl backtrace\fR command. Users can analyze 14 | these backtraces to figure out what the given Open vSwitch daemon may be 15 | spending most of its time doing. \fBovs\-parse\-backtrace\fR makes this output 16 | easier to interpret. 17 | .PP 18 | The \fBovs\-appctl backtrace\fR output must be supplied on standard input. The 19 | binary that produced the output should be supplied as the sole non-option 20 | argument. For best results, the binary should have debug symbols. 21 | . 22 | .SH OPTIONS 23 | .TP 24 | \fB\-\-help\fR 25 | Prints a usage message and exits. 26 | .P 27 | \fB\-\-version\fR 28 | Prints the version and exits. 29 | -------------------------------------------------------------------------------- /utilities/ovs-pcap.1.in: -------------------------------------------------------------------------------- 1 | .TH ovs\-pcap 1 "@VERSION@" "Open vSwitch" "Open vSwitch Manual" 2 | . 3 | .SH NAME 4 | ovs\-pcap \- print packets from a pcap file as hex 5 | . 6 | .SH SYNOPSIS 7 | \fBovs\-pcap\fR \fIfile\fR 8 | .so lib/common-syn.man 9 | . 10 | .SH DESCRIPTION 11 | The \fBovs\-pcap\fR program reads the pcap \fIfile\fR named on the 12 | command line and prints each packet's contents as a sequence of hex 13 | digits on a line of its own. This format is suitable for use with the 14 | \fBofproto/trace\fR command supported by \fBovs\-vswitchd\fR(8). 15 | . 16 | .SH "OPTIONS" 17 | .so lib/common.man 18 | . 19 | .SH "SEE ALSO" 20 | . 21 | .BR ovs\-vswitchd (8), 22 | .BR ovs\-tcpundump (1), 23 | .BR tcpdump (8), 24 | .BR wireshark (8). 25 | -------------------------------------------------------------------------------- /utilities/ovs-tcpundump.1.in: -------------------------------------------------------------------------------- 1 | .TH ovs\-tcpundump 1 "@VERSION@" "Open vSwitch" "Open vSwitch Manual" 2 | . 3 | .SH NAME 4 | ovs\-tcpundump \- convert ``tcpdump \-xx'' output to hex strings 5 | . 6 | .SH SYNOPSIS 7 | \fBovs\-tcpundump < \fIfile\fR 8 | .so lib/common-syn.man 9 | . 10 | .SH DESCRIPTION 11 | The \fBovs\-tcpundump\fR program reads \fBtcpdump \-xx\fR output on 12 | stdin, looking for hexadecimal packet data, and dumps each Ethernet as 13 | a single hexadecimal string on stdout. This format is suitable for 14 | use with the \fBofproto/trace\fR command supported by 15 | \fBovs\-vswitchd\fR(8) 16 | via \fBovs\-appctl\fR(8). 17 | .PP 18 | At least two \fB\-x\fR or \fB\-X\fR options must be given, otherwise 19 | the output will omit the Ethernet header, which prevents the output 20 | from being using with \fBofproto/trace\fR. 21 | . 22 | .SH "OPTIONS" 23 | .so lib/common.man 24 | . 25 | .SH "SEE ALSO" 26 | . 27 | .BR ovs\-appctl (8), 28 | .BR ovs\-vswitchd (8), 29 | .BR ovs\-pcap (1), 30 | .BR tcpdump (8), 31 | .BR wireshark (8). 32 | -------------------------------------------------------------------------------- /utilities/ovs-vlan-bugs.man: -------------------------------------------------------------------------------- 1 | .IP \(bu 2 | When NICs use VLAN stripping on receive they must pass a pointer to a 3 | \fBvlan_group\fR when reporting the stripped tag to the networking 4 | core. If no \fBvlan_group\fR is in use then some drivers just drop 5 | the extracted tag. Drivers are supposed to only enable stripping if a 6 | \fBvlan_group\fR is registered but not all of them do that. 7 | . 8 | .IP \(bu 9 | On receive, some drivers handle priority tagged packets specially and 10 | don't pass the tag onto the network stack at all, so Open vSwitch 11 | never has a chance to see it. 12 | . 13 | .IP \(bu 14 | Some drivers size their receive buffers based on whether a 15 | \fBvlan_group\fR is enabled, meaning that a maximum size packet with a 16 | VLAN tag will not fit if no \fBvlan_group\fR is configured. 17 | . 18 | .IP \(bu 19 | On transmit, some drivers expect that VLAN acceleration will be used 20 | if it is available, which can only be done if a \fBvlan_group\fR is 21 | configured. In these cases, the driver may fail to parse the packet 22 | and correctly setup checksum offloading or TSO. 23 | -------------------------------------------------------------------------------- /vswitchd/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /ovs-vswitchd 4 | /ovs-vswitchd.8 5 | /ovs-vswitchd.conf.db.5 6 | /vswitch.ovsschema.stamp 7 | /vswitch.gv 8 | /vswitch.pic 9 | -------------------------------------------------------------------------------- /vswitchd/bridge.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2014 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef VSWITCHD_BRIDGE_H 17 | #define VSWITCHD_BRIDGE_H 1 18 | 19 | struct simap; 20 | 21 | void bridge_init(const char *remote); 22 | void bridge_exit(void); 23 | 24 | void bridge_run(void); 25 | void bridge_wait(void); 26 | 27 | void bridge_get_memory_usage(struct simap *usage); 28 | 29 | #endif /* bridge.h */ 30 | -------------------------------------------------------------------------------- /vswitchd/system-stats.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010, 2012 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef VSWITCHD_SYSTEM_STATS 17 | #define VSWITCHD_SYSTEM_STATS 1 18 | 19 | #include 20 | 21 | void system_stats_enable(bool enable); 22 | struct smap *system_stats_run(void); 23 | void system_stats_wait(void); 24 | 25 | #endif /* vswitchd/system-stats.h */ 26 | -------------------------------------------------------------------------------- /vswitchd/xenserver.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Nicira, Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef VSWITCHD_XENSERVER_H 17 | #define VSWITCHD_XENSERVER_H 1 18 | 19 | const char *xenserver_get_host_uuid(void); 20 | 21 | #endif /* xenserver.h */ 22 | -------------------------------------------------------------------------------- /vtep/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /vtep-ctl 4 | /vtep-ctl.8 5 | /vtep.5 6 | /vtep.gv 7 | /vtep.ovsschema.stamp 8 | /vtep.pic 9 | -------------------------------------------------------------------------------- /xenserver/.gitignore: -------------------------------------------------------------------------------- 1 | /openvswitch-xen.spec 2 | -------------------------------------------------------------------------------- /xenserver/etc_logrotate.d_openvswitch: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. 2 | # 3 | # Copying and distribution of this file, with or without modification, 4 | # are permitted in any medium without royalty provided the copyright 5 | # notice and this notice are preserved. This file is offered as-is, 6 | # without warranty of any kind. 7 | 8 | /var/log/openvswitch/*.log { 9 | daily 10 | compress 11 | sharedscripts 12 | missingok 13 | postrotate 14 | # Tell Open vSwitch daemons to reopen their log files 15 | for pidfile in `cd /var/run/openvswitch && echo *.pid`; do 16 | ovs-appctl -t "${pidfile%%.pid}" vlog/reopen 17 | done 18 | endscript 19 | } 20 | -------------------------------------------------------------------------------- /xenserver/etc_profile.d_openvswitch.sh: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009, 2010, 2011 Nicira, Inc. 2 | # 3 | # Copying and distribution of this file, with or without modification, 4 | # are permitted in any medium without royalty provided the copyright 5 | # notice and this notice are preserved. This file is offered as-is, 6 | # without warranty of any kind. 7 | 8 | alias vswitch='service openvswitch' 9 | alias openvswitch='service openvswitch' 10 | 11 | function watchdp { 12 | watch ovs-dpctl show "$@" 13 | } 14 | 15 | function watchdpflows { 16 | local grep="" 17 | local dp=$1 18 | shift 19 | if [ $# -gt 0 ]; then 20 | grep="| grep $@" 21 | fi 22 | watch "ovs-dpctl dump-flows $dp $grep" 23 | } 24 | 25 | function watchflows { 26 | local grep="" 27 | local dp=$1 28 | shift 29 | bridge=$(ovs-dpctl show $dp | grep 'port 0:' | cut -d' ' -f 3) 30 | if [ $# -gt 0 ]; then 31 | grep="| grep $@" 32 | fi 33 | watch "ovs-ofctl dump-flows unix:/var/run/$bridge.mgmt $grep" 34 | } 35 | 36 | function monitorlogs { 37 | local grep="" 38 | if [ $# -gt 0 ]; then 39 | grep="| grep --line-buffered '^==> .* <==$" 40 | for i in "$@"; do 41 | grep="$grep\|$i" 42 | done 43 | grep="$grep'" 44 | fi 45 | cmd="tail -F /var/log/messages /var/log/openvswitch/ovs-vswitchd.log /var/log/openvswitch/ovsdb-server /var/log/xensource.log $grep | tee /var/log/monitorlogs.out" 46 | printf "cmd: $cmd\n" 47 | eval "$cmd" 48 | } 49 | -------------------------------------------------------------------------------- /xenserver/usr_share_openvswitch_scripts_sysconfig.template: -------------------------------------------------------------------------------- 1 | ### Configuration options for openvswitch 2 | 3 | # Copyright (C) 2009, 2010, 2011 Nicira, Inc. 4 | 5 | # FORCE_COREFILES: If 'yes' then core files will be enabled. 6 | # FORCE_COREFILES=yes 7 | 8 | # OVSDB_SERVER_PRIORITY: "nice" priority at which to run ovsdb-server. 9 | # 10 | # OVSDB_SERVER_PRIORITY=-10 11 | 12 | # VSWITCHD_PRIORITY: "nice" priority at which to run ovs-vswitchd. 13 | # VSWITCHD_PRIORITY=-10 14 | 15 | # VSWITCHD_MLOCKALL: Whether to pass ovs-vswitchd the --mlockall option. 16 | # This option should be set to "yes" or "no". The default is "yes". 17 | # Enabling this option can avoid networking interruptions due to 18 | # system memory pressure in extraordinary situations, such as multiple 19 | # concurrent VM import operations. 20 | # VSWITCHD_MLOCKALL=yes 21 | 22 | # OVS_CTL_OPTS: Extra options to pass to ovs-ctl. This is, for example, 23 | # a suitable place to specify --ovs-vswitchd-wrapper=valgrind. 24 | # OVS_CTL_OPTS= 25 | --------------------------------------------------------------------------------