Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
72f3642
Force dwarf-2 for now. It's dumb and it's been fixed in subsequent ve…
Apr 15, 2014
ea2cd41
Initial hacked up sysctl unix socket.
Apr 15, 2014
47175cd
Paranoia?
Apr 15, 2014
c404a89
Add in a hack to expose the general sysctlbyname API.
Apr 15, 2014
90f0da5
Flesh out more of this totally untested code.
Apr 15, 2014
8595c13
* add a call to uinet_initialize_thread(); - it's required or things …
Apr 15, 2014
5e7cf69
Start fleshing out a test sysctl program.
Apr 15, 2014
5d98542
* Add an unused flags header.
Apr 16, 2014
e4e76b9
If we suceeeded in the call, write out a response.
Apr 16, 2014
f52004a
Handle the response from the server.
Apr 16, 2014
cee453e
* Refactor out the string sysctl fetch code into a separate routine.
Apr 16, 2014
c84933c
It's time I added support for alternate test strings.
Apr 16, 2014
e12180d
Do some more length validation.
Apr 16, 2014
e8e23b0
Add in libnv from -HEAD.
Apr 16, 2014
766780d
Rewrite everything to use libnv.
Apr 16, 2014
63b4cf4
Refactor out the sysctlbyname stuff into a new function, uinet_sysctl…
Apr 16, 2014
c952b66
Migrate uinet_sysctl() to uinet_sysctlbyname() - it's the correct nam…
Apr 16, 2014
648a764
Oops, naming conflict with the uinet stuff. Fix.
Apr 16, 2014
74d679f
Begin fleshing out (untested for now) OID based sysctl.
Apr 16, 2014
f12ed2b
Break out the sysctl glue to external functions.
Apr 16, 2014
8da79f7
Dirty - but sysctl -a (which doesn't yet work) requires allproc_lock.
Apr 16, 2014
02c9d9b
* Make sure we set oldlenp based on rlen.
Apr 17, 2014
98d8e08
I'm now hacking on the freebsd supplied sysctl; move the old sysctl.c…
Apr 17, 2014
6c76d01
Try to handle the case where no oldp buffer is provided, but we do want
Apr 17, 2014
91fff7d
Initialise rval = 0 so it doesn't return bogus values if it's not
Apr 17, 2014
332c153
Merge branch 'passive_receive' of github.com:pkelsey/libuinet into pa…
Apr 17, 2014
c64bcc9
Toss this; patrick committed a real fix.
Apr 17, 2014
0b1c48e
unlink before creating the socket.
Apr 18, 2014
51abb37
NULL out the nvlist pointers so we don't free an invalid pointer if
Apr 18, 2014
b7fd67b
Return -1 if errno is set.
Apr 18, 2014
c310651
Merge branch 'passive_receive' of github.com:pkelsey/libuinet into pa…
Apr 21, 2014
936d899
* Refactor out the common code from the byname and byoid paths into a…
Apr 21, 2014
aa23ad0
(note: grr, should be using a generic C RPC thing already. This hand …
Apr 21, 2014
3540ba3
Merge branch 'passive_receive' of github.com:pkelsey/libuinet into pa…
Apr 22, 2014
b0caebd
Fix merge.
Apr 22, 2014
b010aee
Make the sysctl debugging configurable.
Apr 22, 2014
3ba27f1
Migrate the single define that we're currently using into
Apr 22, 2014
0c1df2f
Add in the client-side support for using POSIX shm for the response
Apr 22, 2014
219638e
This is the first cut of the server side SHM sysctl response stuff.
Apr 22, 2014
84d9d15
Add missing break.
Apr 23, 2014
a0782f0
Merge branch 'passive_receive' of github.com:pkelsey/libuinet into pa…
Apr 23, 2014
db177ed
Merge branch 'passive_receive' of github.com:pkelsey/libuinet into pa…
Apr 23, 2014
ca5cf54
Merge branch 'passive_receive' of github.com:pkelsey/libuinet into pa…
Apr 23, 2014
9cd8b92
Merge branch 'passive_receive' of github.com:pkelsey/libuinet into pa…
Apr 24, 2014
a27578d
Merge github.com:pkelsey/libuinet into passive_receive_adrian
Apr 25, 2014
e9a952d
Preparation work for unifying the sysctl and sysctlbyname routines
Apr 25, 2014
d0d0d18
Refactor out the init and completion code into worker functions.
Apr 25, 2014
00cbbd4
Unused.
Apr 25, 2014
0f3966b
Refactor out the setup code.
Apr 25, 2014
3527660
The req_oid and req_oid fields are private to the OID sysctl routine.
Apr 25, 2014
76bc0bf
Re-implement sysctlbyname.
Apr 25, 2014
08f8a50
Tidy up how the debugging printing is enabled or not.
Apr 25, 2014
d37b4fc
Modify the comment - the code below actually does the check.
Apr 28, 2014
8086fbd
* Break out the sysctl api bits into a public and private include file.
Apr 28, 2014
d93d53b
Document libnv.
Apr 28, 2014
c095796
Don't build .so.
Apr 28, 2014
2c31e16
Migrate all of the sysctl api stuff into libuinet.
Apr 28, 2014
d0dc394
Shuffle all of the assert() things that use strings over to use
May 2, 2014
a05c4dd
Don't use DEBUG, use DEBUG_FLAGS.
May 7, 2014
b538807
DEBUG needs to be defined as part of the kernel build to get debug fl…
May 7, 2014
1432a11
add some install targets everywhere.
May 7, 2014
6e561ad
Merge branch 'master' into passive_receive_adrian
May 7, 2014
016f36d
gmake-ify these things.
May 7, 2014
2e02209
Add a very basic wrapper makefile.
May 7, 2014
afab3b2
Add subdirectory targeting Makefiles with the relevant dumb hackery t…
May 7, 2014
ab18429
Add cflags.mk which has the debug flags for building.
May 7, 2014
7266fc1
Yes, we need this.
May 8, 2014
0b43c54
Migrate all of the public libnv stuff to be called libuinetnv and uin…
May 8, 2014
8c99292
Don't build the shared library for libev.
May 8, 2014
f7fbfbb
Merge github.com:pkelsey/libuinet into passive_receive_adrian
May 8, 2014
e3db2dd
Install the shared library too.
May 9, 2014
3efd5ca
Merge github.com:pkelsey/libuinet into passive_receive_adrian
May 10, 2014
d541f3a
Add some more printf kernel calls, so they're used by the kernel code
May 13, 2014
ec7ed0d
Revert this; Patrick fixed it in his tree.
May 13, 2014
1f1f17e
Merge github.com:pkelsey/libuinet into passive_receive_adrian
May 13, 2014
9a1ec31
Add an evil, evil hack to register a userland hook via pfil on AF_INET.
May 13, 2014
00cd13a
.. and whislt I'm here, don't provide l2 information if it's not
May 13, 2014
b63489d
Flesh out the very basic framework for a libuinet 2-interface
May 29, 2014
f2cca7e
Start fleshing out the rest of the bridge interface framework.
May 30, 2014
0f169d1
Flesh out enough code to add things to the bridge list.
May 30, 2014
23c1fb8
This is a totally untested path to push the intercepted packet up to the
May 31, 2014
2502ca7
Untested hack to at least duplicate the mbuf and send it on its way to
May 31, 2014
291532a
Now that this is working, we don't need it.
May 31, 2014
f75c1cc
now that I'm tinkering with bridging, the pfil hook ends up doing IP …
May 31, 2014
6eb63da
Add in a basic config string parser.
May 31, 2014
1498a3c
Remove this; it's not required for our platforms and it's just fragme…
May 31, 2014
dfcd958
Add the ifnet to uinet_config_if. That way it can be used by other code
Jun 2, 2014
25fd466
Implement a hacky and not-even-yet-tested transmit method.
Jun 2, 2014
216bb2a
Modify the API to have an inside and outside interface tag.
Jun 2, 2014
ff7bcc7
Turns out that we don't get access to the uinet_config_if from outside
Jun 9, 2014
840983e
Merge branch 'master' into passive_receive_adrian
Jun 26, 2014
78fc0b1
Merge branch 'master' into passive_receive_adrian
Jun 27, 2014
f0fa98c
Merge branch 'master' into passive_receive_adrian
Jul 1, 2014
c2334cc
Force this to make.
Jul 4, 2014
8b6a4ab
Add an initial hack to implement multi-span support.
Jul 4, 2014
bab05ca
Oops - make it compile.
Jul 4, 2014
3e2e79d
Disable zero-copy receive for now.
Jul 17, 2014
af5ba6e
Make compile!
Jul 17, 2014
b79fcf8
Add libmemstat from freebsd-9 into the tree:
Jul 17, 2014
021e574
Migrate the malloc path to use u_sysctl.
Jul 17, 2014
602a81d
fix off-by-one comparison.
Jul 17, 2014
8146ed8
Add SNMP maxid. Required for memstat consumer.
Jul 17, 2014
c06361c
Add in malloc stats - in case libuinet implements malloc tracking.
Jul 17, 2014
c2885e0
Add missing files!
Jul 17, 2014
be0916c
Max number of CPUs.
Jul 22, 2014
029a967
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Jul 22, 2014
3f19205
Add kdb definitions for use when witness and other debugging options
Jul 22, 2014
fdaf754
WITNESS assumes GIANT is held and will unlock/relock it during startup.
Jul 22, 2014
4530e96
Expose a stack unwind function function that uses libunwind.
Jul 22, 2014
73b3b2a
Add a subr_stack.c stub that uses the uinet host interface to expose
Jul 22, 2014
e757314
Add panicstr - required by WITNESS and other things that call panic().
Jul 22, 2014
cb90d9b
Add rmlock debug function methods.
Jul 22, 2014
87bdd5a
sprinkle WITNESS lines appropriate throughout rwlock.
Jul 22, 2014
6237715
* Add mutex WITNESS bits
Jul 22, 2014
3007cbc
* Make witness compile!
Jul 22, 2014
c448781
Add a blank witness option file.
Jul 22, 2014
b82e439
Add placeholders for witness.
Jul 22, 2014
8e29acc
Break out the witness bits into a separate source section so we can
Jul 22, 2014
81f5af5
Allow UINET_LOCK_DEBUG to enable lock debugging.
Jul 22, 2014
fa39be2
Add in the ability to log locking operations.
Jul 22, 2014
7777166
Oops - don't enable this byd efault.
Jul 22, 2014
743ebc9
Add some extra fields for logging - the tid and original lock pointer.
Jul 22, 2014
c6fd6e4
Disable witness on uio for now - sx locks aren't real sx locks
Jul 23, 2014
c20550b
Fix some lock order and unlock-a-not-locked-lock due to how the passi…
Jul 23, 2014
136104b
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Jul 23, 2014
4d2c70a
Re-enable zero-copy.
Jul 28, 2014
49d9c3c
Don't compile witness by default.
Jul 28, 2014
586ea89
Experiment - use m_copypacket() instead.
Jul 28, 2014
51b974b
it turns out that doing lots of 6 byte memcpy()'s is dumb on modern
Jul 30, 2014
b1f88b5
* Use ETHER_ADDR_COPY() appropriately
Jul 30, 2014
ecc4827
Disable TCP checksumming.
Jul 30, 2014
675aca9
Don't do local interface processing - it's not needed.
Jul 30, 2014
0147419
Go back to m_dup() for now.
Aug 1, 2014
3d4c4af
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Aug 12, 2014
b4a21eb
Disable sysctl debugging for now.
Aug 31, 2014
e3b73c6
Merge branch 'master' into passive_receive_adrian
Aug 31, 2014
6ad26a4
Merge branch 'master' into passive_receive_adrian
Aug 31, 2014
8526108
Merge branch 'master' into passive_receive_adrian
Aug 31, 2014
a181f3c
Make the sysctl socket path configurable.
Aug 31, 2014
ddc794e
Fix compilation.
Aug 31, 2014
9f94f5d
Allow the sysctl socket to be set by the SYSCTL_SOCK environment
Aug 31, 2014
9df1ae2
Merge commit '6dde492479b983dcc89478682f0b9c2bedcfc82c' into passive_…
Aug 31, 2014
2d7a976
Fix up the new lock types now that the rmlock/sx locks aren't just
Aug 31, 2014
f2e38c4
Merge branch 'master' into passive_receive_adrian
Aug 31, 2014
33ec673
Make this code compile with witness enabled.
Sep 1, 2014
6dacab0
This isn't used anymore!
Sep 1, 2014
16003de
Merge branch 'master' into passive_receive_adrian
Sep 1, 2014
5411f88
Remove this - it's no longer true.
Sep 1, 2014
689faff
Merge branch 'master' into passive_receive_adrian
Sep 1, 2014
31b21d5
This is already in uinet_api.h so get rid of it from here.
Sep 1, 2014
c7d0749
It's not really a hack anymore, so don't say it is.
Sep 1, 2014
16b1c75
Merge branch 'master' into passive_receive_adrian
Sep 1, 2014
e8982d6
* Correct witness checks in rmlock rlock
Sep 2, 2014
3096315
refs #2690 - API to clean tcpstats.
Sep 3, 2014
46b42db
Need to export uinet_cleartcpstat.
Sep 3, 2014
0e6bc42
refs #2690 - add uinet_clearifstat() to clear interface stats.
Sep 3, 2014
7891209
Makefiles should abort when a target fails. Cleanup.
Sep 3, 2014
2acaccb
add hooks for maintainer-clean
splbio Sep 3, 2014
4be0960
bzero() the cpuset before using it.
Sep 3, 2014
5a09102
Initialise the socklen parameter before passing it to accept().
Sep 3, 2014
7d31758
* Be more verbose if the call to RAND_pseudo_bytes returned an error;
Sep 4, 2014
912287e
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 8, 2014
eb0046b
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 8, 2014
3bdd8bb
Merge branch 'passive_receive_adrian' of git+ssh://build.norse-data.c…
Sep 8, 2014
0a79bfe
g++ is a bad default. Bad gmake, bad.
Sep 8, 2014
6a3ec5a
Add cflags.mk to things so the install target works.
Sep 8, 2014
cd68785
maintainer-clean target.
splbio Sep 10, 2014
77154e0
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 10, 2014
d00e3d5
Merge branch 'passive_receive_adrian' of git+ssh://build.norse-data.c…
Sep 10, 2014
b71be6c
Cleanly shut down the bridge/netmap interfaces.
Sep 10, 2014
042c33f
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 11, 2014
2c677db
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 11, 2014
b81e50b
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 12, 2014
f40c83d
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 22, 2014
81b54bc
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 22, 2014
5f7fa75
Include a version file in the build.
splbio Sep 23, 2014
04d8083
Fixup install path for libuinet version file.
splbio Sep 23, 2014
4391646
Need -lcrypto for FreeBSD 10.1
splbio Sep 24, 2014
ee0756f
This file is generated remove it.
claudiay Sep 26, 2014
d1ec054
Add in a little hack to tag mbufs with bridge directionality.
Sep 26, 2014
8d7b452
Merge branch 'passive_receive_adrian' of git+ssh://build.norse-data.c…
Sep 29, 2014
c0ccc14
Name the sysctl thread.
Sep 30, 2014
2b78ae6
Merge remote-tracking branch 'upstream/master' into passive_receive_a…
Sep 30, 2014
1ff3d1e
Make it build again.
Sep 30, 2014
89fc9bb
The new tag allocator doesn't seem to be zero'ing things.
Oct 1, 2014
efb8dd4
Be defensive - clear direction flags before we set one.
Oct 1, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
include cflags.mk

SUBDIRS=lib bin

config all clean install maintainer-clean:
for d in $(SUBDIRS); do ( cd $$d && $(MAKE) $@) || exit 1 ; done
if [ "$@" = "all" -o "$@" = "install" ] ; then $(MAKE) $@-extra ; fi
#if [ "$@" = "all" ] ; then rm -f version.extended ; $(MAKE) version.extended ; fi
easy_start: config all

config:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) config ) ; done
.PHONY: version.extended

all:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) all ) ; done
all-extra: version.extended

clean:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) clean ) ; done

install:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) install ) ; done
install-extra:
mkdir -p ${UINET_DESTDIR}/etc/libuinet
cp version.extended ${UINET_DESTDIR}/etc/libuinet/version.extended

version.extended:
echo "buildroot: ${CURDIR}" > $@
echo "date: `date`" >> $@
echo "git-sha: `git rev-parse --short HEAD`" >> $@
echo "git-branch: `git rev-parse --abbrev-ref HEAD`" >> $@
14 changes: 2 additions & 12 deletions bin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,5 @@ ifeq (${HOST_OS},FreeBSD)
SUBDIRS+=sysctl vmstat
endif

config:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) config ) ; done

all:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) all ) ; done

clean:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) clean ) ; done

install:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) install ) ; done

config all clean install maintainer-clean:
for d in $(SUBDIRS); do ( cd $$d && $(MAKE) $@) || exit 1 ; done
3 changes: 1 addition & 2 deletions bin/echo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ TOPDIR?=${CURDIR}/../..
include ${TOPDIR}/cflags.mk

PROG=echo

UINET_LIBS=uinet

CFLAGS= -I${TOPDIR}/lib/libev

LDADD= -L${UINET_DESTDIR}/lib/ ${TOPDIR}/lib/libev/.libs/libev.a -lm -lpcap

