├── debian ├── compat ├── dirs ├── openflow-common.dirs ├── openflow-controller.dirs ├── openflow-pki-server.dirs ├── openflow-switch-config.dirs ├── openflow-switch-config.manpages ├── openflow-controller.manpages ├── openflow-switch-config.overrides ├── openflow-controller.install ├── openflow-switch-config.install ├── openflow-datapath-source.dirs ├── openflow-switch.dirs ├── openflow-pki-server.apache2 ├── openflow-pki-server.install ├── po │ └── POTFILES.in ├── commands │ └── update ├── openflow-common.manpages ├── openflow-common.install ├── corekeeper.cron.daily ├── openflow-switch.manpages ├── openflow-switch.install ├── openflow-switch.logrotate ├── openflow-datapath-source.install ├── openflow-controller.README.Debian ├── openflow-datapath-source.copyright ├── openflow-datapath-module-_KVERS_.postinst.modules.in ├── changelog ├── control.modules.in ├── openflow-switch.README.Debian ├── .gitignore ├── openflow-datapath-source.README.Debian ├── openflow-switch.postrm ├── openflow-pki.postinst ├── openflow-controller.default ├── openflow-pki-server.postinst └── ofp-switch-setup.8 ├── include ├── .gitignore ├── automake.mk └── openflow │ └── automake.mk ├── third-party ├── .gitignore ├── automake.mk └── README ├── lib ├── .gitignore ├── common.man ├── dhparams.h ├── leak-checker.man ├── dh1024.pem ├── dh2048.pem ├── daemon.man └── dh4096.pem ├── utilities ├── wireshark_dissectors │ ├── openflow │ │ ├── .gitignore │ │ ├── moduleinfo.h │ │ ├── Makefile.common │ │ └── plugin.c │ ├── wireshark-1.0.0-includes │ │ ├── svnversion.h │ │ ├── epan │ │ │ ├── dfilter │ │ │ │ ├── glib-util.h │ │ │ │ ├── scanner_lex.h │ │ │ │ ├── gencode.h │ │ │ │ ├── semcheck.h │ │ │ │ └── grammar.h │ │ │ ├── diam_dict_lex.h │ │ │ ├── radius_dict_lex.h │ │ │ ├── uat_load_lex.h │ │ │ ├── dtd_parse_lex.h │ │ │ ├── dtd_preparse_lex.h │ │ │ ├── crcdrm.h │ │ │ ├── in_cksum.h │ │ │ ├── g_ascii_strtoull.h │ │ │ ├── g_ascii_strcasecmp.h │ │ │ ├── crypt │ │ │ │ ├── crypt-md4.h │ │ │ │ ├── crypt-des.h │ │ │ │ └── crypt-rc4.h │ │ │ ├── crc6.h │ │ │ ├── crc10.h │ │ │ ├── dtd_grammar.h │ │ │ ├── inet_aton.h │ │ │ ├── t35.h │ │ │ ├── base64.h │ │ │ ├── bitswap.h │ │ │ ├── stat_cmd_args.h │ │ │ └── adler32.h │ │ ├── wiretap │ │ │ ├── k12text_lex.h │ │ │ ├── ascend-scanner_lex.h │ │ │ ├── ber.h │ │ │ ├── hcidump.h │ │ │ ├── pppdump.h │ │ │ ├── csids.h │ │ │ ├── vms.h │ │ │ ├── radcom.h │ │ │ ├── toshiba.h │ │ │ ├── eyesdn.h │ │ │ ├── iptrace.h │ │ │ ├── iseries.h │ │ │ ├── i4btrace.h │ │ │ ├── airopeek9.h │ │ │ ├── etherpeek.h │ │ │ ├── dbs-etherwatch.h │ │ │ ├── mpeg.h │ │ │ ├── snoop.h │ │ │ ├── netmon.h │ │ │ ├── 5views.h │ │ │ ├── cosine.h │ │ │ ├── pcapng.h │ │ │ ├── btsnoop.h │ │ │ ├── ngsniffer.h │ │ │ ├── ascend.h │ │ │ ├── k12.h │ │ │ ├── commview.h │ │ │ ├── catapult_dct2000.h │ │ │ ├── netxray.h │ │ │ └── visual.h │ │ ├── capture-wpcap.h │ │ ├── strerror.h │ │ ├── g711.h │ │ ├── strptime.h │ │ ├── mkstemp.h │ │ ├── capture_stop_conditions.h │ │ ├── globals.h │ │ ├── ps.h │ │ ├── capture_errs.h │ │ └── clopts_common.h │ ├── README │ └── Makefile ├── .gitignore ├── ofp-pki-cgi.in └── automake.mk ├── controller ├── .gitignore └── automake.mk ├── regress ├── bin │ ├── veth_teardown.pl │ ├── eth.map │ ├── nf2.map │ ├── veth.map │ ├── of_hp_eth.map │ ├── of_ovs_eth.map │ ├── veth_setup.pl │ ├── of_nf2_teardown.pl │ ├── of_kmod_teardown.pl │ ├── of_user_teardown.pl │ ├── of_kmod_setup.pl │ ├── of_kmod_veth_teardown.pl │ ├── of_user_setup.pl │ ├── of_user_veth_teardown.pl │ ├── of_nf2_setup.pl │ ├── of_kmod_veth_setup.pl │ ├── of_user_veth_setup.pl │ ├── of_kmod_test.pl │ ├── of_user_test.pl │ ├── of_kmod_veth_test.pl │ ├── of_user_veth_test.pl │ ├── of_nf2_test.pl │ ├── of_ovs_user_teardown.pl │ └── of_hp_teardown.pl ├── projects │ ├── regress.txt │ ├── controller_disconnect │ │ └── regress │ │ │ ├── tests.txt │ │ │ └── common │ │ │ ├── teardown │ │ │ └── setup │ ├── black_box │ │ └── regress │ │ │ ├── test_hello │ │ │ └── run.pl │ │ │ ├── test_forward_any_port │ │ │ └── run.pl │ │ │ ├── test_forward_exact_arp_all │ │ │ └── run.pl │ │ │ ├── test_forward_exact_icmp_all │ │ │ └── run.pl │ │ │ ├── test_forward_exact_arp_fool │ │ │ └── run.pl │ │ │ ├── test_forward_exact_arp_port │ │ │ └── run.pl │ │ │ ├── test_forward_exact_icmp_fool │ │ │ └── run.pl │ │ │ ├── test_forward_exact_icmp_port │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_arp_all │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_arp_fool │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_icmp_all │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_icmp_fool │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_arp_port │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_icmp_port │ │ │ └── run.pl │ │ │ ├── test_forward_exact_arp_controller │ │ │ └── run.pl │ │ │ ├── test_forward_exact_icmp_controller │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_arp_controller │ │ │ └── run.pl │ │ │ ├── test_queue_forward │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_icmp_controller │ │ │ └── run.pl │ │ │ ├── test_forward_exact_all │ │ │ └── run.pl │ │ │ ├── test_forward_exact_port │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_controller │ │ │ └── run.pl │ │ │ ├── test_forward_exact_controller │ │ │ └── run.pl │ │ │ ├── test_flow_expired │ │ │ └── run.pl │ │ │ ├── test_flow_expired_idle_timeout │ │ │ └── run.pl │ │ │ ├── common │ │ │ ├── setup │ │ │ └── teardown │ │ │ ├── test_cookie_flow_expired │ │ │ └── run.pl │ │ │ ├── test_forward_wildcard_modify_action │ │ │ └── run.pl │ │ │ ├── test_switch_config │ │ │ └── run.pl │ │ │ ├── test_add_flow_latency │ │ │ └── run.pl │ │ │ ├── test_forward_exact_modify_action │ │ │ └── run.pl │ │ │ ├── test_flow_expired_send_flow_exp │ │ │ └── run.pl │ │ │ └── test_packet_in │ │ │ └── run.pl │ └── learning_switch │ │ └── regress │ │ ├── tests.txt │ │ ├── test_unicast_unknown │ │ └── run.pl │ │ ├── common │ │ ├── setup │ │ └── teardown │ │ └── test_broadcast │ │ └── run.pl ├── scripts │ ├── copy_NF2_code.sh │ ├── env_vars │ └── install_perlmods_apt.pl ├── lib │ └── Perl5 │ │ ├── OF │ │ ├── Includes.pm │ │ └── Base.pm │ │ └── Test │ │ └── Base.pm └── CREDITS ├── udatapath └── .gitignore ├── secchan ├── commands │ ├── reboot │ └── automake.mk ├── .gitignore └── automake.mk ├── tests ├── test-stp-iol-op-1.1 ├── test-stp-iol-op-1.4 ├── test-stp-iol-op-3.1 ├── test-stp-iol-op-3.3 ├── test-stp-iol-op-3.4 ├── .gitignore ├── test-stp.sh ├── test-flows.sh ├── test-stp-ieee802.1d-1998 ├── test-stp-ieee802.1d-2004-fig17.6 ├── test-stp-iol-io-1.4 ├── test-stp-iol-io-1.2 ├── test-stp-ieee802.1d-2004-fig17.7 ├── test-stp-iol-io-1.1 ├── test-stp-ieee802.1d-2004-fig17.4 └── test-stp-iol-io-1.5 ├── datapath ├── .gitignore ├── hwtable_nf2 │ ├── openflow_switch.bit │ └── Modules.mk ├── compat.h ├── hwtable_dummy │ └── Modules.mk ├── linux-2.6 │ ├── Makefile.in │ ├── compat-2.6 │ │ ├── include │ │ │ ├── linux │ │ │ │ ├── netdevice.h │ │ │ │ ├── ipv6.h │ │ │ │ ├── icmp.h │ │ │ │ ├── rculist.h │ │ │ │ ├── types.h │ │ │ │ ├── udp.h │ │ │ │ ├── random.h │ │ │ │ ├── if_arp.h │ │ │ │ ├── ip.h │ │ │ │ ├── tcp.h │ │ │ │ ├── netfilter_ipv4.h │ │ │ │ ├── netfilter_bridge.h │ │ │ │ ├── netlink.h │ │ │ │ ├── jiffies.h │ │ │ │ └── workqueue.h │ │ │ ├── net │ │ │ │ ├── checksum.h │ │ │ │ └── netlink.h │ │ │ └── asm-generic │ │ │ │ └── bug.h │ │ ├── genetlink-brcompat.c │ │ ├── genetlink-openflow.c │ │ └── compat26.h │ ├── .gitignore │ ├── Kbuild.in │ └── Modules.mk ├── dp_act.h ├── dp_dev.h ├── crc32.h ├── Makefile.am ├── dp_notify.c ├── crc32.c ├── Modules.mk ├── forward.h └── chain.h ├── doc └── of-spec │ ├── .gitignore │ ├── openflow-spec-v1.0.0.tex │ ├── packet_flow_flowchart.pdf │ ├── header_parsing_flowchart.pdf │ ├── figure_flow_table_secchan.png │ ├── README │ ├── credits.tex │ └── Makefile ├── hw-lib ├── skeleton │ ├── txrx.h │ ├── os.h │ ├── of_hw_platform.h │ └── sample_plat.h ├── automake.mk └── nf2 │ └── nf2util.h ├── boot.sh ├── .gitignore ├── soexpand.pl └── README.kernel /debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/sbin 3 | -------------------------------------------------------------------------------- /debian/openflow-common.dirs: -------------------------------------------------------------------------------- 1 | var/log/openflow 2 | -------------------------------------------------------------------------------- /include/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | -------------------------------------------------------------------------------- /third-party/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | -------------------------------------------------------------------------------- /debian/openflow-controller.dirs: -------------------------------------------------------------------------------- 1 | etc/openflow-controller 2 | -------------------------------------------------------------------------------- /debian/openflow-pki-server.dirs: -------------------------------------------------------------------------------- 1 | etc/apache2/sites-available 2 | -------------------------------------------------------------------------------- /include/automake.mk: -------------------------------------------------------------------------------- 1 | include include/openflow/automake.mk 2 | -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /dhparams.c 4 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/openflow/.gitignore: -------------------------------------------------------------------------------- 1 | *.tgz 2 | -------------------------------------------------------------------------------- /debian/openflow-switch-config.dirs: -------------------------------------------------------------------------------- 1 | /usr/share/lintian/overrides 2 | -------------------------------------------------------------------------------- /debian/openflow-switch-config.manpages: -------------------------------------------------------------------------------- 1 | debian/ofp-switch-setup.8 2 | -------------------------------------------------------------------------------- /debian/openflow-controller.manpages: -------------------------------------------------------------------------------- 1 | _debian/controller/controller.8 2 | -------------------------------------------------------------------------------- /debian/openflow-switch-config.overrides: -------------------------------------------------------------------------------- 1 | debconf-is-not-a-registry 2 | -------------------------------------------------------------------------------- /debian/openflow-controller.install: -------------------------------------------------------------------------------- 1 | _debian/controller/controller usr/sbin 2 | -------------------------------------------------------------------------------- /debian/openflow-switch-config.install: -------------------------------------------------------------------------------- 1 | debian/ofp-switch-setup usr/sbin 2 | -------------------------------------------------------------------------------- /debian/openflow-datapath-source.dirs: -------------------------------------------------------------------------------- 1 | usr/src/modules/openflow-datapath/debian 2 | -------------------------------------------------------------------------------- /debian/openflow-switch.dirs: -------------------------------------------------------------------------------- 1 | /etc/openflow-switch 2 | /usr/share/openflow/switch 3 | -------------------------------------------------------------------------------- /controller/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /controller 4 | /controller.8 5 | -------------------------------------------------------------------------------- /debian/openflow-pki-server.apache2: -------------------------------------------------------------------------------- 1 | Alias /openflow/pki/ /usr/share/openflow/pki/ 2 | -------------------------------------------------------------------------------- /debian/openflow-pki-server.install: -------------------------------------------------------------------------------- 1 | _debian/utilities/ofp-pki-cgi usr/lib/cgi-bin 2 | -------------------------------------------------------------------------------- /debian/po/POTFILES.in: -------------------------------------------------------------------------------- 1 | [type: gettext/rfc822deb] openflow-switch-config.templates 2 | -------------------------------------------------------------------------------- /regress/bin/veth_teardown.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | `/sbin/rmmod veth`; 4 | 5 | -------------------------------------------------------------------------------- /regress/projects/regress.txt: -------------------------------------------------------------------------------- 1 | black_box 2 | controller_disconnect 3 | learning_switch 4 | -------------------------------------------------------------------------------- /udatapath/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /ofdatapath 4 | /ofdatapath.8 5 | -------------------------------------------------------------------------------- /debian/commands/update: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | set -e 3 | apt-get update -qy 4 | apt-get upgrade -qy 5 | -------------------------------------------------------------------------------- /debian/openflow-common.manpages: -------------------------------------------------------------------------------- 1 | _debian/utilities/vlogconf.8 2 | _debian/utilities/ofp-pki.8 3 | -------------------------------------------------------------------------------- /secchan/commands/reboot: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | ofp-kill --force --signal=USR1 ofp-switchui.pid 3 | reboot 4 | -------------------------------------------------------------------------------- /tests/test-stp-iol-op-1.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/tests/test-stp-iol-op-1.1 -------------------------------------------------------------------------------- /tests/test-stp-iol-op-1.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/tests/test-stp-iol-op-1.4 -------------------------------------------------------------------------------- /tests/test-stp-iol-op-3.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/tests/test-stp-iol-op-3.1 -------------------------------------------------------------------------------- /tests/test-stp-iol-op-3.3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/tests/test-stp-iol-op-3.3 -------------------------------------------------------------------------------- /tests/test-stp-iol-op-3.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/tests/test-stp-iol-op-3.4 -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/svnversion.h: -------------------------------------------------------------------------------- 1 | /* #define SVNVERSION "" */ 2 | -------------------------------------------------------------------------------- /datapath/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | *.cmd 4 | *.ko 5 | *.mod.c 6 | Module.symvers 7 | 8 | -------------------------------------------------------------------------------- /third-party/automake.mk: -------------------------------------------------------------------------------- 1 | EXTRA_DIST += \ 2 | third-party/README \ 3 | third-party/ofp-tcpdump.patch 4 | -------------------------------------------------------------------------------- /doc/of-spec/.gitignore: -------------------------------------------------------------------------------- 1 | /*.aux 2 | /*.log 3 | /*.out 4 | /*.pdf 5 | /*.ps 6 | /define 7 | /enum 8 | /struct 9 | -------------------------------------------------------------------------------- /regress/projects/controller_disconnect/regress/tests.txt: -------------------------------------------------------------------------------- 1 | test_emergency_table/run.pl 2 | #test_reconnect/run.pl 3 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /test-list 4 | /test-dhcp-client 5 | /test-stp 6 | /test-type-props 7 | -------------------------------------------------------------------------------- /doc/of-spec/openflow-spec-v1.0.0.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/doc/of-spec/openflow-spec-v1.0.0.tex -------------------------------------------------------------------------------- /doc/of-spec/packet_flow_flowchart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/doc/of-spec/packet_flow_flowchart.pdf -------------------------------------------------------------------------------- /secchan/commands/automake.mk: -------------------------------------------------------------------------------- 1 | commandsdir = ${pkgdatadir}/commands 2 | dist_commands_SCRIPTS = \ 3 | secchan/commands/reboot 4 | -------------------------------------------------------------------------------- /datapath/hwtable_nf2/openflow_switch.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/datapath/hwtable_nf2/openflow_switch.bit -------------------------------------------------------------------------------- /doc/of-spec/header_parsing_flowchart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/doc/of-spec/header_parsing_flowchart.pdf -------------------------------------------------------------------------------- /regress/bin/eth.map: -------------------------------------------------------------------------------- 1 | eth1:eth1 2 | eth2:eth2 3 | eth3:eth3 4 | eth4:eth4 5 | eth5:eth5 6 | eth6:eth6 7 | eth7:eth7 8 | eth8:eth8 9 | -------------------------------------------------------------------------------- /doc/of-spec/figure_flow_table_secchan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noxrepo/openflow/HEAD/doc/of-spec/figure_flow_table_secchan.png -------------------------------------------------------------------------------- /regress/bin/nf2.map: -------------------------------------------------------------------------------- 1 | eth1:eth1 2 | eth2:eth2 3 | eth3:eth3 4 | eth4:eth4 5 | eth5:nf2c0 6 | eth6:nf2c1 7 | eth7:nf2c2 8 | eth8:nf2c3 9 | -------------------------------------------------------------------------------- /secchan/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /controller-lite 4 | /ctlpath-lite 5 | /dpctl-lite 6 | /ofprotocol 7 | /ofprotocol.8 8 | -------------------------------------------------------------------------------- /regress/bin/veth.map: -------------------------------------------------------------------------------- 1 | eth1:veth0 2 | eth2:veth2 3 | eth3:veth4 4 | eth4:veth6 5 | eth5:veth1 6 | eth6:veth3 7 | eth7:veth5 8 | eth8:veth7 9 | -------------------------------------------------------------------------------- /regress/bin/of_hp_eth.map: -------------------------------------------------------------------------------- 1 | eth1:eth10 2 | eth2:eth11 3 | eth3:eth12 4 | eth4:eth13 5 | eth5:eth10 6 | eth6:eth11 7 | eth7:eth12 8 | eth8:eth13 9 | -------------------------------------------------------------------------------- /debian/openflow-common.install: -------------------------------------------------------------------------------- 1 | _debian/utilities/ofp-parse-leaks usr/bin 2 | _debian/utilities/ofp-pki usr/sbin 3 | _debian/utilities/vlogconf usr/sbin 4 | -------------------------------------------------------------------------------- /debian/corekeeper.cron.daily: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 4 | 5 | tmpreaper 7d --mtime --all /var/log/core 6 | -------------------------------------------------------------------------------- /debian/openflow-switch.manpages: -------------------------------------------------------------------------------- 1 | _debian/secchan/ofprotocol.8 2 | _debian/utilities/ofp-discover.8 3 | _debian/utilities/ofp-kill.8 4 | _debian/utilities/dpctl.8 5 | -------------------------------------------------------------------------------- /regress/bin/of_ovs_eth.map: -------------------------------------------------------------------------------- 1 | eth1:eth10.91 2 | eth2:eth10.92 3 | eth3:eth10.93 4 | eth4:eth10.94 5 | eth5:eth11.91 6 | eth6:eth11.92 7 | eth7:eth11.93 8 | eth8:eth11.94 9 | -------------------------------------------------------------------------------- /tests/test-stp.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | set -e 3 | progress= 4 | for d in ${stp_files}; do 5 | echo "Testing $d..." 6 | $SUPERVISOR ./tests/test-stp ${srcdir}/$d 7 | done 8 | -------------------------------------------------------------------------------- /lib/common.man: -------------------------------------------------------------------------------- 1 | .TP 2 | .BR \-h ", " \-\^\-help 3 | Prints a brief help message to the console. 4 | 5 | .TP 6 | .BR \-V ", " \-\^\-version 7 | Prints version information to the console. 8 | -------------------------------------------------------------------------------- /include/openflow/automake.mk: -------------------------------------------------------------------------------- 1 | noinst_HEADERS += \ 2 | include/openflow/nicira-ext.h \ 3 | include/openflow/private-ext.h \ 4 | include/openflow/openflow.h \ 5 | include/openflow/openflow-netlink.h 6 | -------------------------------------------------------------------------------- /doc/of-spec/README: -------------------------------------------------------------------------------- 1 | To build the latest OpenFlow specification, you should just be able to 2 | type "make". For this to work, you'll need to have the texinfo and 3 | "listings.sty" packages installed. 4 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/dfilter/glib-util.h: -------------------------------------------------------------------------------- 1 | /* $Id: glib-util.h 3992 2008-06-10 03:13:11Z dgu $ */ 2 | 3 | char* 4 | g_substrdup(const char *s, int start, int len); 5 | -------------------------------------------------------------------------------- /lib/dhparams.h: -------------------------------------------------------------------------------- 1 | #ifndef DHPARAMS_H 2 | #define DHPARAMS_H 1 3 | 4 | #include 5 | 6 | DH *get_dh1024(void); 7 | DH *get_dh2048(void); 8 | DH *get_dh4096(void); 9 | 10 | #endif /* dhparams.h */ 11 | -------------------------------------------------------------------------------- /regress/scripts/copy_NF2_code.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #last use of this script copied in files from NF2 SVN rev 3904 4 | #note: OFT_ROOT and NF2_ROOT must be set 5 | cp $NF2_ROOT/lib/Perl5/Test/* $OFT_ROOT/lib/Perl5/Test/ 6 | -------------------------------------------------------------------------------- /utilities/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /dpctl 4 | /dpctl.8 5 | /ofp-discover 6 | /ofp-discover.8 7 | /ofp-kill 8 | /ofp-kill.8 9 | /ofp-pki 10 | /ofp-pki-cgi 11 | /ofp-pki.8 12 | /vlogconf 13 | /vlogconf.8 14 | -------------------------------------------------------------------------------- /datapath/compat.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPAT_H 2 | #define COMPAT_H 1 3 | 4 | #include 5 | 6 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 7 | 8 | #include "compat26.h" 9 | 10 | #endif 11 | 12 | #endif /* compat.h */ 13 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/dfilter/scanner_lex.h: -------------------------------------------------------------------------------- 1 | /* This is generated by runlex.sh. Do not edit it. */ 2 | #define yylex df_lex 3 | #ifndef YY_DECL 4 | #define YY_DECL int yylex(void) 5 | #endif 6 | YY_DECL; 7 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/diam_dict_lex.h: -------------------------------------------------------------------------------- 1 | /* This is generated by runlex.sh. Do not edit it. */ 2 | #define yylex DiamDictlex 3 | #ifndef YY_DECL 4 | #define YY_DECL int yylex(void) 5 | #endif 6 | YY_DECL; 7 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/radius_dict_lex.h: -------------------------------------------------------------------------------- 1 | /* This is generated by runlex.sh. Do not edit it. */ 2 | #define yylex Radiuslex 3 | #ifndef YY_DECL 4 | #define YY_DECL int yylex(void) 5 | #endif 6 | YY_DECL; 7 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/uat_load_lex.h: -------------------------------------------------------------------------------- 1 | /* This is generated by runlex.sh. Do not edit it. */ 2 | #define yylex uat_load_lex 3 | #ifndef YY_DECL 4 | #define YY_DECL int yylex(void) 5 | #endif 6 | YY_DECL; 7 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/k12text_lex.h: -------------------------------------------------------------------------------- 1 | /* This is generated by runlex.sh. Do not edit it. */ 2 | #define yylex K12Text_lex 3 | #ifndef YY_DECL 4 | #define YY_DECL int yylex(void) 5 | #endif 6 | YY_DECL; 7 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/dtd_parse_lex.h: -------------------------------------------------------------------------------- 1 | /* This is generated by runlex.sh. Do not edit it. */ 2 | #define yylex Dtd_Parse_lex 3 | #ifndef YY_DECL 4 | #define YY_DECL int yylex(void) 5 | #endif 6 | YY_DECL; 7 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/ascend-scanner_lex.h: -------------------------------------------------------------------------------- 1 | /* This is generated by runlex.sh. Do not edit it. */ 2 | #define yylex ascendlex 3 | #ifndef YY_DECL 4 | #define YY_DECL int yylex(void) 5 | #endif 6 | YY_DECL; 7 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/dtd_preparse_lex.h: -------------------------------------------------------------------------------- 1 | /* This is generated by runlex.sh. Do not edit it. */ 2 | #define yylex Dtd_PreParse_lex 3 | #ifndef YY_DECL 4 | #define YY_DECL int yylex(void) 5 | #endif 6 | YY_DECL; 7 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/crcdrm.h: -------------------------------------------------------------------------------- 1 | #ifndef _CRCDRM_H 2 | 3 | #include 4 | 5 | unsigned long crc_drm(const char *data, size_t bytesize, 6 | unsigned short num_crc_bits, unsigned long crc_gen, int invert); 7 | #endif 8 | -------------------------------------------------------------------------------- /datapath/hwtable_dummy/Modules.mk: -------------------------------------------------------------------------------- 1 | # Specify the module to build. 2 | build_modules += ofdatapath_dummy 3 | dist_modules += ofdatapath_dummy 4 | 5 | # Specify the source files that comprise the module. 6 | ofdatapath_dummy_sources = \ 7 | hwtable_dummy/hwtable_dummy.c 8 | -------------------------------------------------------------------------------- /datapath/linux-2.6/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 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/dfilter/gencode.h: -------------------------------------------------------------------------------- 1 | #ifndef GENCODE_H 2 | #define GENCODE_H 3 | 4 | void 5 | dfw_gencode(dfwork_t *dfw); 6 | 7 | int* 8 | dfw_interesting_fields(dfwork_t *dfw, int *caller_num_fields); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /regress/bin/veth_setup.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | `/sbin/modprobe veth`; 4 | for (my $i = 0; $i < 4; $i++) { 5 | `/sbin/ip link add type veth`; 6 | } 7 | 8 | for (my $i = 0; $i < 8; $i++) { 9 | `sudo /sbin/ifconfig veth$i 192.168.1$i.1 netmask 255.255.255.0`; 10 | } 11 | -------------------------------------------------------------------------------- /lib/leak-checker.man: -------------------------------------------------------------------------------- 1 | .TP 2 | \fB--check-leaks=\fIfile\fR 3 | . 4 | Logs information about memory allocation and deallocation to 5 | \fIfile\fR, to allow for debugging memory leaks in \fB\*(PN\fR. This 6 | option slows down \fB\*(PN\fR considerably, so it should only be used 7 | when a memory leak is suspected. 8 | -------------------------------------------------------------------------------- /debian/openflow-switch.install: -------------------------------------------------------------------------------- 1 | _debian/secchan/ofprotocol usr/sbin 2 | _debian/utilities/dpctl usr/sbin 3 | _debian/utilities/ofp-discover usr/sbin 4 | _debian/utilities/ofp-kill usr/sbin 5 | debian/openflow/usr/share/openflow/commands/* usr/share/openflow/commands 6 | debian/commands/* usr/share/openflow/commands 7 | -------------------------------------------------------------------------------- /regress/lib/Perl5/OF/Includes.pm: -------------------------------------------------------------------------------- 1 | use Test::TestLib; 2 | use Test::PacketLib; 3 | 4 | use OF::Base; 5 | use OF::OFUtil; 6 | use OF::OFPacketLib; 7 | 8 | use IO::Socket; 9 | 10 | use Data::HexDump; 11 | 12 | use Data::Dumper; 13 | 14 | use Time::HiRes qw(sleep gettimeofday tv_interval usleep); 15 | 16 | 1; -------------------------------------------------------------------------------- /tests/test-flows.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh -e 2 | srcdir=`cd $srcdir && pwd` 3 | trap 'rm -f flows$$ pcap$$ out$$' 0 1 2 13 15 4 | cd tests 5 | "$srcdir"/tests/flowgen.pl >/dev/null 3>flows$$ 4>pcap$$ 6 | ./test-flows out$$ || true 7 | diff -u - out$$ < 5 | 6 | #ifndef to_net_dev 7 | #define to_net_dev(class) container_of(class, struct net_device, class_dev) 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /controller/automake.mk: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS += controller/controller 2 | man_MANS += controller/controller.8 3 | DISTCLEANFILES += controller/controller.8 4 | 5 | controller_controller_SOURCES = controller/controller.c 6 | controller_controller_LDADD = lib/libopenflow.a $(FAULT_LIBS) $(SSL_LIBS) 7 | 8 | EXTRA_DIST += controller/controller.8.in 9 | -------------------------------------------------------------------------------- /debian/openflow-switch.logrotate: -------------------------------------------------------------------------------- 1 | /var/log/openflow/secchan.log { 2 | daily 3 | compress 4 | create 640 root adm 5 | delaycompress 6 | missingok 7 | rotate 30 8 | postrotate 9 | vlogconf --target /var/run/secchan.pid --reopen 10 | endscript 11 | } 12 | -------------------------------------------------------------------------------- /tests/test-stp-ieee802.1d-1998: -------------------------------------------------------------------------------- 1 | # This is the STP example from IEEE 802.1D-1998. 2 | bridge 0 0x42 = a b 3 | bridge 1 0x97 = c:5 a d:5 4 | bridge 2 0x45 = b e 5 | bridge 3 0x57 = b:5 e:5 6 | bridge 4 0x83 = a:5 e:5 7 | run 1000 8 | check 0 = root 9 | check 1 = F F:10 F 10 | check 2 = F:10 B 11 | check 3 = F:5 F 12 | check 4 = F:5 B 13 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_hello/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_hello 3 | 4 | use strict; 5 | require OF::Includes; 6 | 7 | sub my_test { 8 | 9 | my ($sock, $options_ref) = @_; 10 | 11 | 12 | 13 | # hello sequence automatically done by test harness! 14 | } 15 | 16 | run_black_box_test( \&my_test, \@ARGV ); 17 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/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-2.6/compat-2.6/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-2.6/compat-2.6/include/linux/rculist.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_RCULIST_WRAPPER_H 2 | #define __LINUX_RCULIST_WRAPPER_H 3 | 4 | #include 5 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) 6 | #include_next 7 | #else 8 | /* Prior to 2.6.26, the contents of rculist.h were part of list.h. */ 9 | #include 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/linux/types.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_TYPES_WRAPPER_H 2 | #define __LINUX_TYPES_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 8 | 9 | typedef __u16 __bitwise __sum16; 10 | typedef __u32 __bitwise __wsum; 11 | 12 | #endif /* linux kernel < 2.6.20 */ 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /debian/openflow-datapath-source.install: -------------------------------------------------------------------------------- 1 | debian/changelog usr/src/modules/openflow-datapath/debian 2 | debian/control usr/src/modules/openflow-datapath/debian 3 | debian/compat usr/src/modules/openflow-datapath/debian 4 | debian/*.modules.in usr/src/modules/openflow-datapath/debian 5 | debian/rules usr/src/modules/openflow-datapath/debian 6 | _debian/openflow.tar.gz usr/src/modules/openflow-datapath 7 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/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 | #endif 14 | -------------------------------------------------------------------------------- /hw-lib/skeleton/txrx.h: -------------------------------------------------------------------------------- 1 | #ifndef OF_HW_TXRX_H 2 | #define OF_HW_TXRX_H 1 3 | 4 | #include 5 | #include 6 | 7 | extern int of_hw_packet_send(of_hw_driver_t *hw_drv, int of_port, 8 | of_packet_t *pkt, uint32_t flags); 9 | extern int of_hw_packet_receive_register(of_hw_driver_t *hw_drv, 10 | of_packet_in_f callback, void *cookie); 11 | 12 | #endif /* OF_HW_TXRX_H */ 13 | -------------------------------------------------------------------------------- /regress/bin/of_nf2_teardown.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my $mapFile; 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, ) ) { 12 | print "unrecognized option\n"; 13 | exit 1; 14 | } 15 | 16 | if ( defined($mapFile) ) { 17 | nftest_process_iface_map($mapFile); 18 | } 19 | 20 | teardown_NF2(); 21 | -------------------------------------------------------------------------------- /tests/test-stp-ieee802.1d-2004-fig17.6: -------------------------------------------------------------------------------- 1 | # This is the STP example from IEEE 802.1D-2004 figure 17.6. 2 | bridge 0 0x111 = a b l 3 | bridge 1 0x222 = b c d 4 | bridge 2 0x333 = d e f 5 | bridge 3 0x444 = f g h 6 | bridge 4 0x555 = j h i 7 | bridge 5 0x666 = l j k 8 | run 1000 9 | check 0 = root 10 | check 1 = F:10 F F 11 | check 2 = F:20 F F 12 | check 3 = F:30 F B 13 | check 4 = F:20 F F 14 | check 5 = F:10 F F 15 | -------------------------------------------------------------------------------- /regress/bin/of_kmod_teardown.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my $mapFile; 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, ) ) { 12 | print "unrecognized option\n"; 13 | exit 1; 14 | } 15 | 16 | if ( defined($mapFile) ) { 17 | nftest_process_iface_map($mapFile); 18 | } 19 | 20 | teardown_kmod(); 21 | -------------------------------------------------------------------------------- /regress/bin/of_user_teardown.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my $mapFile; 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, ) ) { 12 | print "unrecognized option\n"; 13 | exit 1; 14 | } 15 | 16 | if ( defined($mapFile) ) { 17 | nftest_process_iface_map($mapFile); 18 | } 19 | 20 | teardown_user(); 21 | -------------------------------------------------------------------------------- /regress/projects/learning_switch/regress/tests.txt: -------------------------------------------------------------------------------- 1 | test_unicast_unknown/run.pl 2 | test_unicast_known/run.pl 3 | test_broadcast/run.pl 4 | ##test_unicast_self/run.pl 5 | test_unicast_move/run.pl 6 | ##test_hub_connected/run.pl 7 | test_unicast_multiple_hosts/run.pl 8 | 9 | # BELOW NOT INCLUDED IN CURRRENT RELEASE 10 | # WILL BE AVAILABLE SOON 11 | ##test_forward_latency/run.pl 12 | ##test_forward_bandwidth/run.pl 13 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/openflow/moduleinfo.h: -------------------------------------------------------------------------------- 1 | /* Included *after* config.h, in order to re-define these macros */ 2 | 3 | #ifdef PACKAGE 4 | #undef PACKAGE 5 | #endif 6 | 7 | /* Name of package */ 8 | #define PACKAGE "openflow" 9 | 10 | #ifdef VERSION 11 | #undef VERSION 12 | #endif 13 | 14 | /* Version number of package */ 15 | #define VERSION "1.0.0" /* OpenFlowMajor.OpenFlowMinor.PluginRevForThisMajorMinorRev */ 16 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/in_cksum.h: -------------------------------------------------------------------------------- 1 | /* in_cksum.h 2 | * Declaration of Internet checksum routine. 3 | * 4 | * $Id: in_cksum.h 3992 2008-06-10 03:13:11Z dgu $ 5 | */ 6 | 7 | typedef struct { 8 | const guint8 *ptr; 9 | int len; 10 | } vec_t; 11 | 12 | extern int in_cksum(const vec_t *vec, int veclen); 13 | 14 | extern guint16 in_cksum_shouldbe(guint16 sum, guint16 computed_sum); 15 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/linux/random.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_RANDOM_WRAPPER_H 2 | #define __LINUX_RANDOM_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) 8 | 9 | #ifdef __KERNEL__ 10 | u32 random32(void); 11 | void srandom32(u32 seed); 12 | #endif /* __KERNEL__ */ 13 | 14 | #endif /* linux kernel < 2.6.19 */ 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/net/checksum.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_CHECKSUM_WRAPPER_H 2 | #define __NET_CHECKSUM_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 8 | 9 | static inline __wsum csum_unfold(__sum16 n) 10 | { 11 | return (__force __wsum)n; 12 | } 13 | 14 | #endif /* linux kernel < 2.6.20 */ 15 | 16 | #endif /* checksum.h */ 17 | -------------------------------------------------------------------------------- /tests/test-stp-iol-io-1.4: -------------------------------------------------------------------------------- 1 | # This test file approximates the following test from "Bridge 2 | # Functions Consortium Spanning Tree Interoperability Test Suite 3 | # Version 1.5": 4 | # STP.io.1.4: Network Initialization 5 | bridge 0 0x111 = a b c 6 | bridge 1 0x222 = b d e 7 | bridge 2 0x333 = a d f 8 | bridge 3 0x444 = c e f 9 | run 1000 10 | check 0 = root 11 | check 1 = F:10 F F 12 | check 2 = F:10 B F 13 | check 3 = F:10 B B 14 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_any_port/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_any_port 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_any { 8 | 9 | forward_simple(@_, 'any'); 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_port_pairs( $ofp, $sock, $options_ref, \&forward_any, 0xfffff); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | 21 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/linux/if_arp.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_IF_ARP_WRAPPER_H 2 | #define __LINUX_IF_ARP_WRAPPER_H 1 3 | 4 | 5 | #include_next 6 | 7 | #ifndef HAVE_SKBUFF_HEADER_HELPERS 8 | #include 9 | 10 | static inline struct arphdr *arp_hdr(const struct sk_buff *skb) 11 | { 12 | return (struct arphdr *)skb_network_header(skb); 13 | } 14 | #endif /* !HAVE_SKBUFF_HEADER_HELPERS */ 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /tests/test-stp-iol-io-1.2: -------------------------------------------------------------------------------- 1 | # This test file approximates the following test from "Bridge 2 | # Functions Consortium Spanning Tree Interoperability Test Suite 3 | # Version 1.5": 4 | # STP.io.1.2: Repeated Network 5 | bridge 0 0x111 = a a 6 | bridge 1 0x222 = a a 7 | run 1000 8 | check 0 = rootid:0x111 F B 9 | check 1 = rootid:0x111 F:10 B 10 | bridge 1 = a^0x90 _ 11 | run 1000 12 | check 0 = rootid:0x111 F B 13 | check 1 = rootid:0x111 B F:10 14 | 15 | -------------------------------------------------------------------------------- /boot.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | # Generate list of files in debian/ to distribute. 6 | (echo '# Automatically generated by boot.sh (from Git tree).' && 7 | printf 'EXTRA_DIST += \\\n' && 8 | git ls-files debian | grep -v '^debian/\.gitignore$' | 9 | sed -e 's/\(.*\)/ \1 \\/' -e '$s/ \\//') > debian/automake.mk 10 | 11 | cat debian/control.in > debian/control 12 | 13 | # Bootstrap configure system from .ac/.am files 14 | autoreconf --install --force 15 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_arp_all/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_arp_all 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_all { 8 | 9 | forward_simple_arp(@_, 'all', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_ports( $ofp, $sock, $options_ref, \&forward_all, 0x0); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_icmp_all/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_icmp_all 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_all { 8 | 9 | forward_simple_icmp(@_, 'all', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_ports( $ofp, $sock, $options_ref, \&forward_all, 0x0); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_arp_fool/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_arp_fool 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_port { 8 | 9 | forward_simple_arp(@_, 'port', 1); # 1: fool_flg=on 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_port_pairs( $ofp, $sock, $options_ref, \&forward_port, 0x0); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_arp_port/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_arp_port 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_port { 8 | 9 | forward_simple_arp(@_, 'port', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_port_pairs( $ofp, $sock, $options_ref, \&forward_port, 0x0); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_icmp_fool/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_icmp_fool 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_port { 8 | 9 | forward_simple_icmp(@_, 'port', 1); # 1: fool_flg=on 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_port_pairs( $ofp, $sock, $options_ref, \&forward_port, 0x0); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_icmp_port/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_icmp_port 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_port { 8 | 9 | forward_simple_icmp(@_, 'port', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_port_pairs( $ofp, $sock, $options_ref, \&forward_port, 0x0); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/openflow/Makefile.common: -------------------------------------------------------------------------------- 1 | # the name of the plugin 2 | PLUGIN_NAME = openflow 3 | 4 | # the dissector sources (without any helpers) 5 | DISSECTOR_SRC = packet-openflow.c 6 | 7 | # corresponding headers 8 | DISSECTOR_INCLUDES = 9 | 10 | # Dissector helpers. They're included in the source files in this 11 | # directory, but they're not dissectors themselves, i.e. they're not 12 | # used to generate "register.c"). 13 | DISSECTOR_SUPPORT_SRC = 14 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_arp_all/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_arp_all 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_all { 8 | 9 | forward_simple_arp(@_, 'all', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_all); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | 21 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_arp_fool/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_arp_port 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_port { 8 | forward_simple_arp(@_, 'port', 1); # 1: fool_flg = on 9 | } 10 | 11 | sub my_test { 12 | 13 | my ( $sock, $options_ref ) = @_; 14 | 15 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_port); 16 | } 17 | 18 | run_black_box_test( \&my_test, \@ARGV ); 19 | 20 | 21 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_icmp_all/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_icmp_all 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_all { 8 | 9 | forward_simple_icmp(@_, 'all', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_all); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | 21 | -------------------------------------------------------------------------------- /doc/of-spec/credits.tex: -------------------------------------------------------------------------------- 1 | \section{Appendix B: Credits} 2 | 3 | Current Maintainer: Brandon Heller (brandonh@stanford.edu). 4 | \\\\ 5 | Spec contributions, in alphabetical order: 6 | \\\\ 7 | Ben Pfaff, 8 | Brandon Heller, 9 | Dan Talayco, 10 | David Erickson, 11 | Glen Gibb, 12 | Guido Appenzeller, 13 | Jean Tourrilhes, 14 | Justin Pettit, 15 | KK Yap, 16 | Martin Casado, 17 | Masayoshi Kobayashi, 18 | Nick McKeown, 19 | Peter Balland, 20 | Reid Price, 21 | Rob Sherwood, 22 | Yiannis Yiakoumis. -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_icmp_fool/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_icmp_port 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_port { 8 | forward_simple_icmp(@_, 'port', 1); # 1: fool_flg = on 9 | } 10 | 11 | sub my_test { 12 | 13 | my ( $sock, $options_ref ) = @_; 14 | 15 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_port); 16 | } 17 | 18 | run_black_box_test( \&my_test, \@ARGV ); 19 | 20 | 21 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_arp_port/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_arp_port 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_port { 8 | forward_simple_arp(@_, 'port', 0); # 0: fool_flg = off 9 | } 10 | 11 | sub my_test { 12 | 13 | my ( $sock, $options_ref ) = @_; 14 | 15 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_port); 16 | } 17 | 18 | run_black_box_test( \&my_test, \@ARGV ); 19 | 20 | 21 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_icmp_port/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_icmp_port 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_port { 8 | forward_simple_icmp(@_, 'port', 0); # 0: fool_flg = off 9 | } 10 | 11 | sub my_test { 12 | 13 | my ( $sock, $options_ref ) = @_; 14 | 15 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_port); 16 | } 17 | 18 | run_black_box_test( \&my_test, \@ARGV ); 19 | 20 | 21 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_arp_controller/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_arp_controller 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_controller { 8 | 9 | forward_simple_arp(@_, 'controller', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_ports( $ofp, $sock, $options_ref, \&forward_controller, 0x0); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_icmp_controller/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_icmp_controller 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_controller { 8 | 9 | forward_simple_icmp(@_, 'controller', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_ports( $ofp, $sock, $options_ref, \&forward_controller, 0x0); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/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 | static inline struct iphdr *ip_hdr(const struct sk_buff *skb) 8 | { 9 | return (struct iphdr *)skb_network_header(skb); 10 | } 11 | 12 | static inline unsigned int ip_hdrlen(const struct sk_buff *skb) 13 | { 14 | return ip_hdr(skb)->ihl * 4; 15 | } 16 | #endif /* !HAVE_SKBUFF_HEADER_HELPERS */ 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_arp_controller/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_arp_controller 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_controller { 8 | 9 | forward_simple_arp(@_, 'controller', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_controller); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_queue_forward/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_queue_forward 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_unicast_port { 8 | forward_simple(@_, 'enqueue'); 9 | } 10 | 11 | sub my_test { 12 | my ($sock, $options_ref) = @_; 13 | 14 | if ( not defined( $$options_ref{'no_slicing'} ) ) { 15 | for_all_port_pairs($ofp, $sock, $options_ref, \&forward_unicast_port, 0x0); 16 | } 17 | } 18 | 19 | run_black_box_test(\&my_test, \@ARGV); 20 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_icmp_controller/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_icmp_controller 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_controller { 8 | 9 | forward_simple_icmp(@_, 'controller', 0); # 0: fool_flg = off 10 | } 11 | 12 | sub my_test { 13 | 14 | my ( $sock, $options_ref ) = @_; 15 | 16 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_controller); 17 | } 18 | 19 | run_black_box_test( \&my_test, \@ARGV ); 20 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/g_ascii_strtoull.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: g_ascii_strtoull.h 3992 2008-06-10 03:13:11Z dgu $ 3 | * 4 | * "g_ascii_strtoull()" extracted from GLib 2.4.5, for use with GLibs 5 | * that don't have it (e.g., GLib 1.2[.x]). 6 | */ 7 | 8 | #ifndef __WIRESHARK_G_ASCII_STRTOULL_H__ 9 | #define __WIRESHARK_G_ASCII_STRTOULL_H__ 10 | 11 | extern guint64 g_ascii_strtoull (const gchar *nptr, 12 | gchar **endptr, 13 | guint base); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /datapath/dp_act.h: -------------------------------------------------------------------------------- 1 | #ifndef DP_ACT_H 2 | #define DP_ACT_H 1 3 | 4 | #include "datapath.h" 5 | 6 | #define ACT_VALIDATION_OK ((uint16_t)-1) 7 | 8 | uint16_t validate_actions(struct datapath *, const struct sw_flow_key *, 9 | const struct ofp_action_header *, size_t); 10 | void execute_actions(struct datapath *, struct sk_buff *, 11 | struct sw_flow_key *, const struct ofp_action_header *, 12 | size_t action_len, int ignore_no_fwd); 13 | int make_writable(struct sk_buff **pskb); 14 | 15 | #endif /* dp_act.h */ 16 | -------------------------------------------------------------------------------- /datapath/dp_dev.h: -------------------------------------------------------------------------------- 1 | #ifndef DP_DEV_H 2 | #define DP_DEV_H 1 3 | 4 | struct dp_dev { 5 | struct net_device_stats stats; 6 | struct datapath *dp; 7 | struct sk_buff_head xmit_queue; 8 | struct work_struct xmit_work; 9 | }; 10 | 11 | int dp_dev_setup(struct datapath *, const char *); 12 | void dp_dev_destroy(struct datapath *); 13 | int dp_dev_recv(struct net_device *, struct sk_buff *); 14 | int is_dp_dev(struct net_device *); 15 | struct datapath *dp_dev_get_dp(struct net_device *); 16 | 17 | #endif /* dp_dev.h */ 18 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/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-2.6/.gitignore: -------------------------------------------------------------------------------- 1 | /Kbuild 2 | /Makefile 3 | /Makefile.main 4 | /brcompat.c 5 | /brc_sysfs_dp.c 6 | /brc_sysfs_if.c 7 | /chain.c 8 | /crc32.c 9 | /crc_t.c 10 | /datapath.c 11 | /dp_act.c 12 | /dp_dev.c 13 | /dp_notify.c 14 | /flow.c 15 | /forward.c 16 | /forward_t.c 17 | /genetlink-brcompat.c 18 | /genetlink-openflow.c 19 | /hwtable_dummy.c 20 | /nx_act.c 21 | /nx_act_snat.c 22 | /nx_msg.c 23 | /random32.c 24 | /table-hash.c 25 | /table-linear.c 26 | /table-mac.c 27 | /table_t.c 28 | /tmp 29 | /unit-exports.c 30 | /unit.c 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /regress/bin/of_kmod_setup.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my $mapFile, $controller; 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, 12 | "emerg" => \$emerg, 13 | "controller=s", \$controller) ) { 14 | print "unrecognized option\n"; 15 | exit 1; 16 | } 17 | 18 | if ( defined($mapFile) ) { 19 | nftest_process_iface_map($mapFile); 20 | } 21 | 22 | setup_kmod($controller, $emerg); 23 | -------------------------------------------------------------------------------- /regress/bin/of_kmod_veth_teardown.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my $mapFile; 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, ) ) { 12 | print "unrecognized option\n"; 13 | exit 1; 14 | } 15 | 16 | if ( defined($mapFile) ) { 17 | nftest_process_iface_map($mapFile); 18 | } 19 | #else, use pre-defined veth map 20 | else { 21 | nftest_process_iface_map("$ENV{'OFT_ROOT'}/bin/veth.map"); 22 | } 23 | 24 | teardown_kmod(); 25 | -------------------------------------------------------------------------------- /regress/bin/of_user_setup.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my ($mapFile, $controller); 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, 12 | "emerg" => \$emerg, 13 | "controller=s", \$controller) ) { 14 | print "unrecognized option\n"; 15 | exit 1; 16 | } 17 | 18 | if ( defined($mapFile) ) { 19 | nftest_process_iface_map($mapFile); 20 | } 21 | 22 | setup_user($controller, $emerg); 23 | -------------------------------------------------------------------------------- /regress/bin/of_user_veth_teardown.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my $mapFile; 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, ) ) { 12 | print "unrecognized option\n"; 13 | exit 1; 14 | } 15 | 16 | if ( defined($mapFile) ) { 17 | nftest_process_iface_map($mapFile); 18 | } 19 | #else, use pre-defined veth map 20 | else { 21 | nftest_process_iface_map("$ENV{'OFT_ROOT'}/bin/veth.map"); 22 | } 23 | 24 | teardown_user(); 25 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/asm-generic/bug.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_GENERIC_BUG_WRAPPER_H 2 | #define __ASM_GENERIC_BUG_WRAPPER_H 3 | 4 | #include_next 5 | 6 | #ifndef WARN_ON_ONCE 7 | #define WARN_ON_ONCE(condition) ({ \ 8 | static int __warned; \ 9 | int __ret_warn_once = !!(condition); \ 10 | \ 11 | if (unlikely(__ret_warn_once) && !__warned) { \ 12 | WARN_ON(1); \ 13 | __warned = 1; \ 14 | } \ 15 | unlikely(__ret_warn_once); \ 16 | }) 17 | 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /datapath/crc32.h: -------------------------------------------------------------------------------- 1 | #ifndef CRC32_H 2 | #define CRC32_H 1 3 | 4 | #include 5 | #ifndef __KERNEL__ 6 | #include 7 | #endif 8 | #include 9 | 10 | #define CRC32_TABLE_BITS 8 11 | #define CRC32_TABLE_SIZE (1u << CRC32_TABLE_BITS) 12 | 13 | struct crc32 { 14 | unsigned int table[CRC32_TABLE_SIZE]; 15 | }; 16 | 17 | void crc32_init(struct crc32 *, unsigned int polynomial); 18 | unsigned int crc32_calculate(const struct crc32 *, 19 | const void *data_, size_t n_bytes); 20 | 21 | 22 | #endif /* crc32.h */ 23 | -------------------------------------------------------------------------------- /debian/openflow-controller.README.Debian: -------------------------------------------------------------------------------- 1 | README.Debian for openflow-controller 2 | ------------------------------------- 3 | 4 | * To (re)configure the controller, edit /etc/default/openflow-controller 5 | and run "/etc/init.d/openflow-controller restart". 6 | 7 | * To enable OpenFlow switches to automatically discover the location 8 | of the controller, you must install and configure a DHCP server. 9 | The secchan(8) manpage (found in the openflow-switch package) gives 10 | a working example configuration file for the ISC DHCP server. 11 | -------------------------------------------------------------------------------- /debian/openflow-datapath-source.copyright: -------------------------------------------------------------------------------- 1 | Upstream Authors: 2 | 3 | The Board of Trustees of The Leland Stanford Junior University 4 | 5 | Copyright: 6 | 7 | Copyright (C) 2008 The Board of Trustees of The Leland Stanford 8 | Junior University 9 | 10 | License: 11 | 12 | Files in the datapath/ and its sub-directories are covered under the GNU 13 | General Public License Version 2. 14 | 15 | On Debian systems, the complete text of the GNU General 16 | Public License can be found in `/usr/share/common-licenses/GPL'. 17 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/linux/netfilter_ipv4.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_NETFILTER_IPV4_WRAPPER_H 2 | #define __LINUX_NETFILTER_IPV4_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) 8 | 9 | #ifdef __KERNEL__ 10 | 11 | #define NF_INET_PRE_ROUTING NF_IP_PRE_ROUTING 12 | #define NF_INET_POST_ROUTING NF_IP_POST_ROUTING 13 | #define NF_INET_FORWARD NF_IP_FORWARD 14 | 15 | #endif /* __KERNEL__ */ 16 | 17 | #endif /* linux kernel < 2.6.25 */ 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /regress/CREDITS: -------------------------------------------------------------------------------- 1 | Credit goes to those who contributed code to the regression suite. Unless 2 | otherwise noted, the contributors are at Stanford University. 3 | 4 | 5 | Test writers/editors: 6 | Clay Collier 7 | David Erickson 8 | Mikio Hara (NEC) 9 | Brandon Heller 10 | Peyman Kazemian 11 | Masayoshi Kobayashi (NEC) 12 | Bob Lantz 13 | Brandon Nefcy 14 | Rob Sherwood (Deutsche Telekom R&D Labs) 15 | Jean Tourrilhes (HP Labs) 16 | Tatsuya Yabe (NEC) 17 | Yiannis Yiakoumis 18 | 19 | Supporting libraries: 20 | Adam Covington 21 | Glen Gibb 22 | Jad Naous 23 | -------------------------------------------------------------------------------- /tests/test-stp-ieee802.1d-2004-fig17.7: -------------------------------------------------------------------------------- 1 | # This is the STP example from IEEE 802.1D-2004 figure 17.7. 2 | bridge 0 0xaa = b 3 | bridge 1 0x111 = a b d f h g e c 4 | bridge 2 0x222 = g h j l n m k i 5 | run 1000 6 | check 0 = root 7 | check 1 = F F:10 F F F F F F 8 | check 2 = B F:20 F F F F F F 9 | 10 | # This is not the port priority change described in that figure, 11 | # but I don't understand what port priority change would cause 12 | # that change. 13 | bridge 2 = g X j l n m k i 14 | run 1000 15 | check 0 = root 16 | check 1 = F F:10 F F F F F F 17 | check 2 = F:20 D F F F F F F 18 | -------------------------------------------------------------------------------- /regress/scripts/env_vars: -------------------------------------------------------------------------------- 1 | export OF_ROOT=/home/yourname/openflow 2 | export OFT_ROOT=${OF_ROOT}/regress 3 | export PATH=${OFT_ROOT}/bin:/sbin:/usr/sbin:${PATH} 4 | export PERL5LIB=${OFT_ROOT}/lib/Perl5:${PERL5LIB} 5 | export OFT_MAP_ETH=${OFT_ROOT}/bin/of_generic_eth.map 6 | export OFT_HP_MAP_ETH=${OFT_ROOT}/bin/of_hp_eth.map 7 | export OFT_HP_SWITCH_IP=10.10.10.2 8 | export OFT_HP_VLAN=10 9 | export OFT_HP_CONTROLLER="tcp:10.10.10.3:6633" 10 | export OFT_HP_LISTENER="tcp:10.10.10.2:6633" 11 | export OFT_OVS_ROOT=/home/yourname/openvswitch 12 | export OFT_OVS_MAP_ETH=${OFT_ROOT}/bin/of_ovs_eth.map 13 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/net/netlink.h: -------------------------------------------------------------------------------- 1 | #ifndef __NET_NETLINK_WRAPPER_H 2 | #define __NET_NETLINK_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #ifndef HAVE_NLA_NUL_STRING 7 | #define NLA_NUL_STRING NLA_STRING 8 | 9 | static inline int VERIFY_NUL_STRING(struct nlattr *attr) 10 | { 11 | return (!attr || (nla_len(attr) 12 | && memchr(nla_data(attr), '\0', nla_len(attr))) 13 | ? 0 : EINVAL); 14 | } 15 | #else 16 | static inline int VERIFY_NUL_STRING(struct nlattr *attr) 17 | { 18 | return 0; 19 | } 20 | #endif /* !HAVE_NLA_NUL_STRING */ 21 | 22 | #endif /* net/netlink.h */ 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #*# 2 | *.a 3 | *.d 4 | *.ko 5 | *.la 6 | *.lo 7 | *.loT 8 | *.mod.c 9 | *.o 10 | *.o 11 | *.pyc 12 | *.so 13 | *~ 14 | .#* 15 | .*.cmd 16 | .deps 17 | .libs 18 | .tmp_versions 19 | /Makefile 20 | /Makefile.in 21 | /aclocal.m4 22 | /autom4te.cache 23 | /build-arch-stamp 24 | /build-aux 25 | /build-indep-stamp 26 | /compile 27 | /config.guess 28 | /config.h 29 | /config.h.in 30 | /config.log 31 | /config.status 32 | /config.sub 33 | /configure 34 | /configure-stamp 35 | /depcomp 36 | /install-sh 37 | /missing 38 | /stamp-h1 39 | Module.symvers 40 | TAGS 41 | cscope.* 42 | ext.m4 43 | ext.mk 44 | tags 45 | -------------------------------------------------------------------------------- /datapath/hwtable_nf2/Modules.mk: -------------------------------------------------------------------------------- 1 | # Specify the module to build. 2 | build_modules += ofdatapath_netfpga 3 | dist_modules += ofdatapath_netfpga 4 | 5 | # Specify the source files that comprise the module. 6 | ofdatapath_netfpga_sources = \ 7 | hwtable_nf2/nf2_flowtable.c \ 8 | hwtable_nf2/nf2_procfs.c \ 9 | hwtable_nf2/nf2_openflow.c \ 10 | hwtable_nf2/nf2_lib.c 11 | 12 | ofdatapath_netfpga_headers = \ 13 | hwtable_nf2/nf2.h \ 14 | hwtable_nf2/nf2_reg.h \ 15 | hwtable_nf2/nf2_hwapi.h \ 16 | hwtable_nf2/nf2_flowtable.h \ 17 | hwtable_nf2/nf2_procfs.h \ 18 | hwtable_nf2/nf2_openflow.h \ 19 | hwtable_nf2/nf2_lib.h 20 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/g_ascii_strcasecmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: g_ascii_strcasecmp.h 3992 2008-06-10 03:13:11Z dgu $ 3 | * 4 | * "g_ascii_strcasecmp()" and "g_ascii_strncasecmp()" extracted from 5 | * GLib 2.4.8, for use with GLibs that don't have it (e.g., GLib 1.2[.x]). 6 | */ 7 | 8 | #ifndef __WIRESHARK_G_ASCII_STRCASECMP_H__ 9 | #define __WIRESHARK_G_ASCII_STRCASECMP_H__ 10 | 11 | extern gint g_ascii_strcasecmp (const gchar *s1, 12 | const gchar *s2); 13 | 14 | extern gint g_ascii_strncasecmp (const gchar *s1, 15 | const gchar *s2, 16 | gsize n); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /tests/test-stp-iol-io-1.1: -------------------------------------------------------------------------------- 1 | # This test file approximates the following test from "Bridge 2 | # Functions Consortium Spanning Tree Interoperability Test Suite 3 | # Version 1.5": 4 | # STP.io.1.1: Link Failure 5 | bridge 0 0x111 = a b c 6 | bridge 1 0x222 = a b c 7 | run 1000 8 | check 0 = root 9 | check 1 = F:10 B B 10 | bridge 1 = 0 _ _ 11 | run 1000 12 | check 0 = root 13 | check 1 = F F:10 B 14 | bridge 1 = X _ _ 15 | run 1000 16 | check 0 = root 17 | check 1 = D F:10 B 18 | bridge 1 = _ 0 _ 19 | run 1000 20 | check 0 = root 21 | check 1 = D F F:10 22 | bridge 1 = _ X _ 23 | run 1000 24 | check 0 = root 25 | check 1 = D D F:10 26 | -------------------------------------------------------------------------------- /regress/bin/of_nf2_setup.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | use Data::Dumper; 5 | 6 | use OF::OFUtil; 7 | use Test::TestLib; 8 | 9 | my ($mapFile, $controller); 10 | 11 | print "Calling of_nf2_setup.pl\n"; 12 | print Dumper(@ARGV) . "\n"; 13 | 14 | # Process command line options 15 | unless ( GetOptions( "map=s" => \$mapFile, 16 | "emerg" => \$emerg, 17 | "controller=s", \$controller) ) { 18 | print "unrecognized option\n"; 19 | exit 1; 20 | } 21 | 22 | if ( defined($mapFile) ) { 23 | nftest_process_iface_map($mapFile); 24 | } 25 | 26 | setup_NF2($controller, $emerg); 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /hw-lib/skeleton/os.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * OS abstractions 4 | */ 5 | 6 | #ifndef OF_HW_OS_H 7 | #define OF_HW_OS_H 1 8 | 9 | #include 10 | 11 | #define ALLOC(bytes) malloc(bytes) 12 | #define FREE(ptr) free(ptr) 13 | 14 | #define PKT_ALLOC(bytes) TBD 15 | #define PKT_FREE(ptr) TBD 16 | 17 | #define MUTEX_DECLARE(name) TBD 18 | #define MUTEX_INIT(name) TBD 19 | #define MUTEX_LOCK(name) TBD 20 | #define MUTEX_UNLOCK(name) TBD 21 | 22 | #define TIME_NOW(time) TBD 23 | #define TIME_DIFF(diff, early, late) TBD 24 | 25 | /* FIXME */ 26 | #include 27 | #define os_pkt_free(pkt) ofpbuf_delete(pkt) 28 | 29 | #endif /* OF_HW_OS_H */ 30 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/linux/netfilter_bridge.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_NETFILTER_BRIDGE_WRAPPER_H 2 | #define __LINUX_NETFILTER_BRIDGE_WRAPPER_H 3 | 4 | #include_next 5 | 6 | #include 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) 8 | 9 | #include 10 | #include 11 | 12 | static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb) 13 | { 14 | switch (skb->protocol) { 15 | case __constant_htons(ETH_P_8021Q): 16 | return VLAN_HLEN; 17 | default: 18 | return 0; 19 | } 20 | } 21 | 22 | #endif /* linux version < 2.6.22 */ 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /regress/bin/of_kmod_veth_setup.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my ($mapFile, $controller); 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, 12 | "emerg" => \$emerg, 13 | "controller=s", \$controller) ) { 14 | print "unrecognized option\n"; 15 | exit 1; 16 | } 17 | 18 | if ( defined($mapFile) ) { 19 | nftest_process_iface_map($mapFile); 20 | } 21 | #else, use pre-defined veth map 22 | else { 23 | nftest_process_iface_map("$ENV{'OFT_ROOT'}/bin/veth.map"); 24 | } 25 | 26 | setup_kmod($controller, $emerg); 27 | -------------------------------------------------------------------------------- /regress/bin/of_user_veth_setup.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my ($mapFile, $controller); 9 | 10 | # Process command line options 11 | unless ( GetOptions( "map=s" => \$mapFile, 12 | "emerg" => \$emerg, 13 | "controller=s", \$controller) ) { 14 | print "unrecognized option\n"; 15 | exit 1; 16 | } 17 | 18 | if ( defined($mapFile) ) { 19 | nftest_process_iface_map($mapFile); 20 | } 21 | #else, use pre-defined veth map 22 | else { 23 | nftest_process_iface_map("$ENV{'OFT_ROOT'}/bin/veth.map"); 24 | } 25 | 26 | setup_user($controller, $emerg); 27 | -------------------------------------------------------------------------------- /debian/openflow-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 | depmod -a 9 | 10 | #DEBHELPER# 11 | 12 | # If the switch is running, restart it. This ensures that we are using the 13 | # latest kernel module, because the init script will unload and reload the 14 | # module. 15 | # 16 | # (Ideally we'd only want to do this if this package corresponds to the 17 | # running kernel, but I don't know a reliable way to check.) 18 | INIT=/etc/init.d/openflow-switch 19 | if test -x $INIT && $INIT status; then 20 | $INIT restart || true 21 | fi 22 | 23 | exit 0 24 | 25 | 26 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/linux/netlink.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_NETLINK_WRAPPER_H 2 | #define __LINUX_NETLINK_WRAPPER_H 1 3 | 4 | #include 5 | #include_next 6 | #include 7 | 8 | #include 9 | 10 | #ifndef NLMSG_DEFAULT_SIZE 11 | #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) 12 | #endif 13 | 14 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) 15 | #define nlmsg_new(s, f) nlmsg_new_proper((s), (f)) 16 | static inline struct sk_buff *nlmsg_new_proper(int size, gfp_t flags) 17 | { 18 | return alloc_skb(size, flags); 19 | } 20 | 21 | #endif /* linux kernel < 2.6.19 */ 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /soexpand.pl: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Getopt::Long; 4 | 5 | my ($exit_code) = 0; 6 | my (@include_dirs); 7 | Getopt::Long::Configure ("bundling"); 8 | GetOptions("I|include=s" => \@include_dirs) or exit(1); 9 | @include_dirs = ('.') if !@include_dirs; 10 | OUTER: while () { 11 | if (my ($name) = /^\.so (\S+)$/) { 12 | foreach my $dir (@include_dirs, '.') { 13 | if (open(INNER, "$dir/$name")) { 14 | while () { 15 | print $_; 16 | } 17 | close(INNER); 18 | next OUTER; 19 | } 20 | } 21 | print STDERR "$name not found in: ", join(' ', @include_dirs), "\n"; 22 | $exit_code = 1; 23 | } 24 | print $_; 25 | } 26 | exit $exit_code; 27 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | openflow (1.0.0) unstable; urgency=low 2 | 3 | * Development version 4 | 5 | -- OpenFlow team Thu, 31 Dec 2009 23:59:59 -0800 6 | 7 | openflow (0.9.0-rev1) unstable; urgency=low 8 | 9 | * Development version. 10 | 11 | -- OpenFlow team Fri, 04 Sep 2009 12:00:00 -0800 12 | 13 | openflow (0.8.9-rev4) unstable; urgency=low 14 | 15 | * Develoment version. 16 | 17 | -- OpenFlow team Tue, 15 Sep 2009 12:00:00 -0800 18 | 19 | openflow (0.8.1) unstable; urgency=low 20 | 21 | * Development version. 22 | 23 | -- OpenFlow team Mon, 19 Nov 2007 14:57:52 -0800 24 | -------------------------------------------------------------------------------- /hw-lib/automake.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware library dependency file definitions. 3 | # 4 | 5 | if NF2 6 | # 7 | # NetFPGA hardware library 8 | # 9 | noinst_LIBRARIES += hw-lib/libnf2.a 10 | 11 | hw_lib_libnf2_a_SOURCES = \ 12 | hw-lib/nf2/hw_flow.c \ 13 | hw-lib/nf2/hw_flow.h \ 14 | hw-lib/nf2/nf2_lib.c \ 15 | hw-lib/nf2/nf2_lib.h \ 16 | hw-lib/nf2/nf2_drv.c \ 17 | hw-lib/nf2/nf2_drv.h \ 18 | hw-lib/nf2/nf2.h \ 19 | hw-lib/nf2/debug.h \ 20 | hw-lib/nf2/reg_defines_openflow_switch.h \ 21 | hw-lib/nf2/nf2util.c \ 22 | hw-lib/nf2/nf2util.h 23 | 24 | hw_lib_nf2_a_CPPFLAGS = $(AM_CPPFLAGS) $(OF_CPP_FLAGS) -DHWTABLE_NO_DEBUG 25 | hw_lib_nf2_a_CPPFLAGS += -I hw-lib/nf2 26 | hw_lib_nf2_a_CPPFLAGS += -I $(HW_SYSTEM)/include 27 | 28 | endif 29 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/openflow/plugin.c: -------------------------------------------------------------------------------- 1 | /* Do not modify this file. */ 2 | /* It is created automatically by the Makefile. */ 3 | 4 | #ifdef HAVE_CONFIG_H 5 | # include "config.h" 6 | #endif 7 | 8 | #include 9 | 10 | #include "moduleinfo.h" 11 | 12 | #ifndef ENABLE_STATIC 13 | G_MODULE_EXPORT const gchar version[] = VERSION; 14 | 15 | /* Start the functions we need for the plugin stuff */ 16 | 17 | G_MODULE_EXPORT void 18 | plugin_register (void) 19 | { 20 | {extern void proto_register_openflow (void); proto_register_openflow ();} 21 | } 22 | 23 | G_MODULE_EXPORT void 24 | plugin_reg_handoff(void) 25 | { 26 | {extern void proto_reg_handoff_openflow (void); proto_reg_handoff_openflow ();} 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/genetlink-brcompat.c: -------------------------------------------------------------------------------- 1 | #include "net/genetlink.h" 2 | 3 | #include 4 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) 5 | 6 | /* We fix grp->id to 32 so that it doesn't collide with any of the multicast 7 | * groups selected by openflow_mod, which uses groups 16 through 31. Collision 8 | * isn't fatal--multicast listeners should check that the family is the one 9 | * that they want and discard others--but it wastes time and memory to receive 10 | * unwanted messages. */ 11 | int genl_register_mc_group(struct genl_family *family, 12 | struct genl_multicast_group *grp) 13 | { 14 | grp->id = 32; 15 | grp->family = family; 16 | 17 | return 0; 18 | } 19 | 20 | #endif /* kernel < 2.6.23 */ 21 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_all/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_all 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_all { 8 | 9 | forward_simple(@_, 'all'); 10 | } 11 | 12 | sub forward_all_vlan { 13 | my $vlan_id = 0xa5f3; 14 | #[15:13] priority, [11:0] vlan id 15 | #The value was chosen at random 16 | forward_simple(@_, 'all', undef, undef, $vlan_id); 17 | } 18 | 19 | 20 | sub my_test { 21 | 22 | my ( $sock, $options_ref ) = @_; 23 | 24 | for_all_ports( $ofp, $sock, $options_ref, \&forward_all, 0x0); 25 | if ( not defined( $$options_ref{'no_vlan'} ) ) { 26 | for_all_ports( $ofp, $sock, $options_ref, \&forward_all_vlan, 0x0); 27 | } 28 | } 29 | 30 | run_black_box_test( \&my_test, \@ARGV ); 31 | -------------------------------------------------------------------------------- /datapath/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = 2 | if L26_ENABLED 3 | SUBDIRS += linux-2.6 4 | endif 5 | 6 | EXTRA_DIST = $(dist_headers) $(dist_sources) 7 | EXTRA_DIST += hwtable_dummy/Modules.mk hwtable_dummy/hwtable_dummy.c 8 | EXTRA_DIST += \ 9 | hwtable_nf2/Modules.mk \ 10 | hwtable_nf2/nf2.h \ 11 | hwtable_nf2/nf2_hwapi.h \ 12 | hwtable_nf2/nf2_reg.h \ 13 | hwtable_nf2/nf2_flowtable.c \ 14 | hwtable_nf2/nf2_flowtable.h \ 15 | hwtable_nf2/nf2_lib.c \ 16 | hwtable_nf2/nf2_lib.h \ 17 | hwtable_nf2/nf2_procfs.c \ 18 | hwtable_nf2/nf2_procfs.h \ 19 | hwtable_nf2/nf2_openflow.c \ 20 | hwtable_nf2/nf2_openflow.h \ 21 | hwtable_nf2/openflow_switch.bit 22 | 23 | # Suppress warnings about GNU extensions in Modules.mk files. 24 | AUTOMAKE_OPTIONS = -Wno-portability 25 | 26 | include Modules.mk 27 | include linux-2.6/Modules.mk 28 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_port/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_port 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_unicast_port { 8 | forward_simple(@_, 'port'); 9 | } 10 | 11 | sub forward_unicast_vlan_port { 12 | my $vlan_id = 0xea5a; 13 | #[15:13] priority, [11:0] vlan id 14 | #The value was chosen at random 15 | forward_simple(@_, 'port', undef, undef, $vlan_id); 16 | } 17 | 18 | sub my_test { 19 | my ($sock, $options_ref) = @_; 20 | 21 | for_all_port_pairs($ofp, $sock, $options_ref, \&forward_unicast_port, 0x0); 22 | if ( not defined( $$options_ref{'no_vlan'} ) ) { 23 | for_all_port_pairs($ofp, $sock, $options_ref, \&forward_unicast_vlan_port, 0x0); 24 | } 25 | } 26 | 27 | run_black_box_test(\&my_test, \@ARGV); 28 | -------------------------------------------------------------------------------- /debian/control.modules.in: -------------------------------------------------------------------------------- 1 | Source: openflow 2 | Section: net 3 | Priority: extra 4 | Maintainer: OpenFlow Team 5 | Build-Depends: debhelper (>= 5.0.37) 6 | Standards-Version: 3.7.3 7 | 8 | Package: openflow-datapath-module-_KVERS_ 9 | Architecture: any 10 | Recommends: kernel-image-_KVERS_, openflow-switch 11 | Provides: openflow-datapath-module 12 | Description: OpenFlow Linux datapath kernel module 13 | This package contains the OpenFlow 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 openflow-datapath-source 18 | package has been provided for this purpose. Refer to README.Debian 19 | provided in that package for further instructions. 20 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/genetlink-openflow.c: -------------------------------------------------------------------------------- 1 | #include "net/genetlink.h" 2 | 3 | #include 4 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) 5 | 6 | /* We use multicast groups 16 through 31 to avoid colliding with the multicast 7 | * group selected by brcompat_mod, which uses groups 32. Collision isn't 8 | * fatal--multicast listeners should check that the family is the one that they 9 | * want and discard others--but it wastes time and memory to receive unwanted 10 | * messages. */ 11 | int genl_register_mc_group(struct genl_family *family, 12 | struct genl_multicast_group *grp) 13 | { 14 | /* This code is called single-threaded. */ 15 | static unsigned int next_id = 0; 16 | grp->id = next_id++ % 16 + 16; 17 | grp->family = family; 18 | 19 | return 0; 20 | } 21 | 22 | #endif /* kernel < 2.6.23 */ 23 | -------------------------------------------------------------------------------- /regress/bin/of_kmod_test.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | ############################################################################## 4 | # 5 | # Wrapper for OpenFlow regression tests 6 | # $Id: of_regress_test.pl 105 2008-06-06 04:07:05Z brandonh $ 7 | # 8 | ############################################################################## 9 | 10 | use OF::Base; 11 | use Test::RegressTest; 12 | use strict; 13 | use OF::OFUtil; 14 | 15 | # check vars are set. 16 | check_OF_vars_set(); 17 | 18 | sub INT_Handler { 19 | my $signame = shift; 20 | print "\nNo interrupt handler implemented yet...\n"; 21 | print "\nExited with SIG$signame\n"; 22 | exit(1); 23 | } 24 | 25 | push (@ARGV, "--root=$ENV{'OFT_ROOT'}", "--map=$ENV{'OFT_ROOT'}/bin/eth.map", "--port_base=1", "--common-st-args=kmod"); 26 | 27 | run_regress_test( \&INT_Handler, @ARGV ); 28 | -------------------------------------------------------------------------------- /regress/bin/of_user_test.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | ############################################################################## 4 | # 5 | # Wrapper for OpenFlow regression tests 6 | # $Id: of_regress_test.pl 105 2008-06-06 04:07:05Z brandonh $ 7 | # 8 | ############################################################################## 9 | 10 | use OF::Base; 11 | use Test::RegressTest; 12 | use strict; 13 | use OF::OFUtil; 14 | 15 | # check vars are set. 16 | check_OF_vars_set(); 17 | 18 | sub INT_Handler { 19 | my $signame = shift; 20 | print "\nNo interrupt handler implemented yet...\n"; 21 | print "\nExited with SIG$signame\n"; 22 | exit(1); 23 | } 24 | 25 | push (@ARGV, "--root=$ENV{'OFT_ROOT'}", "--map=$ENV{'OFT_ROOT'}/bin/eth.map", "--port_base=1", "--common-st-args=user"); 26 | 27 | run_regress_test( \&INT_Handler, @ARGV ); 28 | -------------------------------------------------------------------------------- /lib/daemon.man: -------------------------------------------------------------------------------- 1 | .TP 2 | \fB-P\fR[\fIpidfile\fR], \fB--pidfile\fR[\fB=\fIpidfile\fR] 3 | Causes a file (by default, \fB\*(PN.pid\fR) to be created indicating 4 | the PID of the running process. If \fIpidfile\fR is not specified, or 5 | if it does not begin with \fB/\fR, then it is created in 6 | \fB@RUNDIR@\fR. 7 | 8 | .TP 9 | \fB-f\fR, \fB--force\fR 10 | By default, when \fB-P\fR or \fB--pidfile\fR is specified and the 11 | specified pidfile already exists and is locked by a running process, 12 | \fB\*(PN\fR refuses to start. Specify \fB-f\fR or \fB--force\fR 13 | to cause it to instead overwrite the pidfile. 14 | 15 | When \fB-P\fR or \fB--pidfile\fR is not specified, this option has no 16 | effect. 17 | 18 | .TP 19 | \fB-D\fR, \fB--detach\fR 20 | Causes \fB\*(PN\fR to detach itself from the foreground session and 21 | run as a background process. 22 | -------------------------------------------------------------------------------- /regress/bin/of_kmod_veth_test.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | ############################################################################## 4 | # 5 | # Wrapper for OpenFlow regression tests 6 | # $Id: of_regress_test.pl 105 2008-06-06 04:07:05Z brandonh $ 7 | # 8 | ############################################################################## 9 | 10 | use OF::Base; 11 | use Test::RegressTest; 12 | use strict; 13 | use OF::OFUtil; 14 | 15 | # check vars are set. 16 | check_OF_vars_set(); 17 | 18 | sub INT_Handler { 19 | my $signame = shift; 20 | print "\nNo interrupt handler implemented yet...\n"; 21 | print "\nExited with SIG$signame\n"; 22 | exit(1); 23 | } 24 | 25 | push (@ARGV, "--map=$ENV{'OFT_ROOT'}/bin/veth.map", "--root=$ENV{'OFT_ROOT'}", "--port_base=1", "--common-st-args=kmod_veth"); 26 | 27 | run_regress_test( \&INT_Handler, @ARGV ); 28 | -------------------------------------------------------------------------------- /regress/bin/of_user_veth_test.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | ############################################################################## 4 | # 5 | # Wrapper for OpenFlow regression tests 6 | # $Id: of_regress_test.pl 105 2008-06-06 04:07:05Z brandonh $ 7 | # 8 | ############################################################################## 9 | 10 | use OF::Base; 11 | use Test::RegressTest; 12 | use strict; 13 | use OF::OFUtil; 14 | 15 | # check vars are set. 16 | check_OF_vars_set(); 17 | 18 | sub INT_Handler { 19 | my $signame = shift; 20 | print "\nNo interrupt handler implemented yet...\n"; 21 | print "\nExited with SIG$signame\n"; 22 | exit(1); 23 | } 24 | 25 | push( @ARGV, "--map=$ENV{'OFT_ROOT'}/bin/veth.map", "--root=$ENV{'OFT_ROOT'}", "--port_base=1", "--common-st-args=user_veth"); 26 | 27 | run_regress_test( \&INT_Handler, @ARGV ); 28 | -------------------------------------------------------------------------------- /doc/of-spec/Makefile: -------------------------------------------------------------------------------- 1 | TARGET=openflow-spec-v1.0.0 2 | 3 | BIBTEX := bibtex 4 | TGIF := tgif 5 | XFIG := xfig 6 | GNUPLOT:= gnuplot 7 | 8 | SOURCES=openflow-spec-v1.0.0.tex\ 9 | appendix.tex 10 | 11 | all: $(TARGET).ps 12 | pdf: all 13 | 14 | $(TARGET).pdf: Makefile $(SOURCES) 15 | ./make_latex_input.pl 16 | texi2pdf $(TARGET).tex 17 | 18 | color: $(TARGET).pdf 19 | pdflatex $(TARGET).tex 20 | pdftops $(TARGET).pdf 21 | 22 | $(TARGET).ps: $(TARGET).pdf 23 | pdftops $(TARGET).pdf 24 | 25 | %.pdf : %.fig #Makefile 26 | fig2dev -L pdf -b 1 $< $@ 27 | 28 | %.eps : %.dia #Makefile 29 | dia --nosplash -e $@ $< 30 | 31 | %.eps : %.obj 32 | TMPDIR=/tmp $(TGIF) -print -eps $< 33 | 34 | 35 | %.pdf : %.eps #Makefile 36 | epstopdf $< 37 | 38 | clean: 39 | rm -f *.aux *.log *.out *.bbl *.blg *~ *.bak $(TARGET).ps $(TARGET).pdf 40 | rm -rf define enum struct 41 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_controller/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_controller 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_controller { 8 | 9 | forward_simple(@_, 'controller'); 10 | } 11 | 12 | sub forward_wc_controller_vlan { 13 | my $vlan_id = 0x4abc; 14 | #[15:13] priority, [11:0] vlan id 15 | #The value was chosen at random 16 | forward_simple(@_, 'controller', undef, undef, $vlan_id); 17 | } 18 | 19 | sub my_test { 20 | 21 | my ( $sock, $options_ref ) = @_; 22 | 23 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_controller); 24 | if ( not defined( $$options_ref{'no_vlan'} ) ) { 25 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_controller_vlan); 26 | } 27 | } 28 | 29 | run_black_box_test( \&my_test, \@ARGV ); 30 | 31 | -------------------------------------------------------------------------------- /regress/bin/of_nf2_test.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | ############################################################################## 4 | # 5 | # Wrapper for OpenFlow regression tests 6 | # $Id: of_regress_test.pl 105 2008-06-06 04:07:05Z brandonh $ 7 | # 8 | ############################################################################## 9 | 10 | use OF::Base; 11 | use Test::RegressTest; 12 | use strict; 13 | use OF::OFUtil; 14 | 15 | # check vars are set. 16 | check_OF_vars_set(); 17 | 18 | sub INT_Handler { 19 | my $signame = shift; 20 | print "\nNo interrupt handler implemented yet...\n"; 21 | print "\nExited with SIG$signame\n"; 22 | exit(1); 23 | } 24 | 25 | push (@ARGV, "--root=$ENV{'OFT_ROOT'}", "--map=$ENV{'OFT_ROOT'}/bin/nf2.map", "--port_base=1", "--common-st-args=nf2"); 26 | push @ARGV, "--no_slicing"; 27 | 28 | run_regress_test( \&INT_Handler, @ARGV ); 29 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_controller/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_controller 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | use strict; 8 | use OF::Includes; 9 | 10 | sub forward_controller { 11 | 12 | forward_simple(@_, 'controller'); 13 | } 14 | 15 | sub forward_controller_vlan { 16 | my $vlan_id = 0xc123; 17 | #[15:13] priority, [11:0] vlan id 18 | #The value was chosen at random 19 | forward_simple(@_, 'controller', undef, undef, $vlan_id); 20 | } 21 | 22 | sub my_test { 23 | 24 | my ( $sock, $options_ref ) = @_; 25 | 26 | for_all_ports( $ofp, $sock, $options_ref, \&forward_controller, 0x0); 27 | if ( not defined( $$options_ref{'no_vlan'} ) ) { 28 | for_all_ports( $ofp, $sock, $options_ref, \&forward_controller_vlan, 0x0); 29 | } 30 | } 31 | 32 | run_black_box_test( \&my_test, \@ARGV ); 33 | -------------------------------------------------------------------------------- /debian/openflow-switch.README.Debian: -------------------------------------------------------------------------------- 1 | README.Debian for openflow-switch 2 | --------------------------------- 3 | 4 | * The switch must be configured before it can be used. To configure 5 | it interactively, install the openflow-switch-config package and run 6 | the ofp-switch-setup program. Alternatively, edit 7 | /etc/default/openflow-switch by hand, then start the switch manually 8 | with "/etc/init.d/openflow-switch start". 9 | 10 | * To use the Linux kernel-based switch implementation, you will need 11 | to build and install the OpenFlow kernel module. To do so, install 12 | the openflow-datapath-source package, then follow the instructions 13 | given in /usr/share/doc/openflow-datapath-source/README.Debian 14 | 15 | * This package does not yet support the userspace datapath-based 16 | switch implementation. 17 | 18 | -- Ben Pfaff , Tue, 6 Jan 2009 13:52:33 -0800 19 | -------------------------------------------------------------------------------- /README.kernel: -------------------------------------------------------------------------------- 1 | Kernel-mode Support -*- text -*- 2 | ------------------- 3 | 4 | The OpenFlow reference implementation no longer includes a kernel module 5 | that implements the datapath. A separate release with kernel-mode support 6 | is expected in 1H2010. 7 | 8 | The release you downloaded *may* include the kernel module source files 9 | depending upon the method used to obtain the release. If you downloaded the 10 | release as a compressed tar file (.tar.gz) then you will *not* have the 11 | source for the kernel module. If you downloaded the release directly from 12 | git then you will have the source. 13 | 14 | Please note that if you obtained the release via git that the kernel module 15 | source is not built by default and does not implement all features. 16 | 17 | Please check the OpenFlow website or subscribe to the openflow-announce 18 | mailing list for updates on the kernel-mode implementation. 19 | -------------------------------------------------------------------------------- /regress/lib/Perl5/Test/Base.pm: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # $Id: Base.pm 3909 2008-06-06 03:31:57Z brandonh $ 3 | # 4 | # Module provides basic functions for use by NF2 Perl scripts. 5 | # 6 | # Revisions: 7 | # 8 | ############################################################## 9 | 10 | package Test::Base; 11 | use Exporter; 12 | @ISA = ('Exporter'); 13 | @EXPORT = qw( &check_NF2_vars_set 14 | ); 15 | 16 | ############################################################## 17 | # 18 | # Define a my_die function if it doesn't already exist 19 | # 20 | ############################################################## 21 | 22 | if (!defined(&my_die)) { 23 | eval(' 24 | sub my_die { 25 | my $mess = shift @_; 26 | (my $cmd = $0) =~ s/.*\///; 27 | print STDERR "\n$cmd: $mess\n"; 28 | exit 1; 29 | } 30 | '); 31 | } 32 | 33 | # Always end library in 1 34 | 1; 35 | -------------------------------------------------------------------------------- /tests/test-stp-ieee802.1d-2004-fig17.4: -------------------------------------------------------------------------------- 1 | # This is the STP example from IEEE 802.1D-2004 figures 17.4 and 17.5. 2 | bridge 0 0x111 = a b e c 3 | bridge 1 0x222 = a b d f 4 | bridge 2 0x333 = c d l j h g 5 | bridge 3 0x444 = e f n m k i 6 | bridge 4 0x555 = g i 0 0 7 | bridge 5 0x666 = h k 0 0 8 | bridge 6 0x777 = j m 0 0 9 | bridge 7 0x888 = l n 0 0 10 | run 1000 11 | check 0 = root 12 | check 1 = F:10 B F F 13 | check 2 = F:10 B F F F F 14 | check 3 = F:10 B F F F F 15 | check 4 = F:20 B F F 16 | check 5 = F:20 B F F 17 | check 6 = F:20 B F F 18 | check 7 = F:20 B F F 19 | 20 | # Now connect two ports of bridge 7 to the same LAN. 21 | bridge 7 = l n o o 22 | # Same results except for bridge 7: 23 | run 1000 24 | check 0 = root 25 | check 1 = F:10 B F F 26 | check 2 = F:10 B F F F F 27 | check 3 = F:10 B F F F F 28 | check 4 = F:20 B F F 29 | check 5 = F:20 B F F 30 | check 6 = F:20 B F F 31 | check 7 = F:20 B F B 32 | -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | *.debhelper 2 | *.debhelper.log 3 | *.substvars 4 | /automake.mk 5 | /control 6 | /corekeeper 7 | /files 8 | /nicira-switch 9 | /openflow 10 | /openflow-common 11 | /openflow-common.copyright 12 | /openflow-controller 13 | /openflow-datapath-source 14 | /openflow-dbg 15 | /openflow-monitor 16 | /openflow-monitor.copyright 17 | /openflow-monitor.default 18 | /openflow-monitor.dirs 19 | /openflow-monitor.init 20 | /openflow-monitor.install 21 | /openflow-pki 22 | /openflow-pki-server 23 | /openflow-switch 24 | /openflow-switch-config 25 | /openflow-switch.copyright 26 | /openflow-switchui 27 | /openflow-switchui.copyright 28 | /openflow-switchui.default 29 | /openflow-switchui.dirs 30 | /openflow-switchui.init 31 | /openflow-switchui.install 32 | /openflow-wdt 33 | /openflow-wdt.copyright 34 | /openflow-wdt.default 35 | /openflow-wdt.dirs 36 | /openflow-wdt.init 37 | /openflow-wdt.install 38 | /rules.ext 39 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/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 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) 8 | 9 | /* Same as above, but does so with platform independent 64bit types. 10 | * These must be used when utilizing jiffies_64 (i.e. return value of 11 | * get_jiffies_64() */ 12 | #define time_after64(a,b) \ 13 | (typecheck(__u64, a) && \ 14 | typecheck(__u64, b) && \ 15 | ((__s64)(b) - (__s64)(a) < 0)) 16 | #define time_before64(a,b) time_after64(b,a) 17 | 18 | #define time_after_eq64(a,b) \ 19 | (typecheck(__u64, a) && \ 20 | typecheck(__u64, b) && \ 21 | ((__s64)(a) - (__s64)(b) >= 0)) 22 | #define time_before_eq64(a,b) time_after_eq64(b,a) 23 | 24 | #endif /* linux kernel < 2.6.19 */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /regress/projects/learning_switch/regress/test_unicast_unknown/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | #test_unicast_unknown 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub my_test { 8 | 9 | my $pkt_args = { 10 | DA => "00:00:00:00:00:02", 11 | SA => "00:00:00:00:00:01", 12 | src_ip => "192.168.0.40", 13 | dst_ip => "192.168.1.40", 14 | ttl => 64, 15 | len => 64 16 | }; 17 | my $pkt = new NF2::IP_pkt(%$pkt_args); 18 | 19 | my %delta; 20 | 21 | # send one packet; controller should learn MAC, add a flow 22 | # entry, and send this packet out the other interfaces 23 | print "Sending now: \n"; 24 | send_and_count( 'eth1', $pkt->packed, \%delta ); 25 | expect_and_count( 'eth2', $pkt->packed, \%delta ); 26 | expect_and_count( 'eth3', $pkt->packed, \%delta ); 27 | expect_and_count( 'eth4', $pkt->packed, \%delta ); 28 | 29 | return %delta; 30 | } 31 | 32 | run_learning_switch_test( \&my_test, \@ARGV ); 33 | -------------------------------------------------------------------------------- /regress/bin/of_ovs_user_teardown.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # Jean Tourrilhes - HP-Labs 3 | 4 | use Getopt::Long; 5 | 6 | use OF::OFUtil; 7 | use Test::TestLib; 8 | 9 | my $mapFile; 10 | 11 | # Process command line options 12 | unless ( GetOptions( "map=s" => \$mapFile, ) ) { 13 | print "unrecognized option\n"; 14 | exit 1; 15 | } 16 | 17 | # If not specified on command line, use enviroment variable. 18 | # Try specific first, then try generic - Jean II 19 | if ( (! defined($mapFile) ) && (defined($ENV{'OFT_OVS_MAP_ETH'})) ) { 20 | $mapFile = "$ENV{OFT_OVS_MAP_ETH}"; 21 | } 22 | if ( (! defined($mapFile) ) && (defined($ENV{'OFT_MAP_ETH'})) ) { 23 | $mapFile = "$ENV{OFT_MAP_ETH}"; 24 | } 25 | 26 | if ( defined($mapFile) ) { 27 | nftest_process_iface_map($mapFile); 28 | } 29 | 30 | # Get the directly where Open vSwitch resides 31 | my $ovs_dir = $ENV{'OFT_OVS_ROOT'}; 32 | 33 | # Just kill ovs-openflowd 34 | `killall ovs-openflowd`; 35 | -------------------------------------------------------------------------------- /secchan/automake.mk: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS += secchan/ofprotocol 2 | man_MANS += secchan/ofprotocol.8 3 | 4 | secchan_ofprotocol_SOURCES = \ 5 | secchan/discovery.c \ 6 | secchan/discovery.h \ 7 | secchan/emerg-flow.c \ 8 | secchan/emerg-flow.h \ 9 | secchan/fail-open.c \ 10 | secchan/fail-open.h \ 11 | secchan/failover.c \ 12 | secchan/failover.h \ 13 | secchan/in-band.c \ 14 | secchan/in-band.h \ 15 | secchan/port-watcher.c \ 16 | secchan/port-watcher.h \ 17 | secchan/protocol-stat.c \ 18 | secchan/protocol-stat.h \ 19 | secchan/ratelimit.c \ 20 | secchan/ratelimit.h \ 21 | secchan/secchan.c \ 22 | secchan/secchan.h \ 23 | secchan/status.c \ 24 | secchan/status.h \ 25 | secchan/stp-secchan.c \ 26 | secchan/stp-secchan.h 27 | secchan_ofprotocol_LDADD = lib/libopenflow.a $(FAULT_LIBS) $(SSL_LIBS) 28 | 29 | EXTRA_DIST += secchan/ofprotocol.8.in 30 | DISTCLEANFILES += secchan/ofprotocol.8 31 | 32 | include secchan/commands/automake.mk 33 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_flow_expired/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_flow_expired 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub my_test { 8 | 9 | my ($sock, $options_ref) = @_; 10 | 11 | my $in_port = $$options_ref{'port_base'}; 12 | my $out_port = $in_port + 1; 13 | 14 | my $test_pkt = get_default_black_box_pkt( $in_port, $out_port); 15 | 16 | my $max_idle = 0x1; # second before flow expiration 17 | my $wildcards = 0x0; # exact match 18 | my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry 19 | my $flow_mod_pkt = 20 | create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); 21 | 22 | #print HexDump($pkt); 23 | 24 | # Send 'flow_mod' message 25 | print $sock $flow_mod_pkt; 26 | 27 | my $pkt_len = 0; 28 | my $pkt_total = 0; 29 | wait_for_flow_expired( $ofp, $sock, $options_ref, $pkt_len, $pkt_total ); 30 | 31 | } 32 | 33 | run_black_box_test( \&my_test, \@ARGV ); 34 | 35 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_flow_expired_idle_timeout/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_flow_expired 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub my_test { 8 | 9 | my ($sock, $options_ref) = @_; 10 | 11 | my $in_port = $$options_ref{'port_base'}; 12 | my $out_port = $in_port + 1; 13 | 14 | my $test_pkt = get_default_black_box_pkt( $in_port, $out_port); 15 | 16 | my $max_idle = 0x1; # second before flow expiration 17 | my $wildcards = 0x0; # exact match 18 | my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; 19 | my $flow_mod_pkt = 20 | create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); 21 | 22 | #print HexDump($pkt); 23 | 24 | # Send 'flow_mod' message 25 | print $sock $flow_mod_pkt; 26 | 27 | my $pkt_len = 0; 28 | my $pkt_total = 0; 29 | wait_for_flow_expired( $ofp, $sock, $options_ref, $pkt_len, $pkt_total, $max_idle ); 30 | 31 | } 32 | 33 | run_black_box_test( \&my_test, \@ARGV ); 34 | 35 | -------------------------------------------------------------------------------- /regress/scripts/install_perlmods_apt.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -W 2 | # Script to automatically download, make, and install required Perl modules 3 | # for OpenFlow regression tests. 4 | 5 | use strict; 6 | use File::Basename; 7 | 8 | my @module_paths = ( 9 | 'http://search.cpan.org/CPAN/authors/id/S/SA/SAPER/Net-Pcap-0.14.tar.gz', 10 | 'http://search.cpan.org/CPAN/authors/id/S/SZ/SZABGAB/Net-RawIP-0.21.tar.gz', 11 | 'http://search.cpan.org/CPAN/authors/id/M/MH/MHX/Convert-Binary-C-0.71.tar.gz', 12 | 'http://search.cpan.org/CPAN/authors/id/F/FT/FTASSIN/Data-HexDump-0.02.tar.gz', 13 | ); 14 | 15 | mkdir "perl_modules"; 16 | chdir "perl_modules"; 17 | 18 | foreach my $path (@module_paths) { 19 | `wget $path`; 20 | my $module = fileparse($path); 21 | `tar xzf $module`; 22 | $module =~ s/.tar.gz//; 23 | print "compiling $module\n"; 24 | chdir $module; 25 | print `perl Makefile.PL`; 26 | print `make`; 27 | print `make install`; 28 | chdir '../'; 29 | } 30 | 31 | print "finished\n"; 32 | 33 | -------------------------------------------------------------------------------- /debian/openflow-datapath-source.README.Debian: -------------------------------------------------------------------------------- 1 | OpenFlow 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 openflow 9 | or 10 | $ m-a a-i openflow 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 openflow.tar.bz2 19 | $ cd /usr/src/kernel-source-2.6.9 20 | $ make-kpkg --added-modules=openflow modules 21 | 22 | - Building without make-kpkg 23 | 24 | $ cd /usr/src/ 25 | $ tar jxvf openflow.tar.bz2 26 | $ cd modules/openflow 27 | $ fakeroot debian/rules kdist_image 28 | 29 | If you run this as root, fakeroot is not needed. 30 | 31 | -- OpenFlow Team , Thu, 12 Jun 2008 16:42:38 -0700 32 | -------------------------------------------------------------------------------- /tests/test-stp-iol-io-1.5: -------------------------------------------------------------------------------- 1 | # This test file approximates the following test from "Bridge 2 | # Functions Consortium Spanning Tree Interoperability Test Suite 3 | # Version 1.5": 4 | # STP.io.1.5: Topology Change 5 | bridge 0 0x111 = a b d c 6 | bridge 1 0x222 = a b f e 7 | bridge 2 0x333 = c d g h 8 | bridge 3 0x444 = e f g h 9 | run 1000 10 | check 0 = root 11 | check 1 = F:10 B F F 12 | check 2 = B F:10 F F 13 | check 3 = B F:20 B B 14 | bridge 1^0x7000 15 | run 1000 16 | check 0 = F:10 B F F 17 | check 1 = root 18 | check 2 = B F:20 B B 19 | check 3 = B F:10 F F 20 | bridge 2^0x6000 21 | run 1000 22 | check 0 = F F B F:10 23 | check 1 = F:20 B B B 24 | check 2 = root 25 | check 3 = F F F:10 B 26 | bridge 3^0x5000 27 | run 1000 28 | check 0 = B B B F:20 29 | check 1 = F F B F:10 30 | check 2 = F F F:10 B 31 | check 3 = root 32 | bridge 0^0x4000 33 | bridge 1^0x4001 34 | bridge 2^0x4002 35 | bridge 3^0x4003 36 | run 1000 37 | check 0 = root 38 | check 1 = F:10 B F F 39 | check 2 = B F:10 F F 40 | check 3 = B F:20 B B 41 | -------------------------------------------------------------------------------- /regress/projects/learning_switch/regress/common/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use Test::TestLib; 6 | use OF::OFUtil; 7 | 8 | my $mapFile; 9 | my $platform; 10 | my $args; 11 | 12 | # Process command line options 13 | unless ( 14 | GetOptions ( 15 | "map=s" => \$mapFile, 16 | "common-st-args=s" => \$platform, 17 | ) 18 | ) 19 | { 20 | print "invalid command format\n"; 21 | exit(1); 22 | } 23 | 24 | if (defined($mapFile)) { 25 | $args = "--map=$mapFile"; 26 | } 27 | 28 | if (!defined($platform)) { 29 | print "no platform defined\n"; 30 | exit(1); 31 | } 32 | else { 33 | print "platform = $platform\n"; 34 | } 35 | 36 | my $filename = "of_${platform}_setup.pl"; 37 | 38 | # exit if of_${platform}_setup.pl not in path 39 | if (-e "$ENV{'OFT_ROOT'}/bin/$filename") { 40 | system("$ENV{'OFT_ROOT'}/bin/$filename " . $args . " 2> /dev/null > /dev/null"); 41 | #setup_kmod(); 42 | exit (0); 43 | } else { 44 | print "couldn't find setup file $filename\n"; 45 | exit (1); 46 | } 47 | -------------------------------------------------------------------------------- /regress/projects/learning_switch/regress/common/teardown: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use Test::TestLib; 6 | use OF::OFUtil; 7 | 8 | my $mapFile; 9 | my $platform; 10 | my $args; 11 | 12 | # Process command line options 13 | unless ( 14 | GetOptions ( 15 | "map=s" => \$mapFile, 16 | "common-st-args=s" => \$platform, 17 | ) 18 | ) 19 | { 20 | print "invalid command format\n"; 21 | exit(1); 22 | } 23 | 24 | if (defined($mapFile)) { 25 | $args = "map=$mapFile"; 26 | } 27 | 28 | if (!defined($platform)) { 29 | print "no platform defined\n"; 30 | exit(1); 31 | } 32 | else { 33 | print "platform = $platform\n"; 34 | } 35 | 36 | my $filename = "of_${platform}_teardown.pl"; 37 | 38 | # exit if of_${platform}_setup.pl not in path 39 | if (-e "$ENV{'OFT_ROOT'}/bin/$filename") { 40 | system("$ENV{'OFT_ROOT'}/bin/$filename " . $args . " 2> /dev/null > /dev/null"); 41 | #teardown_kmod(); 42 | exit (0); 43 | } else { 44 | print "couldn't find setup file $filename\n"; 45 | exit (1); 46 | } 47 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/common/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use Test::TestLib; 6 | use OF::OFUtil; 7 | 8 | my $mapFile; 9 | my $platform; 10 | my $args; 11 | 12 | # Process command line options 13 | unless ( 14 | GetOptions ( 15 | "map=s" => \$mapFile, 16 | "common-st-args=s" => \$platform, 17 | ) 18 | ) 19 | { 20 | print "invalid command format\n"; 21 | exit(1); 22 | } 23 | 24 | if (defined($mapFile)) { 25 | $args = "--map=$mapFile"; 26 | } 27 | 28 | if (!defined($platform)) { 29 | print "no platform defined\n"; 30 | exit(1); 31 | } 32 | else { 33 | print "platform = $platform\n"; 34 | } 35 | 36 | my $filename = "of_${platform}_setup.pl"; 37 | 38 | # exit if of_${platform}_setup.pl not in path 39 | if (-e "$ENV{'OFT_ROOT'}/bin/$filename") { 40 | #system("$filename " . $args . " 2> /dev/null > /dev/null"); 41 | system("$ENV{'OFT_ROOT'}/bin/$filename " . $args ); 42 | #setup_kmod(); 43 | exit (0); 44 | } else { 45 | print "couldn't find setup file $filename\n"; 46 | exit (1); 47 | } 48 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/common/teardown: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use Test::TestLib; 6 | use OF::OFUtil; 7 | 8 | my $mapFile; 9 | my $platform; 10 | my $args; 11 | 12 | # Process command line options 13 | unless ( 14 | GetOptions ( 15 | "map=s" => \$mapFile, 16 | "common-st-args=s" => \$platform, 17 | ) 18 | ) 19 | { 20 | print "invalid command format\n"; 21 | exit(1); 22 | } 23 | 24 | if (defined($mapFile)) { 25 | $args = "--map=$mapFile"; 26 | } 27 | 28 | if (!defined($platform)) { 29 | print "no platform defined\n"; 30 | exit(1); 31 | } 32 | else { 33 | print "platform = $platform\n"; 34 | } 35 | 36 | my $filename = "of_${platform}_teardown.pl"; 37 | 38 | # exit if of_${platform}_setup.pl not in path 39 | if (-e "$ENV{'OFT_ROOT'}/bin/$filename") { 40 | #system("$filename " . $args . " 2> /dev/null > /dev/null"); 41 | system("$ENV{'OFT_ROOT'}/bin/$filename " . $args ); 42 | #teardown_kmod(); 43 | exit (0); 44 | } else { 45 | print "couldn't find setup file $filename\n"; 46 | exit (1); 47 | } 48 | -------------------------------------------------------------------------------- /regress/projects/controller_disconnect/regress/common/teardown: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use Test::TestLib; 6 | use OF::OFUtil; 7 | 8 | my $mapFile; 9 | my $platform; 10 | my $args; 11 | 12 | # Process command line options 13 | unless ( 14 | GetOptions ( 15 | "map=s" => \$mapFile, 16 | "common-st-args=s" => \$platform, 17 | ) 18 | ) 19 | { 20 | print "invalid command format\n"; 21 | exit(1); 22 | } 23 | 24 | if (defined($mapFile)) { 25 | $args = "--map=$mapFile"; 26 | } 27 | 28 | if (!defined($platform)) { 29 | print "no platform defined\n"; 30 | exit(1); 31 | } 32 | else { 33 | print "platform = $platform\n"; 34 | } 35 | 36 | my $filename = "of_${platform}_teardown.pl"; 37 | 38 | # exit if of_${platform}_setup.pl not in path 39 | if (-e "$ENV{'OFT_ROOT'}/bin/$filename") { 40 | #system("$filename " . $args . " 2> /dev/null > /dev/null"); 41 | system("$ENV{'OFT_ROOT'}/bin/$filename " . $args ); 42 | #teardown_kmod(); 43 | exit (0); 44 | } else { 45 | print "couldn't find setup file $filename\n"; 46 | exit (1); 47 | } 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /regress/projects/controller_disconnect/regress/common/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use Test::TestLib; 6 | use OF::OFUtil; 7 | 8 | my $mapFile; 9 | my $platform; 10 | my $args; 11 | 12 | # Process command line options 13 | unless ( 14 | GetOptions ( 15 | "map=s" => \$mapFile, 16 | "common-st-args=s" => \$platform, 17 | ) 18 | ) 19 | { 20 | print "invalid command format\n"; 21 | exit(1); 22 | } 23 | 24 | if (defined($mapFile)) { 25 | $args = "--map=$mapFile"; 26 | } 27 | 28 | if (!defined($platform)) { 29 | print "no platform defined\n"; 30 | exit(1); 31 | } 32 | else { 33 | print "platform = $platform\n"; 34 | } 35 | 36 | $args .= " --emerg"; 37 | 38 | my $filename = "of_${platform}_setup.pl"; 39 | 40 | # exit if of_${platform}_setup.pl not in path 41 | if (-e "$ENV{'OFT_ROOT'}/bin/$filename") { 42 | #system("$filename " . $args . " 2> /dev/null > /dev/null"); 43 | system("$ENV{'OFT_ROOT'}/bin/$filename " . $args ); 44 | #setup_kmod(); 45 | exit (0); 46 | } else { 47 | print "couldn't find setup file $filename\n"; 48 | exit (1); 49 | } 50 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/ber.h: -------------------------------------------------------------------------------- 1 | /* ber.h 2 | * 3 | * Basic Encoding Rules (BER) file reading 4 | * 5 | * $Id: ber.h 3992 2008-06-10 03:13:11Z dgu $ 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | * 21 | */ 22 | 23 | #ifndef __BER_H__ 24 | #define __BER_H__ 25 | 26 | int ber_open(wtap *wth, int *err, gchar **err_info); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /datapath/dp_notify.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Distributed under the terms of the GNU GPL version 2. 3 | * Copyright (c) 2007, 2008, 2009 The Board of Trustees of The Leland 4 | * Stanford Junior University 5 | */ 6 | 7 | /* Handle changes to managed devices */ 8 | 9 | #include 10 | 11 | #include "datapath.h" 12 | 13 | 14 | static int dp_device_event(struct notifier_block *unused, unsigned long event, 15 | void *ptr) 16 | { 17 | struct net_device *dev = ptr; 18 | struct net_bridge_port *p = dev->br_port; 19 | unsigned long int flags; 20 | 21 | 22 | /* Check if monitored port */ 23 | if (!p) 24 | return NOTIFY_DONE; 25 | 26 | spin_lock_irqsave(&p->lock, flags); 27 | switch (event) { 28 | case NETDEV_UNREGISTER: 29 | spin_unlock_irqrestore(&p->lock, flags); 30 | mutex_lock(&dp_mutex); 31 | dp_del_switch_port(p); 32 | mutex_unlock(&dp_mutex); 33 | return NOTIFY_DONE; 34 | break; 35 | } 36 | spin_unlock_irqrestore(&p->lock, flags); 37 | 38 | return NOTIFY_DONE; 39 | } 40 | 41 | struct notifier_block dp_device_notifier = { 42 | .notifier_call = dp_device_event 43 | }; 44 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_cookie_flow_expired/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_flow_expired 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub my_test { 8 | 9 | my ($sock, $options_ref) = @_; 10 | 11 | my $in_port = $$options_ref{'port_base'}; 12 | my $out_port = $in_port + 1; 13 | 14 | my $test_pkt = get_default_black_box_pkt( $in_port, $out_port); 15 | 16 | my $max_idle = 0x1; # second before flow expiration 17 | my $wildcards = 0x0; # exact match 18 | my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry 19 | my $cookie = 0x123456; 20 | # Create a flow mod with a flow cookie 21 | my $flow_mod_pkt = 22 | create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, 23 | $max_idle, $flags, $wildcards, undef, undef, undef, 24 | undef, $cookie ); 25 | 26 | #print HexDump($pkt); 27 | 28 | # Send 'flow_mod' message 29 | print $sock $flow_mod_pkt; 30 | 31 | my $pkt_len = 0; 32 | my $pkt_total = 0; 33 | wait_for_flow_expired( $ofp, $sock, $options_ref, $pkt_len, 34 | $pkt_total, undef, $cookie ); 35 | 36 | } 37 | 38 | run_black_box_test( \&my_test, \@ARGV ); 39 | 40 | -------------------------------------------------------------------------------- /hw-lib/skeleton/of_hw_platform.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_LIB_SKELETON_PLATFORM_H 2 | #define HW_LIB_SKELETON_PLATFORM_H 1 3 | 4 | #if defined(OF_HW_DP_MAIN) 5 | #define P printf 6 | #else 7 | #define P printf 8 | #endif 9 | 10 | /* 11 | * General Hardware Switch platform defines 12 | * 13 | * Also includes platform specific definitions based on make defines 14 | */ 15 | 16 | #define OF_HW_MAX_PORT 64 17 | 18 | /* Reasons that a packet is being forwarded to the controller; */ 19 | #define CPU_REASON_DEFAULT (1 << 0) 20 | #define CPU_REASON_TO_CONTROLLER (1 << 1) 21 | #define CPU_REASON_TO_LOCAL (1 << 2) 22 | 23 | #define EXACT_MATCH_PRIORITY TBD 24 | 25 | /**************************************************************** 26 | * 27 | * Platform specific defines and linkage 28 | * 29 | * Implicitly we have a "driver" for the board which includes 30 | * hardware specific information including HW to OF port mapping 31 | * 32 | ****************************************************************/ 33 | 34 | #if defined(OF_SAMPLE_PLAT) 35 | #include "sample_plat.h" 36 | #endif 37 | 38 | #endif /* HW_LIB_SKELETON_PLATFORM_H */ 39 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_wildcard_modify_action/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_wildcard_modify_action 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_wc_port { 8 | my @chg_field = ('vlan_vid', 'vlan_pcp','dl_src', 'dl_dst', 'nw_src', 'nw_dst', 'tp_src', 'tp_dst'); 9 | foreach (@chg_field) { 10 | forward_simple(@_, 'port', undef, $_ ); 11 | } 12 | } 13 | 14 | 15 | sub forward_wc_port_vlan { 16 | my @chg_field = ('strip_vlan', 'vlan_vid','vlan_pcp','dl_src', 'dl_dst', 'nw_src', 'nw_dst', 'tp_src', 'tp_dst'); 17 | my $vlan_id = 0xa344; 18 | #The value was chosen at random 19 | foreach (@chg_field) { 20 | forward_simple(@_, 'port', undef, $_, $vlan_id); 21 | } 22 | } 23 | 24 | sub my_test { 25 | 26 | my ( $sock, $options_ref ) = @_; 27 | 28 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_port); 29 | if ( not defined( $$options_ref{'no_vlan'} ) ) { 30 | for_all_wildcards( $ofp, $sock, $options_ref, \&forward_wc_port_vlan); 31 | } 32 | } 33 | 34 | run_black_box_test( \&my_test, \@ARGV ); 35 | 36 | -------------------------------------------------------------------------------- /utilities/ofp-pki-cgi.in: -------------------------------------------------------------------------------- 1 | #! @PERL@ 2 | 3 | use CGI; 4 | use Digest::SHA1; 5 | use Fcntl; 6 | 7 | $CGI::POST_MAX = 65536; # Limit POSTs to 64 kB. 8 | 9 | use strict; 10 | use warnings; 11 | 12 | my $pkidir = '@PKIDIR@'; 13 | my $q = new CGI; 14 | 15 | die unless $q->request_method() eq 'POST'; 16 | 17 | my $type = $q->param('type'); 18 | die unless defined $type; 19 | die unless $type eq 'switch' or $type eq 'controller'; 20 | 21 | my $req = $q->param('req'); 22 | die unless defined $req; 23 | die unless $req =~ /^-----BEGIN CERTIFICATE REQUEST-----$/m; 24 | die unless $req =~ /^-----END CERTIFICATE REQUEST-----$/m; 25 | 26 | my $digest = Digest::SHA1::sha1_hex($req); 27 | my $incoming = "$pkidir/${type}ca/incoming"; 28 | my $dst = "$incoming/$digest-req.pem"; 29 | 30 | sysopen(REQUEST, "$dst.tmp", O_RDWR | O_CREAT | O_EXCL, 0600) 31 | or die "sysopen $dst.tmp: $!"; 32 | print REQUEST $req; 33 | close(REQUEST) or die "close $dst.tmp: $!"; 34 | 35 | rename("$dst.tmp", $dst) or die "rename $dst.tmp to $dst: $!"; 36 | 37 | print $q->header('text/html', '204 No response'); 38 | 39 | # Local Variables: 40 | # mode: perl 41 | # End: 42 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/crypt/crypt-md4.h: -------------------------------------------------------------------------------- 1 | /* 2 | Unix SMB/CIFS implementation. 3 | a implementation of MD4 designed for use in the SMB authentication protocol 4 | Copyright (C) Andrew Tridgell 1997-1998. 5 | 6 | $Id: crypt-md4.h 3992 2008-06-10 03:13:11Z dgu $ 7 | 8 | This program is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | void crypt_md4(unsigned char *out, const unsigned char *in, int n); 24 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/hcidump.h: -------------------------------------------------------------------------------- 1 | /* hcidump.h 2 | * 3 | * $Id: hcidump.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Copyright (c) 2003 by Marcel Holtmann 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | * 21 | */ 22 | 23 | #ifndef __HCIDUMP_H__ 24 | #define __HCIDUMP_H__ 25 | 26 | int hcidump_open(wtap *wth, int *err, gchar **err_info); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/pppdump.h: -------------------------------------------------------------------------------- 1 | /* pppdump.h 2 | * 3 | * $Id: pppdump.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Copyright (c) 2000 by Gilbert Ramirez 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | * 21 | */ 22 | 23 | #ifndef __PPPDUMP_H__ 24 | #define __PPPDUMP_H__ 25 | 26 | int pppdump_open(wtap *wth, int *err, gchar **err_info); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/crc6.h: -------------------------------------------------------------------------------- 1 | /* 2 | * crc6.h 3 | * 4 | * $Id: crc6.h 3992 2008-06-10 03:13:11Z dgu $ 5 | * 6 | * Wireshark - Network traffic analyzer 7 | * By Gerald Combs 8 | * Copyright 1998 Gerald Combs 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 23 | */ 24 | 25 | extern guint16 update_crc6_by_bytes(guint16 crc6, guint8 byte1, guint8 byte2); 26 | 27 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/csids.h: -------------------------------------------------------------------------------- 1 | /* csids.h 2 | * 3 | * $Id: csids.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Copyright (c) 2000 by Mike Hall 6 | * Copyright (c) Cisco Systems 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __CSIDS_H__ 25 | #define __CSIDS_H__ 26 | 27 | int csids_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/vms.h: -------------------------------------------------------------------------------- 1 | /* vms.h 2 | * 3 | * $Id: vms.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 2001 by Marc Milgram 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __W_VMS_H__ 25 | #define __W_VMS_H__ 26 | 27 | int vms_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/radcom.h: -------------------------------------------------------------------------------- 1 | /* radcom.h 2 | * 3 | * $Id: radcom.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __RADCOM_H__ 25 | #define __RADCOM_H__ 26 | 27 | int radcom_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/toshiba.h: -------------------------------------------------------------------------------- 1 | /* toshiba.h 2 | * 3 | * $Id: toshiba.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __W_TOSHIBA_H__ 24 | #define __W_TOSHIBA_H__ 25 | 26 | int toshiba_open(wtap *wth, int *err, gchar **err_info); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/eyesdn.h: -------------------------------------------------------------------------------- 1 | /* eyesdn.h 2 | * 3 | * $Id: eyesdn.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __W_EYESDN_H__ 25 | #define __W_EYESDN_H__ 26 | 27 | int eyesdn_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/iptrace.h: -------------------------------------------------------------------------------- 1 | /* iptrace.h 2 | * 3 | * $Id: iptrace.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __IPTRACE_H__ 25 | #define __IPTRACE_H__ 26 | 27 | int iptrace_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/iseries.h: -------------------------------------------------------------------------------- 1 | /* iseries.h 2 | * 3 | * $Id: iseries.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 2005 by Martin Warnes 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __W_ISERIES_H__ 24 | #define __W_ISERIES_H__ 25 | 26 | int iseries_open(wtap *wth, int *err, gchar **err_info); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/i4btrace.h: -------------------------------------------------------------------------------- 1 | /* i4btrace.h 2 | * 3 | * $Id: i4btrace.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1999 by Bert Driehuis 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __I4BTRACE_H__ 25 | #define __I4BTRACE_H__ 26 | 27 | int i4btrace_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/dfilter/semcheck.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: semcheck.h 3992 2008-06-10 03:13:11Z dgu $ 3 | * 4 | * Wireshark - Network traffic analyzer 5 | * By Gerald Combs 6 | * Copyright 2001 Gerald Combs 7 | * 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | */ 23 | 24 | #ifndef SEMCHECK_H 25 | #define SEMCHECK_H 26 | 27 | gboolean 28 | dfw_semcheck(dfwork_t *dfw); 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /datapath/crc32.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Distributed under the terms of the GNU GPL version 2. 3 | * Copyright (c) 2007, 2008 The Board of Trustees of The Leland 4 | * Stanford Junior University 5 | */ 6 | 7 | #include 8 | #include "crc32.h" 9 | 10 | void crc32_init(struct crc32 *crc, unsigned int polynomial) 11 | { 12 | int i; 13 | 14 | for (i = 0; i < CRC32_TABLE_SIZE; ++i) { 15 | unsigned int reg = i << 24; 16 | int j; 17 | for (j = 0; j < CRC32_TABLE_BITS; j++) { 18 | int topBit = (reg & 0x80000000) != 0; 19 | reg <<= 1; 20 | if (topBit) 21 | reg ^= polynomial; 22 | } 23 | crc->table[i] = reg; 24 | } 25 | } 26 | 27 | EXPORT_SYMBOL(crc32_init); 28 | 29 | unsigned int crc32_calculate(const struct crc32 *crc, 30 | const void *data_, size_t n_bytes) 31 | { 32 | // FIXME: this can be optimized by unrolling, see linux-2.6/lib/crc32.c. 33 | const uint8_t *data = data_; 34 | unsigned int result = 0; 35 | size_t i; 36 | 37 | for (i = 0; i < n_bytes; i++) { 38 | unsigned int top = result >> 24; 39 | top ^= data[i]; 40 | result = (result << 8) ^ crc->table[top]; 41 | } 42 | return result; 43 | } 44 | 45 | EXPORT_SYMBOL(crc32_calculate); 46 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/compat26.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPAT26_H 2 | #define __COMPAT26_H 1 3 | 4 | #include 5 | 6 | #if defined(CONFIG_PREEMPT) && LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21) 7 | #error "CONFIG_PREEMPT is broken with 2.6.x before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\"" 8 | #endif 9 | 10 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23) 11 | /*---------------------------------------------------------------------------- 12 | * In 2.6.24, a namespace argument became required for dev_get_by_name. */ 13 | 14 | #define dev_get_by_name(net, name) \ 15 | dev_get_by_name((name)) 16 | 17 | #define dev_get_by_index(net, ifindex) \ 18 | dev_get_by_index((ifindex)) 19 | 20 | #endif /* linux kernel <= 2.6.23 */ 21 | 22 | 23 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22) 24 | /*---------------------------------------------------------------------------- 25 | * In 2.6.23, the last argument was dropped from kmem_cache_create. */ 26 | #define kmem_cache_create(n, s, a, f, c) \ 27 | kmem_cache_create((n), (s), (a), (f), (c), NULL) 28 | 29 | #endif /* linux kernel <= 2.6.22 */ 30 | 31 | #endif /* compat26.h */ 32 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/airopeek9.h: -------------------------------------------------------------------------------- 1 | /* airopeek9.h 2 | * 3 | * $Id: airopeek9.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __W_AIROPEEK9_H__ 25 | #define __W_AIROPEEK9_H__ 26 | 27 | int airopeek9_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/etherpeek.h: -------------------------------------------------------------------------------- 1 | /* etherpeek.h 2 | * 3 | * $Id: etherpeek.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __W_ETHERPEEK_H__ 25 | #define __W_ETHERPEEK_H__ 26 | 27 | int etherpeek_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /debian/openflow-switch.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for openflow-switch 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 /etc/default/openflow-switch 25 | ;; 26 | 27 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 28 | ;; 29 | 30 | *) 31 | echo "postrm called with unknown argument \`$1'" >&2 32 | exit 1 33 | ;; 34 | esac 35 | 36 | # dh_installdeb will replace this with shell code automatically 37 | # generated by other debhelper scripts. 38 | 39 | #DEBHELPER# 40 | 41 | exit 0 42 | 43 | 44 | -------------------------------------------------------------------------------- /debian/openflow-pki.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for openflow 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see http://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | case "$1" in 21 | configure) 22 | # Create certificate authorities. 23 | if test ! -d /usr/share/openflow/pki; then 24 | ofp-pki init 25 | fi 26 | ;; 27 | 28 | abort-upgrade|abort-remove|abort-deconfigure) 29 | ;; 30 | 31 | *) 32 | echo "postinst called with unknown argument \`$1'" >&2 33 | exit 1 34 | ;; 35 | esac 36 | 37 | #DEBHELPER# 38 | 39 | exit 0 40 | 41 | 42 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/crypt/crypt-des.h: -------------------------------------------------------------------------------- 1 | /* 2 | Unix SMB/CIFS implementation. 3 | 4 | a partial implementation of DES designed for use in the 5 | SMB authentication protocol 6 | 7 | Copyright (C) Andrew Tridgell 1998 8 | 9 | $Id: crypt-des.h 3992 2008-06-10 03:13:11Z dgu $ 10 | 11 | This program is free software; you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation; either version 2 of the License, or 14 | (at your option) any later version. 15 | 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with this program; if not, write to the Free Software 23 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | */ 25 | 26 | void crypt_des_ecb(unsigned char *out, const unsigned char *in, const unsigned char *key, int forw); 27 | -------------------------------------------------------------------------------- /datapath/linux-2.6/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 | export BUILDNR = @BUILDNR@ 7 | 8 | include $(srcdir)/../Modules.mk 9 | include $(srcdir)/Modules.mk 10 | include @HW_TABLES@ 11 | 12 | EXTRA_CFLAGS := -DVERSION=\"$(VERSION)\" 13 | EXTRA_CFLAGS += -I$(srcdir)/.. 14 | EXTRA_CFLAGS += -I$(builddir)/.. 15 | EXTRA_CFLAGS += -I$(top_srcdir)/include 16 | ifeq '$(BUILDNR)' '0' 17 | EXTRA_CFLAGS += -DBUILDNR=\"\" 18 | else 19 | EXTRA_CFLAGS += -DBUILDNR=\"+build$(BUILDNR)\" 20 | endif 21 | EXTRA_CFLAGS += -g 22 | EXTRA_CFLAGS += -include $(builddir)/kcompat.h 23 | 24 | # These include directories have to go before -I$(KSRC)/include. 25 | # NOSTDINC_FLAGS just happens to be a variable that goes in the 26 | # right place, even though it's conceptually incorrect. 27 | NOSTDINC_FLAGS += -I$(srcdir)/compat-2.6 -I$(srcdir)/compat-2.6/include 28 | 29 | obj-m := $(patsubst %,%.o,$(build_modules)) 30 | 31 | define module_template 32 | $(1)-y = $$(notdir $$(patsubst %.c,%.o,$($(1)_sources))) 33 | endef 34 | 35 | $(foreach module,$(build_modules),$(eval $(call module_template,$(module)))) 36 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/dbs-etherwatch.h: -------------------------------------------------------------------------------- 1 | /* dbs-etherwatch.h 2 | * 3 | * $Id: dbs-etherwatch.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __W_DBS_ETHERWATCH_H__ 25 | #define __W_DBS_ETHERWATCH_H__ 26 | 27 | int dbs_etherwatch_open(wtap *wth, int *err, gchar **err_info); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/capture-wpcap.h: -------------------------------------------------------------------------------- 1 | /* capture-wpcap.h 2 | * 3 | * $Id: capture-wpcap.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wireshark - Network traffic analyzer 6 | * By Gerald Combs 7 | * Copyright 2001 Gerald Combs 8 | * 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 | */ 24 | 25 | #ifndef CAPTURE_WPCAP_H 26 | #define CAPTURE_WPCAP_H 27 | 28 | extern gboolean has_wpcap; 29 | 30 | 31 | void 32 | load_wpcap(void); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/crc10.h: -------------------------------------------------------------------------------- 1 | /* 2 | * crc10.h 3 | * 4 | * $Id: crc10.h 3992 2008-06-10 03:13:11Z dgu $ 5 | * 6 | * Wireshark - Network traffic analyzer 7 | * By Gerald Combs 8 | * Copyright 1998 Gerald Combs 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 23 | * 24 | */ 25 | 26 | /* update the data block's CRC-10 remainder one byte at a time */ 27 | extern guint16 update_crc10_by_bytes(guint16 crc10, const guint8 *data_blk_ptr, int data_blk_size); 28 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/dtd_grammar.h: -------------------------------------------------------------------------------- 1 | #define TOKEN_TAG_START 1 2 | #define TOKEN_DOCTYPE_KW 2 3 | #define TOKEN_NAME 3 4 | #define TOKEN_OPEN_BRACKET 4 5 | #define TOKEN_CLOSE_BRACKET 5 6 | #define TOKEN_TAG_STOP 6 7 | #define TOKEN_ATTLIST_KW 7 8 | #define TOKEN_ELEMENT_KW 8 9 | #define TOKEN_ATT_TYPE 9 10 | #define TOKEN_ATT_DEF 10 11 | #define TOKEN_ATT_DEF_WITH_VALUE 11 12 | #define TOKEN_QUOTED 12 13 | #define TOKEN_IMPLIED_KW 13 14 | #define TOKEN_REQUIRED_KW 14 15 | #define TOKEN_OPEN_PARENS 15 16 | #define TOKEN_CLOSE_PARENS 16 17 | #define TOKEN_PIPE 17 18 | #define TOKEN_STAR 18 19 | #define TOKEN_PLUS 19 20 | #define TOKEN_QUESTION 20 21 | #define TOKEN_ELEM_DATA 21 22 | #define TOKEN_COMMA 22 23 | #define TOKEN_EMPTY_KW 23 24 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/mpeg.h: -------------------------------------------------------------------------------- 1 | /* mpeg.h 2 | * 3 | * MPEG file format decoder for the Wiretap library. 4 | * Written by Shaun Jackman 5 | * Copyright 2007 Shaun Jackman 6 | * 7 | * $Id: mpeg.h 3992 2008-06-10 03:13:11Z dgu $ 8 | * 9 | * Wiretap Library 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 | */ 24 | 25 | #ifndef __W_MPEG_H__ 26 | #define __W_MPEG_H__ 27 | 28 | #include "wtap-int.h" 29 | 30 | int mpeg_open(wtap *wth, int *err, gchar **err_info); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /regress/projects/learning_switch/regress/test_broadcast/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_broadcast 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub gen_broadcast_pkt { 8 | my ($portNum) = shift; 9 | 10 | my $pkt_args = { 11 | DA => "FF:FF:FF:FF:FF:FF", 12 | SA => "00:00:00:00:00:0" . $portNum, 13 | src_ip => "192.168." . $portNum . ".40", 14 | dst_ip => "255.255.255.255", 15 | ttl => 64, 16 | len => 64 17 | }; 18 | my $pkt = new NF2::IP_pkt(%$pkt_args); 19 | return $pkt; 20 | } 21 | 22 | sub send_expect_broadcast { 23 | my ( $portNum, $pkt, $delta_ref ) = @_; 24 | 25 | send_and_count( 'eth' . $portNum, $pkt->packed, $delta_ref ); 26 | for ( my $i = 1 ; $i <= 4 ; $i++ ) { 27 | if ( $i != $portNum ) { 28 | expect_and_count( 'eth' . $i, $pkt->packed, $delta_ref ); 29 | } 30 | } 31 | } 32 | 33 | sub my_test { 34 | 35 | my %delta; 36 | 37 | for ( my $i = 1 ; $i < 4 ; $i++ ) { 38 | my $pkt = gen_broadcast_pkt($i); 39 | 40 | # send one broadcast packet, then do it again on the same port 41 | send_expect_broadcast( $i, $pkt, \%delta ); 42 | sleep 0.1; 43 | send_expect_broadcast( $i, $pkt, \%delta ); 44 | sleep 0.1; 45 | } 46 | 47 | return %delta; 48 | } 49 | 50 | run_learning_switch_test( \&my_test, \@ARGV ); 51 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/snoop.h: -------------------------------------------------------------------------------- 1 | /* snoop.h 2 | * 3 | * $Id: snoop.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __W_SNOOP_H__ 24 | #define __W_SNOOP_H__ 25 | 26 | int snoop_open(wtap *wth, int *err, gchar **err_info); 27 | gboolean snoop_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err); 28 | int snoop_dump_can_write_encap(int encap); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/strerror.h: -------------------------------------------------------------------------------- 1 | /* strerror.h 2 | * 3 | * $Id: strerror.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wireshark - Network traffic analyzer 6 | * By Gerald Combs 7 | * Copyright 1998 Gerald Combs 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | */ 23 | 24 | #ifndef __STRERROR_H__ 25 | #define __STRERROR_H__ 26 | 27 | /* 28 | * Version of "strerror()", for the benefit of OSes that don't have it 29 | * (e.g., SunOS 4.x). 30 | */ 31 | extern char *strerror(int); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/netmon.h: -------------------------------------------------------------------------------- 1 | /* netmon.h 2 | * 3 | * $Id: netmon.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __NETMON_H__ 24 | #define __NETMON_H__ 25 | 26 | int netmon_open(wtap *wth, int *err, gchar **err_info); 27 | gboolean netmon_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err); 28 | int netmon_dump_can_write_encap(int encap); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_switch_config/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_switch_config 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub my_test { 8 | 9 | my ($sock, $options_ref) = @_; 10 | 11 | my $msg = get_config( $ofp, $sock ); 12 | 13 | # Verify that the miss_send_len is set to the correct default 14 | compare( "miss send len", $$msg{'miss_send_len'}, '==', get_of_miss_send_len_default() ); 15 | 16 | # As of OF v0.8.1, there was no default for flags - we assume 0 17 | # (don't send flow expiration messages) 18 | compare( "flags", $$msg{'flags'}, '==', 0 ); 19 | 20 | # Now, we change the config and check that it has been committed 21 | 22 | # Set flag OFPC_SEND_FLOW_EXP, which has val 1, and should cause flow exps 23 | my $flags = 1; 24 | 25 | # Change miss_send_len from the default 26 | my $miss_send_len = 0x100; 27 | 28 | set_config($ofp, $sock, $options_ref, $flags, $miss_send_len); 29 | 30 | # Give OF switch time to process the set_config 31 | usleep($$options_ref{'send_delay'}); 32 | 33 | $msg = get_config( $ofp, $sock ); 34 | 35 | compare( "miss send len", $$msg{'miss_send_len'}, '==', $miss_send_len ); 36 | compare( "flags", $$msg{'flags'}, '==', $flags ); 37 | } 38 | 39 | run_black_box_test( \&my_test, \@ARGV ); 40 | 41 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/g711.h: -------------------------------------------------------------------------------- 1 | /* 2 | * g711.h 3 | * 4 | * Definitions for routines for u-law, A-law and linear PCM conversions 5 | * 6 | * $Id: g711.h 3992 2008-06-10 03:13:11Z dgu $ 7 | * 8 | * Wireshark - Network traffic analyzer 9 | * By Gerald Combs 10 | * Copyright 1998 Gerald Combs 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation; either version 2 15 | * of the License, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | unsigned char linear2alaw( int ); 28 | int alaw2linear( unsigned char ); 29 | unsigned char linear2ulaw( int ); 30 | int ulaw2linear( unsigned char ); 31 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/5views.h: -------------------------------------------------------------------------------- 1 | /* 5views.h 2 | * 3 | * $Id: 5views.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __5VIEWS_H__ 24 | #define __5VIEWS_H__ 25 | 26 | int _5views_open(wtap *wth, int *err, gchar **err_info); 27 | gboolean _5views_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err); 28 | int _5views_dump_can_write_encap(int encap); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/cosine.h: -------------------------------------------------------------------------------- 1 | /* cosine.h 2 | * 3 | * $Id: cosine.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * CoSine IPNOS L2 debug output parsing 6 | * Copyright (c) 2002 by Motonori Shindo 7 | * 8 | * Wiretap Library 9 | * Copyright (c) 1998 by Gilbert Ramirez 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License 13 | * as published by the Free Software Foundation; either version 2 14 | * of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 | * 25 | */ 26 | 27 | #ifndef __W_COSINE_H__ 28 | #define __W_COSINE_H__ 29 | 30 | int cosine_open(wtap *wth, int *err, gchar **err_info); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/pcapng.h: -------------------------------------------------------------------------------- 1 | /* pcapng.h 2 | * 3 | * $Id: pcapng.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __W_PCAPNG_H__ 24 | #define __W_PCAPNG_H__ 25 | 26 | int pcapng_open(wtap *wth, int *err, gchar **err_info); 27 | gboolean pcapng_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err); 28 | int pcapng_dump_can_write_encap(int encap); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/strptime.h: -------------------------------------------------------------------------------- 1 | /* strptime.h 2 | * 3 | * $Id: strptime.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wireshark - Network traffic analyzer 6 | * By Gerald Combs 7 | * Copyright 1998 Gerald Combs 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | */ 23 | 24 | #ifndef __STRPTIME_H__ 25 | #define __STRPTIME_H__ 26 | 27 | /* 28 | * Version of "strptime()", for the benefit of OSes that don't have it. 29 | */ 30 | extern char *strptime(const char *, const char *, struct tm *); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_add_flow_latency/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_add_flow_latency 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub my_test { 8 | 9 | my ($sock) = @_; 10 | 11 | my $pkt_args = { 12 | DA => "00:00:00:00:00:01", 13 | SA => "00:00:00:00:00:02", 14 | src_ip => "192.168.200.40", 15 | dst_ip => "192.168.201.40", 16 | ttl => 64, 17 | len => 60 18 | }; 19 | 20 | my $test_pkt = new NF2::UDP_pkt(%$pkt_args); 21 | 22 | my $wildcards = 0x0; 23 | my $in_port = 1; 24 | my $out_port = 2; 25 | my $max_idle = 0; 26 | my $flags = 0x0; # don't send flow expiry 27 | 28 | my $flow_mod_pkt = create_flow_mod_from_udp($ofp,$test_pkt,$in_port,$out_port,$max_idle,$flags,$wildcards); 29 | 30 | print $sock $flow_mod_pkt; 31 | usleep(1000000); 32 | 33 | 34 | my $cnt = 0; 35 | my $start_time = [gettimeofday()]; 36 | for( $cnt = 0;$cnt < 1000; $cnt++){ 37 | nftest_send( nftest_get_iface( "eth" . ($in_port+1)),$test_pkt->packed ); 38 | nftest_expect( nftest_get_iface( "eth" . ($out_port+1)),$test_pkt->packed ); 39 | } 40 | my $time_elapse = tv_interval($start_time); 41 | my $latency = $time_elapse*1000/1000; 42 | print "Latency is $latency ms"; 43 | 44 | } 45 | 46 | 47 | run_black_box_test( \&my_test); 48 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/btsnoop.h: -------------------------------------------------------------------------------- 1 | /* btsnoop.h 2 | * 3 | * $Id: btsnoop.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __W_BTSNOOP_H__ 24 | #define __W_BTSNOOP_H__ 25 | 26 | int btsnoop_open(wtap *wth, int *err, gchar **err_info); 27 | gboolean btsnoop_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err); 28 | int btsnoop_dump_can_write_encap(int encap); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /datapath/Modules.mk: -------------------------------------------------------------------------------- 1 | # Some modules should be built and distributed, e.g. openflow. 2 | # 3 | # Some modules should be distributed but not built, e.g. we do not build 4 | # veth if the kernel in question already has it. 5 | # 6 | # Some modules should be built but not distributed, e.g. third-party 7 | # hwtable modules. 8 | both_modules = ofdatapath 9 | build_modules = $(both_modules) # Modules to build 10 | dist_modules = $(both_modules) # Modules to distribute 11 | 12 | ofdatapath_sources = \ 13 | chain.c \ 14 | crc32.c \ 15 | datapath.c \ 16 | dp_act.c \ 17 | dp_dev.c \ 18 | dp_notify.c \ 19 | flow.c \ 20 | forward.c \ 21 | private-msg.c \ 22 | table-hash.c \ 23 | table-linear.c 24 | 25 | ofdatapath_headers = \ 26 | chain.h \ 27 | compat.h \ 28 | crc32.h \ 29 | datapath.h \ 30 | dp_dev.h \ 31 | flow.h \ 32 | forward.h \ 33 | dp_act.h \ 34 | private-msg.h \ 35 | table.h 36 | 37 | dist_sources = $(foreach module,$(dist_modules),$($(module)_sources)) 38 | dist_headers = $(foreach module,$(dist_modules),$($(module)_headers)) 39 | build_sources = $(foreach module,$(build_modules),$($(module)_sources)) 40 | build_headers = $(foreach module,$(build_modules),$($(module)_headers)) 41 | build_links = $(notdir $(build_sources)) 42 | build_objects = $(notdir $(patsubst %.c,%.o,$(build_sources))) 43 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/ngsniffer.h: -------------------------------------------------------------------------------- 1 | /* ngsniffer.h 2 | * 3 | * $Id: ngsniffer.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __NGSNIFFER_H__ 24 | #define __NGSNIFFER_H__ 25 | 26 | int ngsniffer_open(wtap *wth, int *err, gchar **err_info); 27 | gboolean ngsniffer_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err); 28 | int ngsniffer_dump_can_write_encap(int encap); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/dfilter/grammar.h: -------------------------------------------------------------------------------- 1 | #define TOKEN_TEST_AND 1 2 | #define TOKEN_TEST_OR 2 3 | #define TOKEN_TEST_EQ 3 4 | #define TOKEN_TEST_NE 4 5 | #define TOKEN_TEST_LT 5 6 | #define TOKEN_TEST_LE 6 7 | #define TOKEN_TEST_GT 7 8 | #define TOKEN_TEST_GE 8 9 | #define TOKEN_TEST_CONTAINS 9 10 | #define TOKEN_TEST_MATCHES 10 11 | #define TOKEN_TEST_BITWISE_AND 11 12 | #define TOKEN_TEST_NOT 12 13 | #define TOKEN_FIELD 13 14 | #define TOKEN_STRING 14 15 | #define TOKEN_UNPARSED 15 16 | #define TOKEN_LBRACKET 16 17 | #define TOKEN_RBRACKET 17 18 | #define TOKEN_COMMA 18 19 | #define TOKEN_INTEGER 19 20 | #define TOKEN_COLON 20 21 | #define TOKEN_HYPHEN 21 22 | #define TOKEN_FUNCTION 22 23 | #define TOKEN_LPAREN 23 24 | #define TOKEN_RPAREN 24 25 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/ascend.h: -------------------------------------------------------------------------------- 1 | /* ascend.h 2 | * 3 | * $Id: ascend.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | * 22 | */ 23 | 24 | #ifndef __ASCEND_H__ 25 | #define __ASCEND_H__ 26 | 27 | #define ASCEND_MAX_DATA_ROWS 8 28 | #define ASCEND_MAX_DATA_COLS 16 29 | #define ASCEND_MAX_PKT_LEN (ASCEND_MAX_DATA_ROWS * ASCEND_MAX_DATA_COLS) 30 | 31 | int ascend_open(wtap *wth, int *err, gchar **err_info); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /debian/openflow-controller.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 | # * "pctp:[PORT]": Listen for TCP connections on the specified PORT 12 | # (default: 6633). Not recommended for security reasons. 13 | # 14 | # * "nl:DP_IDX": Listen on local datapath DP_IDX. Used only if this 15 | # machine is also an OpenFlow switch and not running the secure 16 | # channel, and only if you know what you're doing. 17 | # 18 | LISTEN="pssl:" 19 | 20 | # PRIVKEY: Name of file containing controller's private key. 21 | # Required if SSL enabled. 22 | PRIVKEY=/etc/openflow-controller/privkey.pem 23 | 24 | # CERT: Name of file containing certificate for private key. 25 | # Required if SSL enabled. 26 | CERT=/etc/openflow-controller/cert.pem 27 | 28 | # CACERT: Name of file containing switch CA certificate. 29 | # Required if SSL enabled. 30 | CACERT=/etc/openflow-controller/cacert.pem 31 | 32 | # Additional options to pass to controller, e.g. "--hub" 33 | DAEMON_OPTS="" 34 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/inet_aton.h: -------------------------------------------------------------------------------- 1 | /* inet_aton.h 2 | * 3 | * $Id: inet_aton.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wireshark - Network traffic analyzer 6 | * By Gerald Combs 7 | * Copyright 1998 Gerald Combs 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | */ 23 | 24 | /* 25 | * Version of "inet_aton()", for the benefit of OSes that don't have it. 26 | */ 27 | 28 | #ifndef __INET_ATON_H__ 29 | #define __INET_ATON_H__ 30 | 31 | struct in_addr; 32 | extern int inet_aton(const char* cp_arg, struct in_addr *addr); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/mkstemp.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | 4 | The GNU C Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public License as 6 | published by the Free Software Foundation; either version 2 of the 7 | License, or (at your option) any later version. 8 | 9 | The GNU C Library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with the GNU C Library; see the file COPYING.LIB. If not, 16 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | Boston, MA 02111-1307, USA. */ 18 | 19 | 20 | /* Generate a unique temporary file name from TEMPLATE. 21 | The last six characters of TEMPLATE must be "XXXXXX"; 22 | they are replaced with a string that makes the filename unique. 23 | Returns a file descriptor open on the file for reading and writing. */ 24 | int mkstemp (char *template); 25 | -------------------------------------------------------------------------------- /hw-lib/nf2/nf2util.h: -------------------------------------------------------------------------------- 1 | /* **************************************************************************** 2 | * $Id: nf2util.h 3764 2008-05-22 06:48:34Z grg $ 3 | * 4 | * Module: nf2util.h 5 | * Project: NetFPGA 2 Linux Kernel Driver 6 | * Description: Header file for kernel driver 7 | * 8 | * Change history: 9 | * 10 | */ 11 | 12 | #ifndef _NF2UTIL_H 13 | #define _NF2UTIL_H 1 14 | 15 | #define PATHLEN 80 16 | #define DEVICE_STR_LEN 100 17 | 18 | 19 | /* 20 | * Structure to represent an nf2 device to a user mode programs 21 | */ 22 | struct nf2device { 23 | char *device_name; 24 | int fd; 25 | int net_iface; 26 | }; 27 | 28 | /* Function declarations */ 29 | 30 | int readReg(struct nf2device *nf2, unsigned reg, unsigned *val); 31 | int writeReg(struct nf2device *nf2, unsigned reg, unsigned val); 32 | int check_iface(struct nf2device *nf2); 33 | int openDescriptor(struct nf2device *nf2); 34 | int closeDescriptor(struct nf2device *nf2); 35 | void nf2_read_info(struct nf2device *nf2); 36 | void printHello (struct nf2device *nf2, int *val); 37 | 38 | extern unsigned cpci_version; 39 | extern unsigned cpci_revision; 40 | extern unsigned nf2_device_id; 41 | extern unsigned nf2_revision; 42 | extern unsigned nf2_cpci_version; 43 | extern unsigned nf2_cpci_revision; 44 | extern char nf2_device_str[DEVICE_STR_LEN]; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /regress/lib/Perl5/OF/Base.pm: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # $Id: Base.pm 3161 2007-12-13 21:08:05Z grg $ 3 | # 4 | # Module provides basic functions for use by OF Perl scripts. 5 | # 6 | # Revisions: 7 | # 8 | ############################################################## 9 | 10 | package OF::Base; 11 | 12 | use Exporter; 13 | @ISA = ('Exporter'); 14 | @EXPORT = qw( &check_OF_vars_set 15 | ); 16 | 17 | ############################################################## 18 | # 19 | # Check that the user has set up their environment correctly. 20 | # 21 | ############################################################## 22 | sub check_OF_vars_set { 23 | 24 | my @of_vars = qw(OFT_ROOT OF_ROOT); 25 | 26 | for (@of_vars) { 27 | my_die("Please set shell variable $_ and try again.") 28 | unless defined $ENV{$_}; 29 | } 30 | 31 | } 32 | 33 | ############################################################## 34 | # 35 | # Define a my_die function if it doesn't already exist 36 | # 37 | ############################################################## 38 | 39 | if ( !defined(&my_die) ) { 40 | eval( ' 41 | sub my_die { 42 | my $mess = shift @_; 43 | (my $cmd = $0) =~ s/.*\///; 44 | print STDERR "\n$cmd: $mess\n"; 45 | exit 1; 46 | } 47 | ' ); 48 | } 49 | 50 | # Always end library in 1 51 | 1; 52 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/capture_stop_conditions.h: -------------------------------------------------------------------------------- 1 | /* capture_stop_conditions.h 2 | * Implementation for 'stop condition handler'. 3 | * 4 | * $Id: capture_stop_conditions.h 3992 2008-06-10 03:13:11Z dgu $ 5 | * 6 | * Wireshark - Network traffic analyzer 7 | * By Gerald Combs 8 | * Copyright 1998 Gerald Combs 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 | */ 24 | 25 | void init_capture_stop_conditions(void); 26 | void cleanup_capture_stop_conditions(void); 27 | 28 | extern const char* CND_CLASS_TIMEOUT; 29 | extern const char* CND_CLASS_CAPTURESIZE; 30 | -------------------------------------------------------------------------------- /hw-lib/skeleton/sample_plat.h: -------------------------------------------------------------------------------- 1 | #ifndef SAMPLE_PLAT_H 2 | #define SAMPLE_PLAT_H 1 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define OF_HW_MAX_PORTS 4 12 | 13 | static inline int 14 | of_port_to_hw_port(int of_port) 15 | { 16 | return of_port - 1; 17 | } 18 | 19 | 20 | /* Map port to OF port number */ 21 | static inline int 22 | of_hw_port_to_of_port(int port) 23 | { 24 | if ((port < 0) || (port > 3)) { 25 | return -1; 26 | } 27 | 28 | return port + 1; 29 | } 30 | 31 | #define _IS_DIGIT(c) ((c) >= '0' && (c) <= '9') 32 | 33 | /* Map name to hw port number: N => N-1 34 | ge0 => 0 where "ge" can be any string and 0 can be any number 35 | */ 36 | 37 | static inline int 38 | hw_port_name_to_index(const char *name) 39 | { 40 | 41 | if (_IS_DIGIT(name[0])) { 42 | /* Treat as 1-based, OF number */ 43 | i = strtoul(&name[0], NULL, 10); 44 | return i - 1; 45 | } 46 | 47 | len = strlen(name); 48 | for (idx = 0; idx < len && !_IS_DIGIT(name[idx]); idx++) ; 49 | 50 | if ((idx < len) && _IS_DIGIT(name[idx])) { 51 | i = strtoul(&name[idx], NULL, 10); 52 | return i; 53 | } 54 | 55 | return -1; 56 | } 57 | #undef _IS_DIGIT 58 | 59 | 60 | 61 | #endif /* SAMPLE_PLAT_H */ 62 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/README: -------------------------------------------------------------------------------- 1 | README: OpenFlow Wireshark Plugin 2 | 3 | 4 | 5 | ---------------------------------------- 6 | I) Installation 7 | 8 | 1) Install glib-devel; on Debian this can be done with 'sudo apt-get install libgtk2.0-dev' 9 | 2) Install wireshark v1.0.0 or greater 10 | 3) cd wireshark_dissectors/openflow 11 | 4) make 12 | 5) sudo make install 13 | 5a) Note that this prints out where the plugin was installed. 14 | 15 | 16 | ---------------------------------------- 17 | II) Installation Verification 18 | 19 | 1) Run wireshark 20 | 2) Open the "Help" --> "About" menu 21 | 3) Select the "Plugins" tab 22 | 4) Click the "Name" header to the plugins by name 23 | 5) Verify that "packet-openflow.so" appears in the list. 24 | 6) Verify that its version is listed as . 25 | 26 | 27 | ---------------------------------------- 28 | III) Port Changes 29 | 30 | To have the dissector handle OpenFlow packets for any port other than the default, you must change the DISSECT_PORT variable in utilities/wireshark_dissectors/oepnflow/Makefile. 31 | 32 | ---------------------------------------- 33 | IV) Feedback and Bug Reporting 34 | 35 | Please post a message on the OpenFlow forums at openflowswitch.org or email 36 | David Underhill at dgu@cs.stanford.edu if you have any feedback or discover any 37 | bugs. 38 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/Makefile: -------------------------------------------------------------------------------- 1 | # simple Makefile to build and install all of our Wireshark plugins 2 | 3 | # build a list of all sub-directories except the includes path 4 | PLUGIN_DIRS = $(shell ls -l | grep "^d" | cut -d: -f2- | cut -d\ -f2 | fgrep -v 'wireshark-1.0.0-includes') 5 | CLEAN_PLUGIN_DIRS = $(foreach dir,$(PLUGIN_DIRS),clean$(dir)) 6 | INSTALL_PLUGIN_DIRS = $(foreach dir,$(PLUGIN_DIRS),install$(dir)) 7 | 8 | .PHONY: all $(PLUGIN_DIRS) clean $(CLEAN_PLUGIN_DIRS) install $(INSTALL_PLUGIN_DIRS) 9 | 10 | # build all the plugins 11 | all: 12 | @$(MAKE) --no-print-directory $(PLUGIN_DIRS) 13 | 14 | # cleanup all the byproducts (including the plugin itself) 15 | clean: 16 | @$(MAKE) --no-print-directory $(CLEAN_PLUGIN_DIRS) 17 | 18 | # install all plugins 19 | install: 20 | @$(MAKE) --no-print-directory $(INSTALL_PLUGIN_DIRS) 21 | 22 | # build the plugin in the specified directory using its default rule 23 | $(PLUGIN_DIRS): 24 | @$(MAKE) --no-print-directory -C $@ 25 | 26 | # cleans up the plugin in the specified directory using its 'clean' rule 27 | $(CLEAN_PLUGIN_DIRS): 28 | @$(MAKE) --no-print-directory -C `echo $@ | sed -e "s#^clean##"` clean 29 | 30 | # installs up the plugin in the specified directory using its 'install' rule 31 | $(INSTALL_PLUGIN_DIRS): 32 | @$(MAKE) --no-print-directory -C `echo $@ | sed -e "s#^install##"` install 33 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/globals.h: -------------------------------------------------------------------------------- 1 | /* globals.h 2 | * Global defines, etc. 3 | * 4 | * $Id: globals.h 3992 2008-06-10 03:13:11Z dgu $ 5 | * 6 | * Wireshark - Network traffic analyzer 7 | * By Gerald Combs 8 | * Copyright 1998 Gerald Combs 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 | */ 24 | 25 | #ifndef __GLOBALS_H__ 26 | #define __GLOBALS_H__ 27 | 28 | #include "file.h" 29 | #include 30 | 31 | extern capture_file cfile; 32 | #ifdef HAVE_LIBPCAP 33 | /** @todo move this to the gtk dir */ 34 | extern gboolean auto_scroll_live; 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/ps.h: -------------------------------------------------------------------------------- 1 | /* ps.h 2 | * Definitions for generating PostScript(R) packet output. 3 | * 4 | * $Id: ps.h 3992 2008-06-10 03:13:11Z dgu $ 5 | * 6 | * Gilbert Ramirez 7 | * 8 | * Wireshark - Network traffic analyzer 9 | * By Gerald Combs 10 | * Copyright 1998 Gerald Combs 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation; either version 2 15 | * of the License, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | #ifndef __PS_H__ 28 | #define __PS_H__ 29 | 30 | /* Functions in ps.c; automatically generated by rdps */ 31 | 32 | void print_ps_preamble(FILE *); 33 | void print_ps_finale(FILE *); 34 | 35 | #endif /* ps.h */ 36 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/k12.h: -------------------------------------------------------------------------------- 1 | /* k12.c 2 | * 3 | * $Id: k12.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | int k12_open(wtap *wth, int *err, gchar **err_info); 24 | int k12_dump_can_write_encap(int encap); 25 | gboolean k12_dump_open(wtap_dumper *wdh, gboolean cant_seek _U_, int *err); 26 | int k12text_open(wtap *wth, int *err, gchar **err_info _U_); 27 | int k12text_dump_can_write_encap(int encap); 28 | gboolean k12text_dump_open(wtap_dumper *wdh, gboolean cant_seek _U_, int *err); 29 | -------------------------------------------------------------------------------- /debian/openflow-pki-server.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for openflow 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see http://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | case "$1" in 21 | configure) 22 | # Enable site under Apache. 23 | a2ensite openflow-pki >/dev/null 24 | if command -v invoke-rc.d >/dev/null 2>&1; then 25 | invoke-rc.d apache2 force-reload || : 26 | else 27 | [ -x /etc/init.d/apache2 ] && /etc/init.d/apache2 force-reload || : 28 | fi 29 | ;; 30 | 31 | abort-upgrade|abort-remove|abort-deconfigure) 32 | ;; 33 | 34 | *) 35 | echo "postinst called with unknown argument \`$1'" >&2 36 | exit 1 37 | ;; 38 | esac 39 | 40 | #DEBHELPER# 41 | 42 | exit 0 43 | 44 | 45 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_forward_exact_modify_action/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_forward_exact_modify_action 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub forward_port { 8 | 9 | my ( $ofp, $sock, $options_ref, $in_port_offset, $out_port_offset, 10 | $wildcards ) = @_; 11 | 12 | my @chg_field; 13 | if ( not defined( $$options_ref{'no_vlan'} ) ) { 14 | @chg_field = ('vlan_vid', 'vlan_pcp', 'dl_src', 'dl_dst', 'nw_src', 'nw_dst', 'tp_src', 'tp_dst'); 15 | } else { 16 | @chg_field = ('dl_src', 'dl_dst', 'nw_src', 'nw_dst', 'tp_src', 'tp_dst'); 17 | } 18 | foreach (@chg_field) { 19 | forward_simple(@_, 'port', undef, $_ ); 20 | } 21 | } 22 | 23 | sub forward_port_vlan { 24 | my @chg_field = ('strip_vlan', 'vlan_vid', 'vlan_pcp', 'dl_src', 'dl_dst', 'nw_src', 'nw_dst', 'tp_src', 'tp_dst'); 25 | my $vlan = 0x65a1; 26 | #[15:13]:vlan_pcp, [11:0]:vlan_vid 27 | #The value was chosen at random 28 | foreach (@chg_field) { 29 | forward_simple(@_, 'port', undef, $_, $vlan ); 30 | } 31 | } 32 | sub my_test { 33 | 34 | my ( $sock, $options_ref ) = @_; 35 | 36 | for_all_port_pairs( $ofp, $sock, $options_ref, \&forward_port, 0x0); 37 | if ( not defined( $$options_ref{'no_vlan'} ) ) { 38 | for_all_port_pairs( $ofp, $sock, $options_ref, \&forward_port_vlan, 0x0); 39 | } 40 | } 41 | 42 | run_black_box_test( \&my_test, \@ARGV ); 43 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/commview.h: -------------------------------------------------------------------------------- 1 | /* commview.h 2 | * 3 | * $Id: commview.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wireshark - Network traffic analyzer 6 | * By Gerald Combs 7 | * Copyright 1998 Gerald Combs 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 22 | * USA. 23 | */ 24 | 25 | #ifndef __COMMVIEW_H__ 26 | #define __COMMVIEW_H__ 27 | 28 | int commview_open(wtap *wth, int *err, gchar **err_info _U_); 29 | int commview_dump_can_write_encap(int encap); 30 | gboolean commview_dump_open(wtap_dumper *wdh, gboolean cant_seek _U_, int *err); 31 | 32 | #endif /* __COMMVIEW_H__ */ 33 | 34 | -------------------------------------------------------------------------------- /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 3.9.8 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-3.9.8.tar.gz 13 | tar xzf tcpdump-3.9.8.tar.gz 14 | ln -s tcpdump-3.9.8 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 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/t35.h: -------------------------------------------------------------------------------- 1 | /* t35.h 2 | * T.35 and H.221 tables 3 | * 2003 Tomas Kukosa 4 | * 5 | * $Id: t35.h 3992 2008-06-10 03:13:11Z dgu $ 6 | * 7 | * Wireshark - Network traffic analyzer 8 | * By Gerald Combs 9 | * Copyright 1998 Gerald Combs 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License 13 | * as published by the Free Software Foundation; either version 2 14 | * of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 | */ 25 | 26 | #ifndef __T35_H__ 27 | #define __T35_H__ 28 | 29 | #include "epan/value_string.h" 30 | 31 | extern const value_string T35CountryCode_vals[]; 32 | extern const value_string T35Extension_vals[]; 33 | extern const value_string H221ManufacturerCode_vals[]; 34 | 35 | #endif /* __T35_H__ */ 36 | -------------------------------------------------------------------------------- /datapath/forward.h: -------------------------------------------------------------------------------- 1 | #ifndef FORWARD_H 2 | #define FORWARD_H 1 3 | 4 | #include 5 | #include "datapath.h" 6 | #include "flow.h" 7 | 8 | struct sk_buff; 9 | struct sw_chain; 10 | struct sender; 11 | 12 | /* Buffers are identified to userspace by a 31-bit opaque ID. We divide the ID 13 | * into a buffer number (low bits) and a cookie (high bits). The buffer number 14 | * is an index into an array of buffers. The cookie distinguishes between 15 | * different packets that have occupied a single buffer. Thus, the more 16 | * buffers we have, the lower-quality the cookie... */ 17 | #define PKT_BUFFER_BITS 8 18 | #define N_PKT_BUFFERS (1 << PKT_BUFFER_BITS) 19 | #define PKT_BUFFER_MASK (N_PKT_BUFFERS - 1) 20 | 21 | #define PKT_COOKIE_BITS (32 - PKT_BUFFER_BITS) 22 | 23 | #define UINT32_MAX 4294967295U 24 | #define UINT16_MAX 65535 25 | #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) 26 | 27 | void fwd_port_input(struct sw_chain *, struct sk_buff *, 28 | struct net_bridge_port *); 29 | int run_flow_through_tables(struct sw_chain *, struct sk_buff *, 30 | struct net_bridge_port *); 31 | int fwd_control_input(struct sw_chain *, const struct sender *, 32 | const void *, size_t); 33 | 34 | uint32_t fwd_save_skb(struct sk_buff *skb); 35 | void fwd_discard_all(void); 36 | void fwd_exit(void); 37 | 38 | #endif /* forward.h */ 39 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/base64.h: -------------------------------------------------------------------------------- 1 | /* base64.h 2 | * Base-64 conversion 3 | * 4 | * $Id: base64.h 3992 2008-06-10 03:13:11Z dgu $ 5 | * 6 | * Wireshark - Network traffic analyzer 7 | * By Gerald Combs 8 | * Copyright 1998 Gerald Combs 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 | */ 24 | #ifndef __BASE64_H__ 25 | #define __BASE64_H__ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif /* __cplusplus */ 30 | 31 | /* In-place decoding of a base64 string. */ 32 | size_t epan_base64_decode(char *s); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif /* __cplusplus */ 37 | 38 | #endif /* __BASE64_H__ */ 39 | -------------------------------------------------------------------------------- /utilities/automake.mk: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS += \ 2 | utilities/vlogconf \ 3 | utilities/dpctl \ 4 | utilities/ofp-discover \ 5 | utilities/ofp-kill 6 | bin_SCRIPTS += utilities/ofp-pki 7 | noinst_SCRIPTS += utilities/ofp-pki-cgi utilities/ofp-parse-leaks 8 | 9 | EXTRA_DIST += \ 10 | utilities/dpctl.8.in \ 11 | utilities/ofp-discover.8.in \ 12 | utilities/ofp-kill.8.in \ 13 | utilities/ofp-parse-leaks.in \ 14 | utilities/ofp-pki-cgi.in \ 15 | utilities/ofp-pki.8.in \ 16 | utilities/ofp-pki.in \ 17 | utilities/vlogconf.8.in 18 | DISTCLEANFILES += \ 19 | utilities/dpctl.8 \ 20 | utilities/ofp-discover.8 \ 21 | utilities/ofp-kill.8 \ 22 | utilities/ofp-parse-leaks \ 23 | utilities/ofp-pki \ 24 | utilities/ofp-pki.8 \ 25 | utilities/ofp-pki-cgi \ 26 | utilities/vlogconf.8 27 | 28 | man_MANS += \ 29 | utilities/dpctl.8 \ 30 | utilities/ofp-discover.8 \ 31 | utilities/ofp-kill.8 \ 32 | utilities/ofp-pki.8 \ 33 | utilities/vlogconf.8 34 | 35 | utilities_dpctl_SOURCES = utilities/dpctl.c 36 | utilities_dpctl_LDADD = lib/libopenflow.a $(FAULT_LIBS) $(SSL_LIBS) 37 | 38 | utilities_vlogconf_SOURCES = utilities/vlogconf.c 39 | utilities_vlogconf_LDADD = lib/libopenflow.a 40 | 41 | utilities_ofp_discover_SOURCES = utilities/ofp-discover.c 42 | utilities_ofp_discover_LDADD = lib/libopenflow.a 43 | 44 | utilities_ofp_kill_SOURCES = utilities/ofp-kill.c 45 | utilities_ofp_kill_LDADD = lib/libopenflow.a 46 | -------------------------------------------------------------------------------- /datapath/chain.h: -------------------------------------------------------------------------------- 1 | #ifndef CHAIN_H 2 | #define CHAIN_H 1 3 | 4 | #include 5 | 6 | struct sw_flow; 7 | struct sw_flow_key; 8 | struct ofp_action_header; 9 | struct datapath; 10 | 11 | 12 | #define TABLE_LINEAR_MAX_FLOWS 100 13 | #define TABLE_HASH_MAX_FLOWS 65536 14 | 15 | /* Set of tables chained together in sequence from cheap to expensive. */ 16 | #define CHAIN_MAX_TABLES 4 17 | struct sw_chain { 18 | int n_tables; 19 | struct sw_table *tables[CHAIN_MAX_TABLES]; 20 | struct sw_table *emerg_table; 21 | 22 | struct datapath *dp; 23 | struct module *owner; 24 | }; 25 | 26 | struct sw_chain *chain_create(struct datapath *); 27 | struct sw_flow *chain_lookup(struct sw_chain *, const struct sw_flow_key *, 28 | int); 29 | int chain_insert(struct sw_chain *, struct sw_flow *, int); 30 | int chain_modify(struct sw_chain *, const struct sw_flow_key *, 31 | uint16_t, int, const struct ofp_action_header *, size_t, int); 32 | int chain_has_conflict(struct sw_chain *, const struct sw_flow_key *, 33 | uint16_t, int); 34 | int chain_delete(struct sw_chain *, const struct sw_flow_key *, uint16_t, 35 | uint16_t, int, int); 36 | int chain_timeout(struct sw_chain *); 37 | void chain_destroy(struct sw_chain *); 38 | 39 | int chain_set_hw_hook(struct sw_table *(*create_hw_table)(void), 40 | struct module *owner); 41 | void chain_clear_hw_hook(void); 42 | 43 | #endif /* chain.h */ 44 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_flow_expired_send_flow_exp/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_flow_expired 3 | 4 | use strict; 5 | use OF::Includes; 6 | use IO::Select; 7 | 8 | sub my_test { 9 | 10 | my ($sock, $options_ref) = @_; 11 | 12 | my $in_port = $$options_ref{'port_base'}; 13 | my $out_port = $in_port + 1; 14 | 15 | my $test_pkt = get_default_black_box_pkt( $in_port, $out_port); 16 | 17 | my $max_idle = 0x1; # second before flow expiration 18 | my $wildcards = 0x0; # exact match 19 | # Create a flow mod without expiry 20 | my $flags = 0x0; # don't send flow expiry 21 | my $flow_mod_pkt = 22 | create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); 23 | print $sock $flow_mod_pkt; 24 | 25 | my $sel = IO::Select->new($sock); 26 | if ($sel->can_read(2 * $max_idle)) { 27 | print "Error: was not expecting a message from the switch\n"; 28 | exit 1; 29 | } 30 | 31 | # Create a flow mod with expiry 32 | $flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry 33 | $flow_mod_pkt = 34 | create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); 35 | print $sock $flow_mod_pkt; 36 | 37 | my $pkt_len = 0; 38 | my $pkt_total = 0; 39 | wait_for_flow_expired( $ofp, $sock, $options_ref, $pkt_len, $pkt_total ); 40 | 41 | } 42 | 43 | run_black_box_test( \&my_test, \@ARGV ); 44 | 45 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/catapult_dct2000.h: -------------------------------------------------------------------------------- 1 | /* catapult_dct2000.h 2 | * 3 | * $Id: catapult_dct2000.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | int catapult_dct2000_open(wtap *wth, int *err, gchar **err_info); 24 | gboolean catapult_dct2000_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err); 25 | int catapult_dct2000_dump_can_write_encap(int encap); 26 | 27 | #define DCT2000_ENCAP_UNHANDLED 0 28 | #define DCT2000_ENCAP_SSCOP 101 29 | #define DCT2000_ENCAP_MTP2 102 30 | #define DCT2000_ENCAP_NBAP 103 31 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/bitswap.h: -------------------------------------------------------------------------------- 1 | /* bitswap.h 2 | * Macro to bitswap a byte by looking it up in a table 3 | * 4 | * $Id: bitswap.h 3992 2008-06-10 03:13:11Z dgu $ 5 | * 6 | * Wireshark - Network traffic analyzer 7 | * By Gerald Combs 8 | * Copyright 1998 Gerald Combs 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 | */ 24 | 25 | #ifndef __BITSWAP_H__ 26 | #define __BITSWAP_H__ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif /* __cplusplus */ 31 | 32 | extern guint8 swaptab[256]; 33 | 34 | #define BIT_SWAP(b) (swaptab[b]) 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* bitswap.h */ 41 | -------------------------------------------------------------------------------- /debian/ofp-switch-setup.8: -------------------------------------------------------------------------------- 1 | .TH ofp-switch-setup 8 "June 2008" "OpenFlow" "OpenFlow Manual" 2 | 3 | .SH NAME 4 | ofp\-switch\-setup \- interactive setup for OpenFlow switch 5 | 6 | .SH SYNOPSIS 7 | .B ofp\-switch\-setup 8 | 9 | .SH DESCRIPTION 10 | The \fBofp\-switch\-setup\fR program is an interactive program that 11 | assists the system administrator in configuring an OpenFlow switch, 12 | including the underlying public key infrastructure (PKI). 13 | 14 | .SH OPTIONS 15 | ofp\-switch\-setup does not accept any command-line options. 16 | 17 | .SH FILES 18 | .IP /etc/default/openflow-switch 19 | Main configuration file for OpenFlow switch. 20 | 21 | .IP /etc/openflow-switch/cacert.pem 22 | Default location of CA certificate for OpenFlow controllers. 23 | 24 | .IP /etc/openflow-switch/of0-cert.pem 25 | Default location of certificate for the OpenFlow switch's private key. 26 | 27 | .IP /etc/openflow-switch/of0-privkey.pem 28 | Default location of the OpenFlow switch's private key. This file 29 | should be readable only by \fBroot\fR. 30 | 31 | .IP /etc/openflow-switch/of0-req.pem 32 | Default location of certificate request for the OpenFlow switch's 33 | certificate. This file is not used after the signed certificate 34 | (typically \fB/etc/openflow-switch/of0-cert.pem\fR, above) has been 35 | obtained from the OpenFlow PKI server. 36 | 37 | .SH "SEE ALSO" 38 | 39 | .BR ofp-pki (8), 40 | .BR dpctl (8), 41 | .BR secchan (8) 42 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/netxray.h: -------------------------------------------------------------------------------- 1 | /* netxray.h 2 | * 3 | * $Id: netxray.h 3992 2008-06-10 03:13:11Z dgu $ 4 | * 5 | * Wiretap Library 6 | * Copyright (c) 1998 by Gilbert Ramirez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __NETXRAY_H__ 24 | #define __NETXRAY_H__ 25 | 26 | int netxray_open(wtap *wth, int *err, gchar **err_info); 27 | int netxray_dump_can_write_encap_1_1(int encap); 28 | gboolean netxray_dump_open_1_1(wtap_dumper *wdh, gboolean cant_seek, int *err); 29 | int netxray_dump_can_write_encap_2_0(int encap); 30 | gboolean netxray_dump_open_2_0(wtap_dumper *wdh, gboolean cant_seek, int *err); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/capture_errs.h: -------------------------------------------------------------------------------- 1 | /* capture_errs.h 2 | * Declarations of routines to return error and warning messages for 3 | * packet capture 4 | * 5 | * $Id: capture_errs.h 3992 2008-06-10 03:13:11Z dgu $ 6 | * 7 | * Wireshark - Network traffic analyzer 8 | * By Gerald Combs 9 | * Copyright 1998 Gerald Combs 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License 13 | * as published by the Free Software Foundation; either version 2 14 | * of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 | */ 25 | 26 | #ifdef HAVE_LIBPCAP 27 | 28 | #ifdef _WIN32 29 | /* error message, if WinPcap couldn't be loaded */ 30 | /* will use g_strdup, don't forget to g_free the returned string! */ 31 | extern char *cant_load_winpcap_err(const char *app_name); 32 | #endif /* _WIN32 */ 33 | 34 | #endif /* HAVE_LIBPCAP */ 35 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/crypt/crypt-rc4.h: -------------------------------------------------------------------------------- 1 | /* 2 | Unix SMB/CIFS implementation. 3 | 4 | a partial implementation of RC4 designed for use in the 5 | SMB authentication protocol 6 | 7 | Copyright (C) Andrew Tridgell 1998 8 | 9 | $Id: crypt-rc4.h 3992 2008-06-10 03:13:11Z dgu $ 10 | 11 | This program is free software; you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation; either version 2 of the License, or 14 | (at your option) any later version. 15 | 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with this program; if not, write to the Free Software 23 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | */ 25 | 26 | typedef struct _rc4_state_struct { 27 | unsigned char s_box[256]; 28 | unsigned char index_i; 29 | unsigned char index_j; 30 | } rc4_state_struct; 31 | 32 | void crypt_rc4_init(rc4_state_struct *rc4_state, 33 | const unsigned char *key, int key_len); 34 | 35 | void crypt_rc4(rc4_state_struct *rc4_state, unsigned char *data, int data_len); 36 | 37 | -------------------------------------------------------------------------------- /datapath/linux-2.6/Modules.mk: -------------------------------------------------------------------------------- 1 | ofdatapath_sources += \ 2 | linux-2.6/compat-2.6/genetlink-openflow.c \ 3 | linux-2.6/compat-2.6/random32.c 4 | ofdatapath_headers += \ 5 | linux-2.6/compat-2.6/compat26.h \ 6 | linux-2.6/compat-2.6/include/asm-generic/bug.h \ 7 | linux-2.6/compat-2.6/include/linux/dmi.h \ 8 | linux-2.6/compat-2.6/include/linux/icmp.h \ 9 | linux-2.6/compat-2.6/include/linux/if_arp.h \ 10 | linux-2.6/compat-2.6/include/linux/ip.h \ 11 | linux-2.6/compat-2.6/include/linux/ipv6.h \ 12 | linux-2.6/compat-2.6/include/linux/jiffies.h \ 13 | linux-2.6/compat-2.6/include/linux/lockdep.h \ 14 | linux-2.6/compat-2.6/include/linux/mutex.h \ 15 | linux-2.6/compat-2.6/include/linux/netfilter_ipv4.h \ 16 | linux-2.6/compat-2.6/include/linux/netlink.h \ 17 | linux-2.6/compat-2.6/include/linux/random.h \ 18 | linux-2.6/compat-2.6/include/linux/rculist.h \ 19 | linux-2.6/compat-2.6/include/linux/skbuff.h \ 20 | linux-2.6/compat-2.6/include/linux/tcp.h \ 21 | linux-2.6/compat-2.6/include/linux/timer.h \ 22 | linux-2.6/compat-2.6/include/linux/types.h \ 23 | linux-2.6/compat-2.6/include/linux/udp.h \ 24 | linux-2.6/compat-2.6/include/linux/workqueue.h \ 25 | linux-2.6/compat-2.6/include/net/checksum.h \ 26 | linux-2.6/compat-2.6/include/net/genetlink.h \ 27 | linux-2.6/compat-2.6/include/net/netlink.h 28 | 29 | #dist_modules += veth 30 | #build_modules += $(if $(BUILD_VETH),veth) 31 | veth_sources = linux-2.6/compat-2.6/veth.c 32 | veth_headers = 33 | -------------------------------------------------------------------------------- /regress/bin/of_hp_teardown.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use Getopt::Long; 4 | 5 | use OF::OFUtil; 6 | use Test::TestLib; 7 | 8 | my $mapFile; 9 | my $of_hp_switch_ip; 10 | my $of_hp_community; 11 | 12 | # Process command line options 13 | unless ( GetOptions( "map=s" => \$mapFile, ) ) { 14 | print "unrecognized option\n"; 15 | exit 1; 16 | } 17 | 18 | # If not specified on command line, use environment variable. 19 | # Try specific first, then try generic - Jean II 20 | if ( (! defined($mapFile) ) && (defined($ENV{'OFT_HP_MAP_ETH'})) ) { 21 | $mapFile = "$ENV{OFT_HP_MAP_ETH}"; 22 | } 23 | if ( (! defined($mapFile) ) && (defined($ENV{'OFT_MAP_ETH'})) ) { 24 | $mapFile = "$ENV{OFT_MAP_ETH}"; 25 | } 26 | 27 | if ( defined($mapFile) ) { 28 | nftest_process_iface_map($mapFile); 29 | } 30 | 31 | # Get HP switch address - Jean II 32 | if (defined($ENV{'OFT_HP_SWITCH_IP'})) { 33 | $of_hp_switch_ip = $ENV{'OFT_HP_SWITCH_IP'}; 34 | } else { 35 | $of_hp_switch_ip = "10.10.10.1"; 36 | } 37 | if (defined($ENV{'OFT_HP_VLAN'})) { 38 | $of_hp_vlan = $ENV{'OFT_HP_VLAN'}; 39 | } else { 40 | $of_hp_vlan = 18; 41 | } 42 | if (defined($ENV{'OFT_HP_COMMUNITY'})) { 43 | $of_hp_community = $ENV{'OFT_HP_COMMUNITY'}; 44 | } else { 45 | $of_hp_community = 'public'; 46 | } 47 | 48 | # disable OpenFlow module 49 | `snmpset -v2c -c ${of_hp_community} ${of_hp_switch_ip} iso.org.dod.internet.private.enterprises.11.2.14.11.5.1.7.1.35.1.1.2.${of_hp_vlan} i 2`; 50 | 51 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/wiretap/visual.h: -------------------------------------------------------------------------------- 1 | /* visual.h 2 | * 3 | * File read write routines for Visual Networks .cap files. 4 | * Copyright 2001, Tom Nisbet tnisbet@visualnetworks.com 5 | * 6 | * Based on the code that handles netmon files. 7 | * 8 | * $Id: visual.h 3992 2008-06-10 03:13:11Z dgu $ 9 | * 10 | * Wiretap Library 11 | * Copyright (c) 1998 by Gilbert Ramirez 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software 25 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 26 | */ 27 | 28 | #ifndef __VISUAL_H__ 29 | #define __VISUAL_H__ 30 | 31 | int visual_open(wtap *wth, int *err, gchar **err_info); 32 | gboolean visual_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err); 33 | int visual_dump_can_write_encap(int encap); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /datapath/linux-2.6/compat-2.6/include/linux/workqueue.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_WORKQUEUE_WRAPPER_H 2 | #define __LINUX_WORKQUEUE_WRAPPER_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 8 | 9 | #ifdef __KERNEL__ 10 | /* 11 | * initialize a work-struct's func and data pointers: 12 | */ 13 | #undef PREPARE_WORK 14 | #define PREPARE_WORK(_work, _func) \ 15 | do { \ 16 | (_work)->func = (void(*)(void*)) _func; \ 17 | (_work)->data = _work; \ 18 | } while (0) 19 | 20 | /* 21 | * initialize all of a work-struct: 22 | */ 23 | #undef INIT_WORK 24 | #define INIT_WORK(_work, _func) \ 25 | do { \ 26 | INIT_LIST_HEAD(&(_work)->entry); \ 27 | (_work)->pending = 0; \ 28 | PREPARE_WORK((_work), (_func)); \ 29 | init_timer(&(_work)->timer); \ 30 | } while (0) 31 | 32 | #endif /* __KERNEL__ */ 33 | 34 | #endif /* linux kernel < 2.6.20 */ 35 | 36 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) 37 | /* There is no equivalent to cancel_work_sync() so just flush all 38 | * pending work. */ 39 | #define cancel_work_sync(_work) flush_scheduled_work() 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/stat_cmd_args.h: -------------------------------------------------------------------------------- 1 | /* stat_cmd_args.h 2 | * Declarations of routines to register "-z" command-line argument handlers 3 | * for stats 4 | * 5 | * $Id: stat_cmd_args.h 3992 2008-06-10 03:13:11Z dgu $ 6 | * 7 | * Wireshark - Network traffic analyzer 8 | * By Gerald Combs 9 | * Copyright 1998 Gerald Combs 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License 13 | * as published by the Free Software Foundation; either version 2 14 | * of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 | */ 25 | 26 | #ifndef _STAT_H_ 27 | #define _STAT_H_ 28 | 29 | extern void register_stat_cmd_arg(const char *cmd, 30 | void (*func)(const char *arg,void* userdata), void* userdata); 31 | extern gboolean process_stat_cmd_arg(char *optarg); 32 | extern void list_stat_cmd_args(void); 33 | extern void start_requested_stats(void); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /regress/projects/black_box/regress/test_packet_in/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # test_packet_in 3 | 4 | use strict; 5 | use OF::Includes; 6 | 7 | sub my_test { 8 | 9 | my ($sock, $options_ref) = @_; 10 | 11 | my $in_port = $$options_ref{'port_base'}; 12 | my $out_port = $in_port + 1; 13 | 14 | my $pkt = get_default_black_box_pkt( $in_port, $out_port); 15 | nftest_send('eth1', $pkt->packed ); 16 | print "Sent test packet...\n"; 17 | 18 | my $recvd_mesg; 19 | sysread( $sock, $recvd_mesg, 1512 ) || die "Failed to receive message: $!"; 20 | 21 | # Inspect message 22 | my $msg_size = length($recvd_mesg); 23 | my $expected_size = $ofp->offsetof( 'ofp_packet_in', 'data' ) + length( $pkt->packed ); 24 | compare( "msg size", $msg_size, '==', $expected_size ); 25 | 26 | my $msg = $ofp->unpack( 'ofp_packet_in', $recvd_mesg ); 27 | 28 | #print HexDump ($recvd_mesg); 29 | #print Dumper($msg); 30 | 31 | # Verify fields 32 | verify_header( $msg, 'OFPT_PACKET_IN', $msg_size ); 33 | 34 | compare( "total len", $$msg{'total_len'}, '==', length( $pkt->packed ) ); 35 | compare( "in_port", $$msg{'in_port'}, '==', $in_port ); 36 | compare( "reason", $$msg{'reason'}, '==', $enums{'OFPR_NO_MATCH'} ); 37 | 38 | # verify packet was unchanged! 39 | my $recvd_pkt_data = substr( $recvd_mesg, $ofp->offsetof( 'ofp_packet_in', 'data' ) ); 40 | if ( $recvd_pkt_data ne $pkt->packed ) { 41 | die "ERROR: received packet data didn't match packet sent\n"; 42 | } 43 | } 44 | 45 | run_black_box_test( \&my_test, \@ARGV ); 46 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/clopts_common.h: -------------------------------------------------------------------------------- 1 | /* clopts_common.h 2 | * Handle command-line arguments common to Wireshark and TShark 3 | * 4 | * $Id: clopts_common.h 3992 2008-06-10 03:13:11Z dgu $ 5 | * 6 | * Wireshark - Network traffic analyzer 7 | * By Gerald Combs 8 | * Copyright 1998 Gerald Combs 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; either version 2 13 | * of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 | */ 24 | 25 | #ifndef __PROTO_DUMPOPTS_H__ 26 | #define __PROTO_DUMPOPTS_H__ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif /* __cplusplus */ 31 | 32 | int get_natural_int(const char *string, const char *name); 33 | 34 | int get_positive_int(const char *string, const char *name); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* __PROTO_DUMPOPTS_H__ */ 41 | -------------------------------------------------------------------------------- /utilities/wireshark_dissectors/wireshark-1.0.0-includes/epan/adler32.h: -------------------------------------------------------------------------------- 1 | /* adler32.h 2 | * Compute the Adler32 checksum (RFC 1950) 3 | * 2003 Tomas Kukosa 4 | * 5 | * $Id: adler32.h 3992 2008-06-10 03:13:11Z dgu $ 6 | * 7 | * Wireshark - Network traffic analyzer 8 | * By Gerald Combs 9 | * Copyright 1998 Gerald Combs 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License 13 | * as published by the Free Software Foundation; either version 2 14 | * of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 | */ 25 | 26 | #ifndef ADLER32_H 27 | #define ADLER32_H 28 | 29 | #ifdef __cplusplus 30 | extern "C"{ 31 | #endif 32 | 33 | unsigned long update_adler32(unsigned long adler, const unsigned char *buf, int len); 34 | unsigned long adler32_bytes(const unsigned char *buf, int len); 35 | unsigned long adler32_str(const char *buf); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* ADLER32_H */ 42 | 43 | --------------------------------------------------------------------------------