Skip to content

Commit

Permalink
Merge branch 'master' into ipreassembler-push
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Barbette authored Nov 12, 2018
2 parents 417ce72 + 409a9c8 commit e4bf500
Show file tree
Hide file tree
Showing 59 changed files with 1,084 additions and 424 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.idea
.*.cmd
.dotest
.vimhistory
Makefile
autom4te*
bin
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ matrix:

env:
global:
- FLAGS="--enable-ip6 --enable-json --disable-linuxmodule --enable-gtp"
- FLAGS="--enable-ip6 --enable-json --disable-linuxmodule --enable-tunnel"
- CXXFLAGS="-std=gnu++11"
- GCC_VERSION="4.8"
matrix:
Expand Down
41 changes: 35 additions & 6 deletions click-mkelemmap
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ my(%processing_constants) =
my(%flow_code_constants) =
('COMPLETE_FLOW' => 'x/x');
my(@source_file, @header_file, @click_name, @cxx_name, @doc_name,
@parents, @port_count, @processing, @flow_code, @flags, @requirements,
@element_methods, @element_libs, @provisions, @noexports,
@parents, @port_count, @processing, @flow_code, @flags, @batching,
@requirements, @element_methods, @element_libs, @provisions, @noexports,
%click_name_to_id, %cxx_name_to_id, $verbose);
my(@includes) = ( );

my(@base_elements) = ( 'Element', 'BatchElement', 'SimpleElement', 'ClassifyElement', 'SimpleBatchElement' );

my(@batch_elements) = ( 'BatchElement', 'SimpleElement', 'ClassifyElement', 'SimpleBatchElement' );