include ${TOPDIR}/mk/prog.mk
10 changes: 5 additions & 5 deletions bin/passive/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ UINET_LIBES+=uinetnv
endif


CFLAGS= -I${TOPDIR}/lib/libev
ifeq (${HOST_OS},FreeBSD)
CFLAGS+= -I${TOPDIR}/lib/libnv
endif
LDADD= -L${UINET_DESTDIR}/lib/ ${TOPDIR}/lib/libev/.libs/libev.a -lm -lpcap
CFLAGS+= -I${TOPDIR}/lib/libuinetnv -I${TOPDIR}/lib/libev
LDADD= -L${UINET_DESTDIR}/lib/ ${TOPDIR}/lib/libev/.libs/libev.a ${TOPDIR}/lib/libuinetnv/libuinetnv.a -lm -lpcap

ifndef NO_EXTRACT
CFLAGS+= -I${TOPDIR}/lib/libhttp_parser -DENABLE_EXTRACT
LDADD+= -L${TOPDIR}/lib/libhttp_parser -lhttp_parser -lz
endif

maintainer-clean:
$(MAKE) clean

include ${TOPDIR}/mk/prog.mk
13 changes: 13 additions & 0 deletions bin/passive/passive.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#ifdef ENABLE_EXTRACT
#include <zlib.h>
#endif

