Skip to content

Commit

Permalink
[libnozzle] rename libtap to libnozzle (part 1)
Browse files Browse the repository at this point in the history
Our fearless Debian maintainer wferi made us aware that TAP is an overloaded
term already and it would be very confusing to add yet another one.

nozzle is a good pick from http://www.thesaurus.com/browse/tap

I am sure lib*cock* would have cause havoc :-)

This commit only rename files and allow builds. The API needs to be renamed too,
but that will come over time with major code cleanup as documented here:
https://trello.com/c/pyEKd4UH/396-libnozzle-make-it-production-ga-ready

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Nov 28, 2017
1 parent 5a80dd0 commit b5823ab
Show file tree
Hide file tree
Showing 23 changed files with 62 additions and 62 deletions.
8 changes: 4 additions & 4 deletions Makefile.am
Expand Up @@ -27,7 +27,7 @@ EXTRA_DIST = build-aux autogen.sh .version \
NOTES_TO_PACKAGE_MAINTAINERS \
$(SPEC).in

SUBDIRS = init libtap libknet kronosnetd
SUBDIRS = init libnozzle libknet kronosnetd

if BUILD_POC
SUBDIRS += poc-code
Expand Down Expand Up @@ -133,10 +133,10 @@ if BUILD_KRONOSNETD
else
sed -i -e "s#@kronosnetd@#bcond_with#g" $@-t
endif
if BUILD_LIBTAP
sed -i -e "s#@libtap@#bcond_without#g" $@-t
if BUILD_LIBNOZZLE
sed -i -e "s#@libnozzle@#bcond_without#g" $@-t
else
sed -i -e "s#@libtap@#bcond_with#g" $@-t
sed -i -e "s#@libnozzle@#bcond_with#g" $@-t
endif
if BUILD_RUNAUTOGEN
sed -i -e "s#@runautogen@#bcond_without#g" $@-t
Expand Down
2 changes: 1 addition & 1 deletion NOTES_TO_PACKAGE_MAINTAINERS
Expand Up @@ -8,7 +8,7 @@ DO NOT ship kronosnetd. It's an experimental piece of super
crappy code. IF you decide to ship it anyway, you get to
be also the upstream maintainer :-) you have been warned.

libtap is a simple commodity library used only by kronosnetd.
libnozzle is a simple commodity library used only by kronosnetd.
I don't mind to support it, but don't ship just for the fun of it.
It has no users, that I know of, outside of kronosnetd.

Expand Down
2 changes: 1 addition & 1 deletion README
Expand Up @@ -33,4 +33,4 @@ knet requires big socket buffers and you need to set:
kern.ipc.maxsockbuf=18388608
in /etc/sysctl.conf or knet will fail to run.

libtap requires if_tap.ko loaded in the kernel.
libnozzle requires if_tap.ko loaded in the kernel.
14 changes: 7 additions & 7 deletions configure.ac
Expand Up @@ -140,14 +140,14 @@ AC_ARG_ENABLE([runautogen],
[ enable_runautogen="no" ])
AM_CONDITIONAL([BUILD_RUNAUTOGEN], [test x$enable_runautogen = xyes])

AC_ARG_ENABLE([libtap],
[ --enable-libtap : libtap support ],,
[ enable_libtap="no" ])
AC_ARG_ENABLE([libnozzle],
[ --enable-libnozzle : libnozzle support ],,
[ enable_libnozzle="no" ])

if test "x$enable_kronosnetd" = xyes; then
enable_libtap=yes
enable_libnozzle=yes
fi
AM_CONDITIONAL([BUILD_LIBTAP], [test x$enable_libtap = xyes])
AM_CONDITIONAL([BUILD_LIBNOZZLE], [test x$enable_libnozzle = xyes])