sub driver_mask ($) {
my($m) = 0;
# XXX "|" syntax?
Expand Down Expand Up @@ -214,6 +218,7 @@ sub process_file ($) {
push @processing, $processing[$i];
push @flow_code, $flow_code[$i];
push @flags, $flags[$i];
push @batching, $batching[$i];
push @element_methods, $element_methods[$i];
push @noexports, 0;
last;
Expand All @@ -233,6 +238,7 @@ sub process_file ($) {
push @processing, "";
push @flow_code, "";
push @flags, undef;
push @batching, "";
push @element_methods, "";
push @noexports, 1;
}
Expand Down Expand Up @@ -267,7 +273,7 @@ sub parents_port_count ($) {
if (!$port_count[$classid]) {
my($parent);
foreach $parent (@{$parents[$classid]}) {
if ($parent eq 'Element' || $parent eq 'BatchElement') {
if ($parent ~~ @base_elements) {
$port_count[$classid] = '0/0';
last;
} elsif ($parent ne '') {
Expand All @@ -285,7 +291,7 @@ sub parents_processing ($) {
if (!$processing[$classid]) {
my($parent);
foreach $parent (@{$parents[$classid]}) {
if ($parent eq 'Element' || $parent eq 'BatchElement') {
if ($parent ~~ @base_elements) {
$processing[$classid] = 'a/a';
last;
} elsif ($parent ne '') {
Expand All @@ -303,7 +309,7 @@ sub parents_flow_code ($) {
if (!$flow_code[$classid]) {
my($parent);
foreach $parent (@{$parents[$classid]}) {
if ($parent eq 'Element' || $parent eq 'BatchElement') {
if ($parent ~~ @base_elements) {
$flow_code[$classid] = 'x/x';
last;
} elsif ($parent ne '') {
Expand All @@ -321,7 +327,7 @@ sub parents_flags ($) {
if (!defined $flags[$classid]) {
my($parent);
foreach $parent (@{$parents[$classid]}) {
if ($parent eq 'Element' || $parent eq 'BatchElement') {
if ($parent ~~ @base_elements) {
last;
} elsif ($parent ne '') {
$flags[$classid] = &parents_flags($cxx_name_to_id{$parent});
Expand All @@ -332,6 +338,24 @@ sub parents_flags ($) {
return $flags[$classid];
}

sub parents_batching ($) {
my($classid) = @_;
return undef if !defined $classid;
if (!$batching[$classid]) {
my($parent);
foreach $parent (@{$parents[$classid]}) {
if ($parent ~~ @batch_elements) {
$batching[$classid] = 1;
last;
} elsif ($parent ne '') {
$batching[$classid] = &parents_batching($cxx_name_to_id{$parent});
last if $batching[$classid];
}
}
}
return $batching[$classid];
}

sub xml_quote ($) {
my($x) = @_;
$x =~ s/&/&/g;
Expand Down Expand Up @@ -547,6 +571,11 @@ foreach $id (sort sorter 0..$#click_name) {
$flags = parents_flags($id) if !defined($flags);
print OUT " flags=\"", $flags, "\"" if defined($flags);

my($b) = $batching[$id];
$b = parents_batching($id) if !$b;
print OUT " batching=\"", $b, "\"" if $b;


print OUT " methods=\"", $element_methods[$id], "\"" if $element_methods[$id];

print OUT " requires=\"", $requirements[$id], "\"" if $requirements[$id];
Expand Down
1 change: 1 addition & 0 deletions conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Folders are organised by demonstrated feature. But some example of course
* grid Grid
* ip6 IPv6
* kernel Kernel-specific feature
* lib Library of elementclass. Include them with require(library conf/lib/*.click)
* nat NAT and LB
* pktgen Packet generation
* proxy Proxy
Expand Down
27 changes: 27 additions & 0 deletions conf/lib/classifier.click
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* ARPHandler
*
* Handle all ARP subsystem and passes only IP packets on output 1.
* Similarly, IP packets should be passed in input 1 and ARPHandler will
* take care of the Ethernet encapsulation
*
* input[0] should receive packets from the device, and output[0] connected
* directly to the same device.
*
* Eg. :
* FromDPDKDevice(0) -> ARPHandler(10.0.0.2, 5B:EC:DE:27:A8:B2);
* arp[0] -> ToDPDKDevice(0);
* arp[1] -> Print("IP PACKET") -> SetIPAddress(10.0.0.1) -> arp[1];
*/
elementclass ARPHandler { $ip, $mac |
input[0] -> c :: Classifier(12/0806 20/0001, // ARP request
12/0806 20/0002, // ARP response
12/0800); // IP packets
c[1] -> [1]arpQ :: ARPQuerier($ip, $mac) -> output[1];
c[0] -> [0]arpR :: ARPResponder($ip $mac);

arpQ->output[0];
c[2]->output[1];

input[1] -> [0]arpQ;
}
26 changes: 13 additions & 13 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,6 @@ enable_aqm
enable_ethernet
enable_etherswitch
enable_grid
enable_gtp
enable_icmp
enable_ip
enable_ip6
Expand All @@ -851,6 +850,7 @@ enable_standard
enable_tcpudp
enable_test
enable_threads
enable_tunnel
enable_wifi
enable_experimental
enable_skip_elements
Expand Down Expand Up @@ -1542,7 +1542,6 @@ Optional Features:
--disable-ethernet do not include Ethernet elements
--enable-etherswitch include Ethernet switch elements
--enable-grid include Grid elements (see FAQ)
--enable-gtp include GTP elements
--disable-icmp do not include ICMP elements
--disable-ip do not include IP elements
--enable-ip6 include IPv6 elements
Expand All @@ -1556,6 +1555,7 @@ Optional Features:
--disable-tcpudp do not include TCP and UDP elements
--disable-test do not include regression test elements
--disable-threads do not include thread management elements
--enable-tunnel include tunnelling elements
--enable-wifi include wifi elements and support
--enable-experimental enable experimental elements in normal groups
--enable-skip-elements=ELTS
Expand Down Expand Up @@ -7400,17 +7400,6 @@ test "x$enable_all_elements" = xyes -a \( "x$enable_grid" = xNO -o "x$enable_gri
if test "x$enable_grid" = xyes; then
:

fi
# Check whether --enable-gtp was given.
if test "${enable_gtp+set}" = set; then :
enableval=$enable_gtp;
else
enable_gtp=NO
fi
test "x$enable_all_elements" = xyes -a \( "x$enable_gtp" = xNO -o "x$enable_gtp" = x \) && enable_gtp=yes
if test "x$enable_gtp" = xyes; then
:

fi
# Check whether --enable-icmp was given.
if test "${enable_icmp+set}" = set; then :
Expand Down Expand Up @@ -7557,6 +7546,17 @@ test "x$enable_all_elements" = xyes -a \( "x$enable_threads" = xNO -o "x$enable_
if test "x$enable_threads" = xyes; then
:

fi
# Check whether --enable-tunnel was given.
if test "${enable_tunnel+set}" = set; then :
enableval=$enable_tunnel;
else
enable_tunnel=NO
fi
test "x$enable_all_elements" = xyes -a \( "x$enable_tunnel" = xNO -o "x$enable_tunnel" = x \) && enable_tunnel=yes
if test "x$enable_tunnel" = xyes; then
:

fi
# Check whether --enable-wifi was given.
if test "${enable_wifi+set}" = set; then :
Expand Down
26 changes: 22 additions & 4 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,21 @@ fi

AC_SEARCH_LIBS([MHD_start_daemon], [microhttpd], [ac_have_libmicrohttpd=yes], [ac_have_libmicrohttpd=no])
AC_CHECK_HEADERS([microhttpd.h], [ac_have_microhttpd_h=yes], [ac_have_microhttpd_h=no])
#if test "$ac_have_libpthread$ac_have_pthread_h" = yesyes; then
if test "$ac_have_libmicrohttpd$ac_have_microhttpd_h" = yesyes; then
if test "x$ac_have_libmicrohttpd$ac_have_microhttpd_h" = "xyesyes"; then
AC_DEFINE([HAVE_MICROHTTPD])
fi

AC_CHECK_LIB([re2], [main], [ac_have_re2=yes], [ac_have_re2=no])
AC_CHECK_HEADERS([re2/re2.h], [ac_have_re2_h=yes], [ac_have_re2_h=no])
if test "x$ac_have_re2$ac_have_re2_h" = "xyesyes"; then
have_re2=yes
LIBS="$LIBS -lre2"
AC_DEFINE([HAVE_RE2])
else
have_re2=no
fi



AC_ARG_ENABLE([select],
[AS_HELP_STRING([ --enable-select=[[select|poll|kqueue]]], [set file descriptor wait mechanism])
Expand Down Expand Up @@ -619,7 +629,6 @@ ELEMENTS_ARG_ENABLE(aqm, [include active queue management elements], yes)
ELEMENTS_ARG_ENABLE(ethernet, [include Ethernet elements], yes)
ELEMENTS_ARG_ENABLE(etherswitch, [include Ethernet switch elements], NO)
ELEMENTS_ARG_ENABLE(grid, [include Grid elements (see FAQ)], NO)
ELEMENTS_ARG_ENABLE(gtp, [include GTP elements], NO)
ELEMENTS_ARG_ENABLE(icmp, [include ICMP elements], yes)
ELEMENTS_ARG_ENABLE(ip, [include IP elements], yes)
ELEMENTS_ARG_ENABLE(ip6, [include IPv6 elements], NO, AC_DEFINE(HAVE_IP6))
Expand All @@ -634,6 +643,7 @@ ELEMENTS_ARG_ENABLE(standard, [include standard elements], yes)
ELEMENTS_ARG_ENABLE(tcpudp, [include TCP and UDP elements], yes)
ELEMENTS_ARG_ENABLE(test, [include regression test elements], yes)
ELEMENTS_ARG_ENABLE(threads, [include thread management elements], yes)
ELEMENTS_ARG_ENABLE(tunnel, [include tunnelling elements], NO)
ELEMENTS_ARG_ENABLE(wifi, [include wifi elements and support], NO)
AC_ARG_ENABLE(experimental, [AS_HELP_STRING([--enable-experimental], [enable experimental elements in normal groups])], :, enable_experimental=no)
AC_ARG_ENABLE(skip-elements, [AS_HELP_STRING([--enable-skip-elements=ELTS], [disable comma-separated elements])], :, enable_skip_elements=no)
Expand Down Expand Up @@ -2291,6 +2301,11 @@ if test "x$HAVE_PCAP" = xyes; then
provisions="$provisions pcap"
fi

dnl add 're2' if re2 is available
if test "x$have_re2" == xyes; then
provisions="$provisions re2"
fi

dnl add 'smpclick' if compiled with --enable-multithread > 1
if test "$enable_multithread" != no; then
provisions="$provisions smpclick"
Expand Down Expand Up @@ -2345,12 +2360,15 @@ AC_OUTPUT

echo "

Configuration:
Configuration Summary:
C Compiler: ${CC}
C++ Compiler: ${CXX}

DPDK support: ${enable_dpdk}
Netmap support: ${HAVE_NETMAP}
PCAP support: ${HAVE_PCAP}

RE2 support: ${have_re2}
"

echo "Now type make to build FastClick..."
3 changes: 2 additions & 1 deletion doc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mandir = @mandir@
datarootdir = @datarootdir@
datadir = @datadir@
clickdatadir = $(datadir)/click
github_path = http://github.com/tbarbette/fastclick/

PERL = @PERL@
INSTALL = @INSTALL@
Expand Down Expand Up @@ -103,7 +104,7 @@ install-man-markdown:
$(PERL) $(srcdir)/man2html --markdown $(MAN2MARKDOWN_ARGS) -l $(srcdir)/click.5 -d $(O) -o $(O)/Language.md
$(PERL) $(srcdir)/man2html --markdown $(MAN2MARKDOWN_ARGS) -l $(srcdir)/click.o.8 -d $(O) -o $(O)/Linuxmodule.md
$(PERL) $(srcdir)/man2html --markdown $(MAN2MARKDOWN_ARGS) -l $(srcdir)/elementdoc.7 -d $(O) -o $(O)/Elementdoc.md
echo $(MARKDOWN_PROVISIONS) | $(top_builddir)/bin/click-buildtool findelem -r "$(MARKDOWN_PROVISIONS)" -p $(top_srcdir) | $(PERL) $(top_srcdir)/click-mkelemmap -r "$(PROVISIONS)" -t "userlevel linuxmodule ns" -p "$(top_srcdir)" -Iinclude -s "`cd $(top_srcdir) && pwd`" | $(PERL) $(srcdir)/click-elem2man -d $(O) --markdown -l -p $(top_srcdir) -
echo $(MARKDOWN_PROVISIONS) | $(top_builddir)/bin/click-buildtool findelem -r "$(MARKDOWN_PROVISIONS)" -p $(top_srcdir) | $(PERL) $(top_srcdir)/click-mkelemmap -r "$(PROVISIONS)" -t "userlevel linuxmodule ns" -p "$(top_srcdir)" -Iinclude -s "`cd $(top_srcdir) && pwd`" | $(PERL) $(srcdir)/click-elem2man -g $(github_path) -d $(O) --markdown -l -p $(top_srcdir) -

always:
@:
Expand Down
Loading

0 comments on commit e4bf500

Please sign in to comment.