#include <netinet/in.h>

#include "uinet_api.h"
#include "uinet_host_sysctl_api.h"
#include "uinet_host_sysctl_api_priv.h"

#ifdef ENABLE_EXTRACT
#include "http_parser.h"
Expand Down Expand Up @@ -1250,6 +1253,7 @@ int main (int argc, char **argv)
struct uinet_in_addr tmpinaddr;
int ifnetmap_count = 0;
int ifpcap_count = 0;
pthread_t sysctl_thr;
struct content_type *contype;

memset(interfaces, 0, sizeof(interfaces));
Expand Down Expand Up @@ -1517,12 +1521,21 @@ int main (int argc, char **argv)
interface_thread_start, &interfaces[i]);
}

error = pthread_create(&sysctl_thr, NULL,
uinet_host_sysctl_listener_thread, NULL);
if (error != 0) {
printf("Failed to bring up sysctl thread: %d\n", errno);
}

for (i = 0; i < num_interfaces; i++) {
if (0 == interfaces[i].thread_create_result)
pthread_join(interfaces[i].thread, NULL);
}

uinet_shutdown(0);

/* XXX only do this if we successfully started the thread! */
pthread_join(sysctl_thr, NULL);

return (0);
}
1 change: 1 addition & 0 deletions bin/sysctl/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TOPDIR?=${CURDIR}/../..
include ${TOPDIR}/cflags.mk