## local helper functions
# this function checks if CC support options passed as
Expand Down Expand Up @@ -501,8 +501,8 @@ LDFLAGS="$ENV_LDFLAGS $lt_prog_compiler_pic"
AC_CONFIG_FILES([
Makefile
init/Makefile
libtap/Makefile
libtap/libtap.pc
libnozzle/Makefile
libnozzle/libnozzle.pc
kronosnetd/Makefile
kronosnetd/kronosnetd.logrotate
libknet/Makefile
Expand Down
40 changes: 20 additions & 20 deletions kronosnet.spec.in
Expand Up @@ -25,7 +25,7 @@
%@lzma@ lzma
%@bzip2@ bzip2
%@kronosnetd@ kronosnetd
%@libtap@ libtap
%@libnozzle@ libnozzle
%@runautogen@ runautogen

%if %{with sctp}
Expand All @@ -52,11 +52,11 @@
%if %{with bzip2}
%global buildcompressbzip2 1
%endif
%if %{with libtap}
%global buildlibtap 1
%if %{with libnozzle}
%global buildlibnozzle 1
%endif
%if %{with kronosnetd}
%global buildlibtap 1
%global buildlibnozzle 1
%global buildkronosnetd 1
%endif
%if %{with runautogen}
Expand Down Expand Up @@ -166,8 +166,8 @@ BuildRequires: libtool
%if %{defined buildkronosnetd}
--enable-kronosnetd \
%endif
%if %{defined buildlibtap}
--enable-libtap \
%if %{defined buildlibnozzle}
--enable-libnozzle \
%endif
--with-initdefaultdir=%{_sysconfdir}/sysconfig/ \
%if %{defined _unitdir}
Expand Down Expand Up @@ -282,42 +282,42 @@ fi
%{_mandir}/man8/*
%endif

%if %{defined buildlibtap}
%package -n libtap1
%if %{defined buildlibnozzle}
%package -n libnozzle1
Group: System Environment/Libraries
Summary: Simple userland wrapper around kernel tap devices

%description -n libtap1
%description -n libnozzle1
This is an over-engineered commodity library to manage a pool
of tap devices and provides the basic
pre-up.d/up.d/down.d/post-down.d infrastructure.

%files -n libtap1
%files -n libnozzle1
%defattr(-,root,root,-)
%doc COPYING.* COPYRIGHT
%{_libdir}/libtap.so.*
%{_libdir}/libnozzle.so.*

%post -n libtap1 -p /sbin/ldconfig
%post -n libnozzle1 -p /sbin/ldconfig

%postun -n libtap1 -p /sbin/ldconfig
%postun -n libnozzle1 -p /sbin/ldconfig

%package -n libtap1-devel
%package -n libnozzle1-devel
Group: Development/Libraries
Summary: Simple userland wrapper around kernel tap devices (developer files)
Requires: libtap1 = %{version}-%{release}
Requires: libnozzle1 = %{version}-%{release}
Requires: pkgconfig

%description -n libtap1-devel
%description -n libnozzle1-devel
This is an over-engineered commodity library to manage a pool
of tap devices and provides the basic
pre-up.d/up.d/down.d/post-down.d infrastructure.

%files -n libtap1-devel
%files -n libnozzle1-devel
%defattr(-,root,root,-)
%doc COPYING.* COPYRIGHT
%{_libdir}/libtap.so
%{_includedir}/libtap.h
%{_libdir}/pkgconfig/libtap.pc
%{_libdir}/libnozzle.so
%{_includedir}/libnozzle.h
%{_libdir}/pkgconfig/libnozzle.pc
%endif

%package -n libknet1
Expand Down
4 changes: 2 additions & 2 deletions kronosnetd/Makefile.am
Expand Up @@ -34,14 +34,14 @@ kronosnetd_SOURCES = \
vty_utils.c

kronosnetd_CPPFLAGS = \
-I$(top_srcdir)/libtap \
-I$(top_srcdir)/libnozzle \
-I$(top_srcdir)/libknet

kronosnetd_CFLAGS = $(libqb_CFLAGS)

kronosnetd_LDADD = \
$(top_builddir)/libknet/libknet.la \
$(top_builddir)/libtap/libtap.la \
$(top_builddir)/libnozzle/libnozzle.la \
$(libqb_LIBS) \
$(pam_misc_LIBS) $(pam_LIBS)

Expand Down
2 changes: 1 addition & 1 deletion kronosnetd/cfg.c
Expand Up @@ -14,7 +14,7 @@
#include <string.h>

#include "cfg.h"
#include "libtap.h"
#include "libnozzle.h"

struct knet_cfg *knet_get_iface(const char *name, int create)
{
Expand Down
2 changes: 1 addition & 1 deletion kronosnetd/cfg.h
Expand Up @@ -13,7 +13,7 @@
#include <stdint.h>
#include <net/if.h>

#include "libtap.h"
#include "libnozzle.h"
#include "libknet.h"

#define KNET_RING_DEFPORT 50000
Expand Down
2 changes: 1 addition & 1 deletion kronosnetd/vty_cli_cmds.c
Expand Up @@ -20,7 +20,7 @@
#include "cfg.h"
#include "etherfilter.h"
#include "logging.h"
#include "libtap.h"
#include "libnozzle.h"
#include "netutils.h"
#include "vty.h"
#include "vty_cli.h"
Expand Down
28 changes: 14 additions & 14 deletions libtap/Makefile.am → libnozzle/Makefile.am
Expand Up @@ -11,50 +11,50 @@ MAINTAINERCLEANFILES = Makefile.in
include $(top_srcdir)/build-aux/check.mk


SYMFILE = libtap_exported_syms
SYMFILE = libnozzle_exported_syms

EXTRA_DIST = $(SYMFILE) tap_updown_bad tap_updown_good api-test-coverage

sources = libtap.c
sources = libnozzle.c

libversion = 1:0:0

AM_CFLAGS = $(PTHREAD_CFLAGS)
LIBS = $(PTHREAD_LIBS)

if BUILD_LIBTAP
if BUILD_LIBNOZZLE

include_HEADERS = libtap.h
include_HEADERS = libnozzle.h

pkgconfigdir = $(libdir)/pkgconfig

pkgconfig_DATA = libtap.pc
pkgconfig_DATA = libnozzle.pc

lib_LTLIBRARIES = libtap.la
lib_LTLIBRARIES = libnozzle.la

libtap_la_SOURCES = $(sources)
libnozzle_la_SOURCES = $(sources)

EXTRA_libtap_la_DEPENDENCIES = $(SYMFILE)
EXTRA_libnozzle_la_DEPENDENCIES = $(SYMFILE)

libtap_la_LDFLAGS = -Wl,-version-script,$(srcdir)/$(SYMFILE) \
libnozzle_la_LDFLAGS = -Wl,-version-script,$(srcdir)/$(SYMFILE) \
--export-dynamic \
-version-number $(libversion)

TESTS = $(check_PROGRAMS)

noinst_PROGRAMS = $(check_PROGRAMS)

check_PROGRAMS = tap_test
check_PROGRAMS = nozzle_test

check-local: check-api-test-coverage

check-api-test-coverage:
chmod u+x $(top_srcdir)/libtap/api-test-coverage
$(top_srcdir)/libtap/api-test-coverage $(top_srcdir) $(top_builddir)
chmod u+x $(top_srcdir)/libnozzle/api-test-coverage
$(top_srcdir)/libnozzle/api-test-coverage $(top_srcdir) $(top_builddir)

tap_test_SOURCES = $(sources)
nozzle_test_SOURCES = $(sources)

tap_test_CPPFLAGS = -DTEST \
nozzle_test_CPPFLAGS = -DTEST \
-DABSBUILDDIR=\"$(abs_builddir)\"

endif
8 changes: 4 additions & 4 deletions libtap/api-test-coverage → libnozzle/api-test-coverage
Expand Up @@ -7,12 +7,12 @@
# This software licensed under GPL-2.0+, LGPL-2.0+
#

srcdir="$1"/libtap
builddir="$2"/libtap
srcdir="$1"/libnozzle
builddir="$2"/libnozzle

headerapicalls="$(grep tap_ "$srcdir"/libtap.h | grep -v "^ \*" | grep -v ^struct | grep -v "^[[:space:]]" | grep -v typedef | sed -e 's/(.*//g' -e 's/^const //g' -e 's/\*//g' | awk '{print $2}')"
headerapicalls="$(grep tap_ "$srcdir"/libnozzle.h | grep -v "^ \*" | grep -v ^struct | grep -v "^[[:space:]]" | grep -v typedef | sed -e 's/(.*//g' -e 's/^const //g' -e 's/\*//g' | awk '{print $2}')"

exportedapicalls="$(nm -B -D "$builddir"/.libs/libtap.so | grep ' T ' | awk '{print $3}')"
exportedapicalls="$(nm -B -D "$builddir"/.libs/libnozzle.so | grep ' T ' | awk '{print $3}')"

echo "Checking for exported symbols NOT available in header file"

Expand Down
2 changes: 1 addition & 1 deletion libtap/libtap.c → libnozzle/libnozzle.c
Expand Up @@ -35,7 +35,7 @@
#include <net/if_dl.h>
#endif

#include "libtap.h"
#include "libnozzle.h"

#define MAX_IP_CHAR 128
#define MAX_PREFIX_CHAR 4
Expand Down
4 changes: 2 additions & 2 deletions libtap/libtap.h → libnozzle/libnozzle.h
Expand Up @@ -6,8 +6,8 @@
* This software licensed under GPL-2.0+, LGPL-2.0+
*/

#ifndef __LIBTAP_H__
#define __LIBTAP_H__
#ifndef __LIBNOZZLE_H__
#define __LIBNOZZLE_H__

#include <sys/types.h>

Expand Down
2 changes: 1 addition & 1 deletion libtap/libtap.pc.in → libnozzle/libnozzle.pc.in
Expand Up @@ -11,7 +11,7 @@ exec_prefix=${prefix}
libdir=@libdir@
includedir=${prefix}/include

Name: libtap
Name: libnozzle
Version: @VERSION@
Description: library to manage a pool of tap devices
Requires:
Expand Down
@@ -1,4 +1,4 @@
# Version and symbol export for libtap.so
# Version and symbol export for libnozzle.so
#
# Copyright (C) 2011-2017 Red Hat, Inc. All rights reserved.
#
Expand All @@ -7,7 +7,7 @@
# This software licensed under GPL-2.0+, LGPL-2.0+
#

LIBTAP {
LIBNOZZLE {
global:
tap_*;
local:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b5823ab

Please sign in to comment.