PROG=sysctl

Expand Down
1 change: 1 addition & 0 deletions bin/vmstat/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TOPDIR?=${CURDIR}/../..
include ${TOPDIR}/cflags.mk

PROG=vmstat

Expand Down
3 changes: 3 additions & 0 deletions cflags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ DEBUG_FLAGS ?= -O -gdwarf-2

UINET_DESTDIR ?= /usr/local/

#CFLAGS+= -fPIC
#LDFLAGS+= -fPIC

UINET_INSTALL ?= install
UINET_INSTALL_DIR ?= $(UINET_INSTALL) -m 0755
UINET_INSTALL_LIB ?= $(UINET_INSTALL) -m 0644
Expand Down
3 changes: 3 additions & 0 deletions lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ LDADD+= -lcrypto
else
LDADD+= -lssl
endif
ifeq "${OSNAME}" "FreeBSD"
LDADD+= -lcrypto
endif
10 changes: 2 additions & 8 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ default: all
config:
(cd libev ; env CFLAGS="${DEBUG_FLAGS}" ./configure --with-uinet=../libuinet/api_include --prefix="${UINET_DESTDIR}" --includedir="${UINET_DESTDIR}/include/libev" --enable-shared=no )

all:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) all ) ; done

clean:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) clean ) ; done

install:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) install ) ; done
all clean install maintainer-clean:
for d in $(SUBDIRS); do ( cd $$d && $(MAKE) $@ ) || exit 1 ; done

default: config all
Loading