working commit

This commit is contained in:
2026-04-22 14:26:33 +02:00
parent e9a527b5de
commit fb080285c6
23 changed files with 1198 additions and 1739 deletions
+6
View File
@@ -0,0 +1,6 @@
*~
*_test
Makefile
*.log
*.status
autom4te.cache
+93 -28
View File
@@ -89,6 +89,8 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
sbin_PROGRAMS = helmetd$(EXEEXT) sbin_PROGRAMS = helmetd$(EXEEXT)
noinst_PROGRAMS = udpclient_test$(EXEEXT) service_test$(EXEEXT) \
server_test$(EXEEXT)
subdir = . subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -103,11 +105,24 @@ CONFIG_HEADER = defines.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES = CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)" am__installdirs = "$(DESTDIR)$(sbindir)"
PROGRAMS = $(sbin_PROGRAMS) PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am_helmetd_OBJECTS = server.$(OBJEXT) service.$(OBJEXT) \ am_helmetd_OBJECTS = helmetd.$(OBJEXT) server.$(OBJEXT) \
tunnel.$(OBJEXT) service.$(OBJEXT) interface.$(OBJEXT) hello.pb.$(OBJEXT) \
udpclient.$(OBJEXT) resolver.$(OBJEXT)
helmetd_OBJECTS = $(am_helmetd_OBJECTS) helmetd_OBJECTS = $(am_helmetd_OBJECTS)
helmetd_LDADD = $(LDADD) helmetd_LDADD = $(LDADD)
am_server_test_OBJECTS = server_test.$(OBJEXT) server.$(OBJEXT) \
service.$(OBJEXT) interface.$(OBJEXT)
server_test_OBJECTS = $(am_server_test_OBJECTS)
server_test_LDADD = $(LDADD)
am_service_test_OBJECTS = service_test.$(OBJEXT) server.$(OBJEXT) \
service.$(OBJEXT) interface.$(OBJEXT)
service_test_OBJECTS = $(am_service_test_OBJECTS)
service_test_LDADD = $(LDADD)
am_udpclient_test_OBJECTS = resolver.$(OBJEXT) udpclient.$(OBJEXT) \
udpclient_test.$(OBJEXT)
udpclient_test_OBJECTS = $(am_udpclient_test_OBJECTS)
udpclient_test_LDADD = $(LDADD)
AM_V_P = $(am__v_P_$(V)) AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false am__v_P_0 = false
@@ -148,8 +163,10 @@ AM_V_CCLD = $(am__v_CCLD_$(V))
am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 = am__v_CCLD_1 =
SOURCES = $(helmetd_SOURCES) SOURCES = $(helmetd_SOURCES) $(server_test_SOURCES) \
DIST_SOURCES = $(helmetd_SOURCES) $(service_test_SOURCES) $(udpclient_test_SOURCES)
DIST_SOURCES = $(helmetd_SOURCES) $(server_test_SOURCES) \
$(service_test_SOURCES) $(udpclient_test_SOURCES)
am__can_run_installinfo = \ am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \ case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \ n|no|NO) false;; \
@@ -221,17 +238,17 @@ ECHO_N = -n
ECHO_T = ECHO_T =
ETAGS = etags ETAGS = etags
EXEEXT = EXEEXT =
INSTALL = /bin/install -c INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644 INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL} INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL} INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LDFLAGS = -pthread LDFLAGS = -pthread -static
LIBOBJS = LIBOBJS =
LIBS = LIBS = -Wl,--as-need -lprotobuf-lite
LTLIBOBJS = LTLIBOBJS =
MAKEINFO = ${SHELL} '/home/ziggi/Projects/tcpserv09/missing' makeinfo MAKEINFO = ${SHELL} '/home/ziggi/Projects/tcpserv09/missing' makeinfo
MKDIR_P = /bin/mkdir -p MKDIR_P = /usr/bin/mkdir -p
OBJEXT = o OBJEXT = o
PACKAGE = helmet PACKAGE = helmet
PACKAGE_BUGREPORT = PACKAGE_BUGREPORT =
@@ -241,6 +258,7 @@ PACKAGE_TARNAME = helmet
PACKAGE_URL = PACKAGE_URL =
PACKAGE_VERSION = 0.0.1 PACKAGE_VERSION = 0.0.1
PATH_SEPARATOR = : PATH_SEPARATOR = :
PROTOC = /usr/bin/protoc
RANLIB = ranlib RANLIB = ranlib
SET_MAKE = SET_MAKE =
SHELL = /bin/bash SHELL = /bin/bash
@@ -293,15 +311,34 @@ top_build_prefix =
top_builddir = . top_builddir = .
top_srcdir = . top_srcdir = .
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects
helmetd_SOURCES = server.cpp \ helmetd_SOURCES = helmetd.cpp \
server.cpp server.hpp \
service.cpp service.hpp \ service.cpp service.hpp \
tunnel.cpp tunnel.hpp interface.cpp interface.hpp \
hello.pb.cc hello.pb.h \
udpclient.cpp udpclient.hpp \
resolver.cpp resolver.hpp
server_test_SOURCES = server_test.cpp \
server.cpp server.hpp \
service.cpp service.hpp \
interface.cpp interface.hpp
service_test_SOURCES = service_test.cpp \
server.cpp server.hpp \
service.cpp service.hpp \
interface.cpp interface.hpp
udpclient_test_SOURCES = \
resolver.cpp resolver.hpp \
udpclient.cpp udpclient.hpp \
udpclient_test.cpp
all: defines.h all: defines.h
$(MAKE) $(AM_MAKEFLAGS) all-am $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .cpp .o .obj .SUFFIXES: .cc .cpp .o .obj
am--refresh: Makefile am--refresh: Makefile
@: @:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@@ -350,6 +387,9 @@ $(srcdir)/defines.h.in: $(am__configure_deps)
distclean-hdr: distclean-hdr:
-rm -f defines.h stamp-h1 -rm -f defines.h stamp-h1
clean-noinstPROGRAMS:
-$(am__rm_f) $(noinst_PROGRAMS)
install-sbinPROGRAMS: $(sbin_PROGRAMS) install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
@@ -397,12 +437,30 @@ helmetd$(EXEEXT): $(helmetd_OBJECTS) $(helmetd_DEPENDENCIES) $(EXTRA_helmetd_DEP
@rm -f helmetd$(EXEEXT) @rm -f helmetd$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(helmetd_OBJECTS) $(helmetd_LDADD) $(LIBS) $(AM_V_CXXLD)$(CXXLINK) $(helmetd_OBJECTS) $(helmetd_LDADD) $(LIBS)
server_test$(EXEEXT): $(server_test_OBJECTS) $(server_test_DEPENDENCIES) $(EXTRA_server_test_DEPENDENCIES)
@rm -f server_test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(server_test_OBJECTS) $(server_test_LDADD) $(LIBS)
service_test$(EXEEXT): $(service_test_OBJECTS) $(service_test_DEPENDENCIES) $(EXTRA_service_test_DEPENDENCIES)
@rm -f service_test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(service_test_OBJECTS) $(service_test_LDADD) $(LIBS)
udpclient_test$(EXEEXT): $(udpclient_test_OBJECTS) $(udpclient_test_DEPENDENCIES) $(EXTRA_udpclient_test_DEPENDENCIES)
@rm -f udpclient_test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(udpclient_test_OBJECTS) $(udpclient_test_LDADD) $(LIBS)
mostlyclean-compile: mostlyclean-compile:
-rm -f *.$(OBJEXT) -rm -f *.$(OBJEXT)
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
.cc.o:
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $<
.cc.obj:
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.o: .cpp.o:
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $< $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $<
@@ -678,7 +736,8 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild." @echo "it deletes files that may require special tools to rebuild."
clean: clean-am clean: clean-am
clean-am: clean-generic clean-local clean-sbinPROGRAMS mostlyclean-am clean-am: clean-generic clean-local clean-noinstPROGRAMS \
clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -749,28 +808,34 @@ uninstall-am: uninstall-sbinPROGRAMS
.MAKE: all install-am install-strip .MAKE: all install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \
clean-cscope clean-generic clean-local clean-sbinPROGRAMS \ clean-cscope clean-generic clean-local clean-noinstPROGRAMS \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-zstd distcheck distclean distclean-compile \ dist-xz dist-zip dist-zstd distcheck distclean \
distclean-generic distclean-hdr distclean-tags distcleancheck \ distclean-compile distclean-generic distclean-hdr \
distdir distuninstallcheck dvi dvi-am html html-am info \ distclean-tags distcleancheck distdir distuninstallcheck dvi \
info-am install install-am install-data install-data-am \ dvi-am html html-am info info-am install install-am \
install-dvi install-dvi-am install-exec install-exec-am \ install-data install-data-am install-dvi install-dvi-am \
install-html install-html-am install-info install-info-am \ install-exec install-exec-am install-html install-html-am \
install-man install-pdf install-pdf-am install-ps \ install-info install-info-am install-man install-pdf \
install-ps-am install-sbinPROGRAMS install-strip installcheck \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
installcheck-am installdirs maintainer-clean \ install-strip installcheck installcheck-am installdirs \
maintainer-clean-generic mostlyclean mostlyclean-compile \ maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
uninstall-am uninstall-sbinPROGRAMS tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS
.PRECIOUS: Makefile .PRECIOUS: Makefile
test: udpclient_test
./udpclient_test
run: helmetd run: helmetd
./helmetd ./helmetd
hello.pb.cc hello.pb.h: hello.proto
$(PROTOC) --cpp_out=. hello.proto
clean-local: clean-local:
rm -rf autom4te.cache rm -rf autom4te.cache
rm -f *~ rm -f *~
+35 -3
View File
@@ -2,17 +2,49 @@
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects
CXXFLAGS = -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1 CXXFLAGS = -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1
LDFLAGS = -pthread LDFLAGS = -pthread -static
LIBS = -Wl,--as-need -lprotobuf-lite
sbin_PROGRAMS = helmetd sbin_PROGRAMS = helmetd
helmetd_SOURCES = server.cpp \ helmetd_SOURCES = helmetd.cpp \
server.cpp server.hpp \
service.cpp service.hpp \ service.cpp service.hpp \
tunnel.cpp tunnel.hpp interface.cpp interface.hpp \
hello.pb.cc hello.pb.h \
udpclient.cpp udpclient.hpp \
resolver.cpp resolver.hpp
noinst_PROGRAMS = \
udpclient_test \
service_test \
server_test
server_test_SOURCES = server_test.cpp \
server.cpp server.hpp \
service.cpp service.hpp \
interface.cpp interface.hpp
service_test_SOURCES = service_test.cpp \
server.cpp server.hpp \
service.cpp service.hpp \
interface.cpp interface.hpp
udpclient_test_SOURCES = \
resolver.cpp resolver.hpp \
udpclient.cpp udpclient.hpp \
udpclient_test.cpp
test: udpclient_test
./udpclient_test
run: helmetd run: helmetd
./helmetd ./helmetd
hello.pb.cc hello.pb.h: hello.proto
$(PROTOC) --cpp_out=. hello.proto
clean-local: clean-local:
rm -rf autom4te.cache rm -rf autom4te.cache
rm -f *~ rm -f *~
+91 -26
View File
@@ -89,6 +89,8 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
sbin_PROGRAMS = helmetd$(EXEEXT) sbin_PROGRAMS = helmetd$(EXEEXT)
noinst_PROGRAMS = udpclient_test$(EXEEXT) service_test$(EXEEXT) \
server_test$(EXEEXT)
subdir = . subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -103,11 +105,24 @@ CONFIG_HEADER = defines.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES = CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)" am__installdirs = "$(DESTDIR)$(sbindir)"
PROGRAMS = $(sbin_PROGRAMS) PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am_helmetd_OBJECTS = server.$(OBJEXT) service.$(OBJEXT) \ am_helmetd_OBJECTS = helmetd.$(OBJEXT) server.$(OBJEXT) \
tunnel.$(OBJEXT) service.$(OBJEXT) interface.$(OBJEXT) hello.pb.$(OBJEXT) \
udpclient.$(OBJEXT) resolver.$(OBJEXT)
helmetd_OBJECTS = $(am_helmetd_OBJECTS) helmetd_OBJECTS = $(am_helmetd_OBJECTS)
helmetd_LDADD = $(LDADD) helmetd_LDADD = $(LDADD)
am_server_test_OBJECTS = server_test.$(OBJEXT) server.$(OBJEXT) \
service.$(OBJEXT) interface.$(OBJEXT)
server_test_OBJECTS = $(am_server_test_OBJECTS)
server_test_LDADD = $(LDADD)
am_service_test_OBJECTS = service_test.$(OBJEXT) server.$(OBJEXT) \
service.$(OBJEXT) interface.$(OBJEXT)
service_test_OBJECTS = $(am_service_test_OBJECTS)
service_test_LDADD = $(LDADD)
am_udpclient_test_OBJECTS = resolver.$(OBJEXT) udpclient.$(OBJEXT) \
udpclient_test.$(OBJEXT)
udpclient_test_OBJECTS = $(am_udpclient_test_OBJECTS)
udpclient_test_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@) AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false am__v_P_0 = false
@@ -148,8 +163,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 = am__v_CCLD_1 =
SOURCES = $(helmetd_SOURCES) SOURCES = $(helmetd_SOURCES) $(server_test_SOURCES) \
DIST_SOURCES = $(helmetd_SOURCES) $(service_test_SOURCES) $(udpclient_test_SOURCES)
DIST_SOURCES = $(helmetd_SOURCES) $(server_test_SOURCES) \
$(service_test_SOURCES) $(udpclient_test_SOURCES)
am__can_run_installinfo = \ am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \ case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \ n|no|NO) false;; \
@@ -226,9 +243,9 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = -pthread LDFLAGS = -pthread -static
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = -Wl,--as-need -lprotobuf-lite
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@ MKDIR_P = @MKDIR_P@
@@ -241,6 +258,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
PROTOC = @PROTOC@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
@@ -293,15 +311,34 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects
helmetd_SOURCES = server.cpp \ helmetd_SOURCES = helmetd.cpp \
server.cpp server.hpp \
service.cpp service.hpp \ service.cpp service.hpp \
tunnel.cpp tunnel.hpp interface.cpp interface.hpp \
hello.pb.cc hello.pb.h \
udpclient.cpp udpclient.hpp \
resolver.cpp resolver.hpp
server_test_SOURCES = server_test.cpp \
server.cpp server.hpp \
service.cpp service.hpp \
interface.cpp interface.hpp
service_test_SOURCES = service_test.cpp \
server.cpp server.hpp \
service.cpp service.hpp \
interface.cpp interface.hpp
udpclient_test_SOURCES = \
resolver.cpp resolver.hpp \
udpclient.cpp udpclient.hpp \
udpclient_test.cpp
all: defines.h all: defines.h
$(MAKE) $(AM_MAKEFLAGS) all-am $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .cpp .o .obj .SUFFIXES: .cc .cpp .o .obj
am--refresh: Makefile am--refresh: Makefile
@: @:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@@ -350,6 +387,9 @@ $(srcdir)/defines.h.in: $(am__configure_deps)
distclean-hdr: distclean-hdr:
-rm -f defines.h stamp-h1 -rm -f defines.h stamp-h1
clean-noinstPROGRAMS:
-$(am__rm_f) $(noinst_PROGRAMS)
install-sbinPROGRAMS: $(sbin_PROGRAMS) install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
@@ -397,12 +437,30 @@ helmetd$(EXEEXT): $(helmetd_OBJECTS) $(helmetd_DEPENDENCIES) $(EXTRA_helmetd_DEP
@rm -f helmetd$(EXEEXT) @rm -f helmetd$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(helmetd_OBJECTS) $(helmetd_LDADD) $(LIBS) $(AM_V_CXXLD)$(CXXLINK) $(helmetd_OBJECTS) $(helmetd_LDADD) $(LIBS)
server_test$(EXEEXT): $(server_test_OBJECTS) $(server_test_DEPENDENCIES) $(EXTRA_server_test_DEPENDENCIES)
@rm -f server_test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(server_test_OBJECTS) $(server_test_LDADD) $(LIBS)
service_test$(EXEEXT): $(service_test_OBJECTS) $(service_test_DEPENDENCIES) $(EXTRA_service_test_DEPENDENCIES)
@rm -f service_test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(service_test_OBJECTS) $(service_test_LDADD) $(LIBS)
udpclient_test$(EXEEXT): $(udpclient_test_OBJECTS) $(udpclient_test_DEPENDENCIES) $(EXTRA_udpclient_test_DEPENDENCIES)
@rm -f udpclient_test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(udpclient_test_OBJECTS) $(udpclient_test_LDADD) $(LIBS)
mostlyclean-compile: mostlyclean-compile:
-rm -f *.$(OBJEXT) -rm -f *.$(OBJEXT)
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
.cc.o:
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $<
.cc.obj:
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.o: .cpp.o:
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $< $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $<
@@ -678,7 +736,8 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild." @echo "it deletes files that may require special tools to rebuild."
clean: clean-am clean: clean-am
clean-am: clean-generic clean-local clean-sbinPROGRAMS mostlyclean-am clean-am: clean-generic clean-local clean-noinstPROGRAMS \
clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -749,28 +808,34 @@ uninstall-am: uninstall-sbinPROGRAMS
.MAKE: all install-am install-strip .MAKE: all install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \
clean-cscope clean-generic clean-local clean-sbinPROGRAMS \ clean-cscope clean-generic clean-local clean-noinstPROGRAMS \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-zstd distcheck distclean distclean-compile \ dist-xz dist-zip dist-zstd distcheck distclean \
distclean-generic distclean-hdr distclean-tags distcleancheck \ distclean-compile distclean-generic distclean-hdr \
distdir distuninstallcheck dvi dvi-am html html-am info \ distclean-tags distcleancheck distdir distuninstallcheck dvi \
info-am install install-am install-data install-data-am \ dvi-am html html-am info info-am install install-am \
install-dvi install-dvi-am install-exec install-exec-am \ install-data install-data-am install-dvi install-dvi-am \
install-html install-html-am install-info install-info-am \ install-exec install-exec-am install-html install-html-am \
install-man install-pdf install-pdf-am install-ps \ install-info install-info-am install-man install-pdf \
install-ps-am install-sbinPROGRAMS install-strip installcheck \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
installcheck-am installdirs maintainer-clean \ install-strip installcheck installcheck-am installdirs \
maintainer-clean-generic mostlyclean mostlyclean-compile \ maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
uninstall-am uninstall-sbinPROGRAMS tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS
.PRECIOUS: Makefile .PRECIOUS: Makefile
test: udpclient_test
./udpclient_test
run: helmetd run: helmetd
./helmetd ./helmetd
hello.pb.cc hello.pb.h: hello.proto
$(PROTOC) --cpp_out=. hello.proto
clean-local: clean-local:
rm -rf autom4te.cache rm -rf autom4te.cache
rm -f *~ rm -f *~
-460
View File
@@ -1,460 +0,0 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by helmet configure 0.0.1, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = t14x.unix7.org
uname -m = x86_64
uname -r = 6.12.74+deb13+1-amd64
uname -s = Linux
uname -v = #1 SMP PREEMPT_DYNAMIC Debian 6.12.74-2 (2026-03-08)
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/ziggi/.node/bin/
PATH: /bin/
PATH: /usr/bin/
PATH: /usr/local/bin/
PATH: /sbin/
PATH: /usr/sbin/
PATH: /usr/local/sbin/
PATH: ~/bin/
PATH: ~/go/bin/
PATH: /home/ziggi/.krew/bin/
PATH: ~/go/bin/
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2376: looking for aux files: compile missing install-sh
configure:2389: trying ./
configure:2418: ./compile found
configure:2418: ./missing found
configure:2400: ./install-sh found
configure:2548: checking for a BSD-compatible install
configure:2622: result: /bin/install -c
configure:2633: checking whether sleep supports fractional seconds
configure:2649: result: yes
configure:2652: checking filesystem timestamp resolution
configure:2787: result: 0.01
configure:2792: checking whether build environment is sane
configure:2833: result: yes
configure:3004: checking for a race-free mkdir -p
configure:3047: result: /bin/mkdir -p
configure:3054: checking for gawk
configure:3090: result: no
configure:3054: checking for mawk
configure:3075: found /bin/mawk
configure:3087: result: mawk
configure:3098: checking whether make sets $(MAKE)
configure:3122: result: yes
configure:3148: checking whether make supports nested variables
configure:3167: result: yes
configure:3181: checking xargs -n works
configure:3197: result: yes
configure:3368: checking for gcc
configure:3389: found /bin/gcc
configure:3401: result: gcc
configure:3432: checking for C compiler version
configure:3441: gcc --version >&5
gcc (Debian 14.2.0-19) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:3452: $? = 0
configure:3441: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/14/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 14.2.0-19' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr --with-gcc-major-version-only --program-suffix=-14 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/reproducible-path/gcc-14-14.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/reproducible-path/gcc-14-14.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=3
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (Debian 14.2.0-19)
... rest of stderr output deleted ...
configure:3452: $? = 0
configure:3441: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3452: $? = 1
configure:3441: gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3452: $? = 1
configure:3441: gcc -version >&5
gcc: error: unrecognized command-line option '-version'
gcc: fatal error: no input files
compilation terminated.
configure:3452: $? = 1
configure:3472: checking whether the C compiler works
configure:3494: gcc conftest.c >&5
configure:3498: $? = 0
configure:3549: result: yes
configure:3553: checking for C compiler default output file name
configure:3555: result: a.out
configure:3561: checking for suffix of executables
configure:3568: gcc -o conftest conftest.c >&5
configure:3572: $? = 0
configure:3596: result:
configure:3620: checking whether we are cross compiling
configure:3628: gcc -o conftest conftest.c >&5
configure:3632: $? = 0
configure:3639: ./conftest
configure:3643: $? = 0
configure:3658: result: no
configure:3664: checking for suffix of object files
configure:3687: gcc -c conftest.c >&5
configure:3691: $? = 0
configure:3715: result: o
configure:3719: checking whether the compiler supports GNU C
configure:3739: gcc -c conftest.c >&5
configure:3739: $? = 0
configure:3751: result: yes
configure:3762: checking whether gcc accepts -g
configure:3783: gcc -c -g conftest.c >&5
configure:3783: $? = 0
configure:3830: result: yes
configure:3850: checking for gcc option to enable C11 features
configure:3865: gcc -c -g -O2 conftest.c >&5
configure:3865: $? = 0
configure:3884: result: none needed
configure:4008: checking whether gcc understands -c and -o together
configure:4031: gcc -c conftest.c -o conftest2.o
configure:4034: $? = 0
configure:4031: gcc -c conftest.c -o conftest2.o
configure:4034: $? = 0
configure:4047: result: yes
configure:4067: checking whether make supports the include directive
configure:4082: make -f confmf.GNU && cat confinc.out
this is the am__doit target
configure:4085: $? = 0
configure:4104: result: yes (GNU style)
configure:4130: checking dependency style of gcc
configure:4243: result: none
configure:4307: checking for ranlib
configure:4328: found /bin/ranlib
configure:4340: result: ranlib
configure:4432: checking for g++
configure:4453: found /bin/g++
configure:4465: result: g++
configure:4492: checking for C++ compiler version
configure:4501: g++ --version >&5
g++ (Debian 14.2.0-19) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:4512: $? = 0
configure:4501: g++ -v >&5
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/14/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 14.2.0-19' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr --with-gcc-major-version-only --program-suffix=-14 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/reproducible-path/gcc-14-14.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/reproducible-path/gcc-14-14.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=3
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (Debian 14.2.0-19)
... rest of stderr output deleted ...
configure:4512: $? = 0
configure:4501: g++ -V >&5
g++: error: unrecognized command-line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:4512: $? = 1
configure:4501: g++ -qversion >&5
g++: error: unrecognized command-line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
configure:4512: $? = 1
configure:4516: checking whether the compiler supports GNU C++
configure:4536: g++ -c conftest.cpp >&5
configure:4536: $? = 0
configure:4548: result: yes
configure:4559: checking whether g++ accepts -g
configure:4580: g++ -c -g conftest.cpp >&5
configure:4580: $? = 0
configure:4627: result: yes
configure:4647: checking for g++ option to enable C++11 features
configure:4662: g++ -c -g -O2 conftest.cpp >&5
conftest.cpp: In function 'int main(int, char**)':
conftest.cpp:177:25: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
177 | cxx11test::delegate d2();
| ^~
conftest.cpp:177:25: note: remove parentheses to default-initialize a variable
177 | cxx11test::delegate d2();
| ^~
| --
conftest.cpp:177:25: note: or replace parentheses with braces to value-initialize a variable
configure:4662: $? = 0
configure:4681: result: none needed
configure:4752: checking dependency style of g++
configure:4865: result: none
configure:4984: checking that generated files are newer than configure
configure:4990: result: done
configure:5029: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by helmet config.status 0.0.1, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status
on t14x.unix7.org
config.status:848: creating Makefile
config.status:848: creating defines.h
config.status:1029: defines.h is unchanged
config.status:1077: executing depfiles commands
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_objext=o
ac_cv_path_install='/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=mawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_cc_c11=
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_cxx_cxx11=
ac_cv_prog_cxx_g=yes
ac_cv_prog_cxx_stdcxx=
ac_cv_prog_make_make_set=yes
am_cv_CC_dependencies_compiler_type=none
am_cv_CXX_dependencies_compiler_type=none
am_cv_filesystem_timestamp_resolution=0.01
am_cv_make_support_nested_variables=yes
am_cv_prog_cc_c_o=yes
am_cv_sleep_fractional_seconds=yes
am_cv_xargs_n_works=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='${SHELL} '\''/home/ziggi/Projects/tcpserv09/missing'\'' aclocal-1.17'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AUTOCONF='${SHELL} '\''/home/ziggi/Projects/tcpserv09/missing'\'' autoconf'
AUTOHEADER='${SHELL} '\''/home/ziggi/Projects/tcpserv09/missing'\'' autoheader'
AUTOMAKE='${SHELL} '\''/home/ziggi/Projects/tcpserv09/missing'\'' automake-1.17'
AWK='mawk'
CC='gcc'
CCDEPMODE='depmode=none'
CFLAGS='-g -O2'
CPPFLAGS=''
CSCOPE='cscope'
CTAGS='ctags'
CXX='g++'
CXXDEPMODE='depmode=none'
CXXFLAGS='-g -O2'
CYGPATH_W='echo'
DEFS='-DHAVE_CONFIG_H'
DEPDIR='.deps'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
ETAGS='etags'
EXEEXT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MAKEINFO='${SHELL} '\''/home/ziggi/Projects/tcpserv09/missing'\'' makeinfo'
MKDIR_P='/bin/mkdir -p'
OBJEXT='o'
PACKAGE='helmet'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='helmet'
PACKAGE_STRING='helmet 0.0.1'
PACKAGE_TARNAME='helmet'
PACKAGE_URL=''
PACKAGE_VERSION='0.0.1'
PATH_SEPARATOR=':'
RANLIB='ranlib'
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
VERSION='0.0.1'
ac_ct_CC='gcc'
ac_ct_CXX='g++'
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE='#'
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE='#'
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE='#'
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__rm_f_notfound=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
am__xargs_n='xargs -n'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/ziggi/Projects/tcpserv09/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME "helmet"
#define PACKAGE_TARNAME "helmet"
#define PACKAGE_VERSION "0.0.1"
#define PACKAGE_STRING "helmet 0.0.1"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "helmet"
#define VERSION "0.0.1"
configure: exit 0
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by helmet config.status 0.0.1, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status Makefile
on t14x.unix7.org
config.status:848: creating Makefile
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by helmet config.status 0.0.1, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status Makefile
on t14x.unix7.org
config.status:848: creating Makefile
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by helmet config.status 0.0.1, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status Makefile
on t14x.unix7.org
config.status:848: creating Makefile
-1185
View File
File diff suppressed because it is too large Load Diff
Vendored
+53
View File
@@ -610,6 +610,7 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE am__EXEEXT_TRUE
LTLIBOBJS LTLIBOBJS
LIBOBJS LIBOBJS
PROTOC
am__fastdepCXX_FALSE am__fastdepCXX_FALSE
am__fastdepCXX_TRUE am__fastdepCXX_TRUE
CXXDEPMODE CXXDEPMODE
@@ -4878,6 +4879,58 @@ fi
for ac_prog in protoc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_PROTOC+y}
then :
printf %s "(cached) " >&6
else case e in #(
e) case $PROTOC in
[\\/]* | ?:[\\/]*)
ac_cv_path_PROTOC="$PROTOC" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_PROTOC="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac ;;
esac
fi
PROTOC=$ac_cv_path_PROTOC
if test -n "$PROTOC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PROTOC" >&5
printf "%s\n" "$PROTOC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
test -n "$PROTOC" && break
done
ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
+2
View File
@@ -7,6 +7,8 @@ AC_PROG_CC([gcc cc])
AC_PROG_RANLIB AC_PROG_RANLIB
AC_PROG_CXX([g++ c++]) AC_PROG_CXX([g++ c++])
AC_PATH_PROGS([PROTOC],[protoc])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
]) ])
+280
View File
@@ -0,0 +1,280 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: hello.proto
#include "hello.pb.h"
#include <algorithm>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace control {
PROTOBUF_CONSTEXPR Hello::Hello(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.id_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct HelloDefaultTypeInternal {
PROTOBUF_CONSTEXPR HelloDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~HelloDefaultTypeInternal() {}
union {
Hello _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HelloDefaultTypeInternal _Hello_default_instance_;
} // namespace control
namespace control {
// ===================================================================
class Hello::_Internal {
public:
};
Hello::Hello(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:control.Hello)
}
Hello::Hello(const Hello& from)
: ::PROTOBUF_NAMESPACE_ID::MessageLite() {
Hello* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.name_){}
, decltype(_impl_.id_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
_impl_.name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.name_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_name().empty()) {
_this->_impl_.name_.Set(from._internal_name(),
_this->GetArenaForAllocation());
}
_this->_impl_.id_ = from._impl_.id_;
// @@protoc_insertion_point(copy_constructor:control.Hello)
}
inline void Hello::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.name_){}
, decltype(_impl_.id_){0}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.name_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
Hello::~Hello() {
// @@protoc_insertion_point(destructor:control.Hello)
if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void Hello::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.name_.Destroy();
}
void Hello::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void Hello::Clear() {
// @@protoc_insertion_point(message_clear_start:control.Hello)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.name_.ClearToEmpty();
_impl_.id_ = 0;
_internal_metadata_.Clear<std::string>();
}
const char* Hello::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// int32 id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// string name = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_name();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, nullptr));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<std::string>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Hello::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:control.Hello)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// int32 id = 1;
if (this->_internal_id() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_id(), target);
}
// string name = 2;
if (!this->_internal_name().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"control.Hello.name");
target = stream->WriteStringMaybeAliased(
2, this->_internal_name(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:control.Hello)
return target;
}
size_t Hello::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:control.Hello)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string name = 2;
if (!this->_internal_name().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_name());
}
// int32 id = 1;
if (this->_internal_id() != 0) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
}
int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Hello::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
MergeFrom(*::_pbi::DownCast<const Hello*>(
&from));
}
void Hello::MergeFrom(const Hello& from) {
Hello* const _this = this;
// @@protoc_insertion_point(class_specific_merge_from_start:control.Hello)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_name().empty()) {
_this->_internal_set_name(from._internal_name());
}
if (from._internal_id() != 0) {
_this->_internal_set_id(from._internal_id());
}
_this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void Hello::CopyFrom(const Hello& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:control.Hello)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Hello::IsInitialized() const {
return true;
}
void Hello::InternalSwap(Hello* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.name_, lhs_arena,
&other->_impl_.name_, rhs_arena
);
swap(_impl_.id_, other->_impl_.id_);
}
std::string Hello::GetTypeName() const {
return "control.Hello";
}
// @@protoc_insertion_point(namespace_scope)
} // namespace control
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::control::Hello*
Arena::CreateMaybeMessage< ::control::Hello >(Arena* arena) {
return Arena::CreateMessageInternal< ::control::Hello >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
+292
View File
@@ -0,0 +1,292 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: hello.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_hello_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_hello_2eproto
#include <limits>
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/port_undef.inc>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata_lite.h>
#include <google/protobuf/message_lite.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
#define PROTOBUF_INTERNAL_EXPORT_hello_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct TableStruct_hello_2eproto {
static const uint32_t offsets[];
};
namespace control {
class Hello;
struct HelloDefaultTypeInternal;
extern HelloDefaultTypeInternal _Hello_default_instance_;
} // namespace control
PROTOBUF_NAMESPACE_OPEN
template<> ::control::Hello* Arena::CreateMaybeMessage<::control::Hello>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace control {
// ===================================================================
class Hello final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:control.Hello) */ {
public:
inline Hello() : Hello(nullptr) {}
~Hello() override;
explicit PROTOBUF_CONSTEXPR Hello(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
Hello(const Hello& from);
Hello(Hello&& from) noexcept
: Hello() {
*this = ::std::move(from);
}
inline Hello& operator=(const Hello& from) {
CopyFrom(from);
return *this;
}
inline Hello& operator=(Hello&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const Hello& default_instance() {
return *internal_default_instance();
}
static inline const Hello* internal_default_instance() {
return reinterpret_cast<const Hello*>(
&_Hello_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(Hello& a, Hello& b) {
a.Swap(&b);
}
inline void Swap(Hello* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(Hello* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
Hello* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<Hello>(arena);
}
void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const Hello& from);
void MergeFrom(const Hello& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(Hello* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "control.Hello";
}
protected:
explicit Hello(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
std::string GetTypeName() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kNameFieldNumber = 2,
kIdFieldNumber = 1,
};
// string name = 2;
void clear_name();
const std::string& name() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_name(ArgT0&& arg0, ArgT... args);
std::string* mutable_name();
PROTOBUF_NODISCARD std::string* release_name();
void set_allocated_name(std::string* name);
private:
const std::string& _internal_name() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
std::string* _internal_mutable_name();
public:
// int32 id = 1;
void clear_id();
int32_t id() const;
void set_id(int32_t value);
private:
int32_t _internal_id() const;
void _internal_set_id(int32_t value);
public:
// @@protoc_insertion_point(class_scope:control.Hello)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
int32_t id_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_hello_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// Hello
// int32 id = 1;
inline void Hello::clear_id() {
_impl_.id_ = 0;
}
inline int32_t Hello::_internal_id() const {
return _impl_.id_;
}
inline int32_t Hello::id() const {
// @@protoc_insertion_point(field_get:control.Hello.id)
return _internal_id();
}
inline void Hello::_internal_set_id(int32_t value) {
_impl_.id_ = value;
}
inline void Hello::set_id(int32_t value) {
_internal_set_id(value);
// @@protoc_insertion_point(field_set:control.Hello.id)
}
// string name = 2;
inline void Hello::clear_name() {
_impl_.name_.ClearToEmpty();
}
inline const std::string& Hello::name() const {
// @@protoc_insertion_point(field_get:control.Hello.name)
return _internal_name();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void Hello::set_name(ArgT0&& arg0, ArgT... args) {
_impl_.name_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:control.Hello.name)
}
inline std::string* Hello::mutable_name() {
std::string* _s = _internal_mutable_name();
// @@protoc_insertion_point(field_mutable:control.Hello.name)
return _s;
}
inline const std::string& Hello::_internal_name() const {
return _impl_.name_.Get();
}
inline void Hello::_internal_set_name(const std::string& value) {
_impl_.name_.Set(value, GetArenaForAllocation());
}
inline std::string* Hello::_internal_mutable_name() {
return _impl_.name_.Mutable(GetArenaForAllocation());
}
inline std::string* Hello::release_name() {
// @@protoc_insertion_point(field_release:control.Hello.name)
return _impl_.name_.Release();
}
inline void Hello::set_allocated_name(std::string* name) {
if (name != nullptr) {
} else {
}
_impl_.name_.SetAllocated(name, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.name_.IsDefault()) {
_impl_.name_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:control.Hello.name)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace control
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_hello_2eproto
+12
View File
@@ -0,0 +1,12 @@
syntax = "proto3";
package control;
option optimize_for = LITE_RUNTIME;
option cc_generic_services = false;
message Hello {
int32 id = 1;
string name = 2;
}
+12
View File
@@ -0,0 +1,12 @@
#include <expected>
#include <string>
#include <cstring>
#include <tunnel.hpp>
#include <service.hpp>
int main(int argc, char** argv) {
return 0;
}
+1 -1
View File
@@ -24,7 +24,7 @@ extern "C" {
#include <thread> #include <thread>
#include <chrono> #include <chrono>
#include <tunnel.hpp> #include <interface.hpp>
std::expected<void, std::string> Interface::Create(const std::string name) { std::expected<void, std::string> Interface::Create(const std::string name) {
if ((tunfd = open("/dev/net/tun", O_RDWR | O_CLOEXEC)) < 0) { if ((tunfd = open("/dev/net/tun", O_RDWR | O_CLOEXEC)) < 0) {
+2 -2
View File
@@ -1,6 +1,6 @@
#ifndef TUNNEL_HPP_QWERTY #ifndef INTERFACE_HPP
#define TUNNEL_HPP_QWERTY #define INTERFACE_HPP
class Interface { class Interface {
private: private:
+76
View File
@@ -0,0 +1,76 @@
extern "C" {
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
}
#include <cstring>
#include <expected>
#include <string>
#include <resolver.hpp>
Address::Address(std::string iaddress, int ifamily) {
address = iaddress;
family = ifamily;
}
int Address::GetFamily() {
return family;
}
std::string Address::GetAddress() {
return address;
}
std::expected<Address, std::string> Resolver::Resolve(std::string hostname) {
struct sockaddr_in sa;
if (inet_pton(AF_INET, hostname.c_str(), &(sa.sin_addr)) == 1) {
family = AF_INET;
return Address(hostname, AF_INET);
}
if (inet_pton(AF_INET6, hostname.c_str(), &(sa.sin_addr)) == 1) {
return Address(hostname, AF_INET6);
}
struct addrinfo hints, *res;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
int status = 0;
if ((status = getaddrinfo(hostname.c_str(), NULL, &hints, &res)) != 0) {
std::string error = gai_strerror(status);
return std::unexpected("Resolve adress error: " + error);
}
struct addrinfo* p;
char ipaddr[INET6_ADDRSTRLEN + 1];
for (p = res; p != NULL; p = p->ai_next) {
if (p->ai_family == AF_INET) {
struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr;
void* addr = &(ipv4->sin_addr);
if (inet_ntop(p->ai_family, addr, ipaddr, sizeof(ipaddr)) == NULL) {
int errnocopy = errno;
std::string error = std::strerror(errnocopy);
return std::unexpected("Cannot conver address: " + error);
}
std::string address(ipaddr);
return Address(address, AF_INET);;
}
}
for (p = res; p != NULL; p = p->ai_next) {
if (p->ai_family == AF_INET6) {
struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr;
void* addr = &(ipv6->sin6_addr);
if (inet_ntop(p->ai_family, addr, ipaddr, sizeof(ipaddr)) == NULL) {
int errnocopy = errno;
std::string error = std::strerror(errnocopy);
return std::unexpected("Cannot conver address: " + error);
}
std::string address(ipaddr);
return Address(address, AF_INET6);
}
}
return std::unexpected("Cannot resolve hostname " + hostname);
}
+20
View File
@@ -0,0 +1,20 @@
#include <expected>
#include <string>
class Address {
private:
int family;
std::string address;
public:
Address(const std::string iaddress, const int ifamily);
int GetFamily();
std::string GetAddress();
};
class Resolver {
private:
int family;
public:
std::expected<Address, std::string> Resolve(const std::string hostname);
};
+1 -34
View File
@@ -14,15 +14,8 @@ extern "C" {
#include <tunnel.hpp> #include <tunnel.hpp>
#include <service.hpp> #include <service.hpp>
#include <server.hpp>
using namespace std::chrono_literals;
class Server {
private:
Interface iface;
public:
std::expected<void, std::string> Create(const std::string name, const std::string addr, const int prefix);
};
std::expected<void, std::string> Server::Create(const std::string name, const std::string addr, const int prefix) { std::expected<void, std::string> Server::Create(const std::string name, const std::string addr, const int prefix) {
auto createres = iface.Create(name); auto createres = iface.Create(name);
@@ -44,29 +37,3 @@ std::expected<void, std::string> Server::Create(const std::string name, const st
return {}; return {};
} }
int main(int argc, char** argv) {
#if 0
Service svc(1025);
auto bindres = svc.Bind();
if (!bindres) {
std::cerr << bindres.error() << std::endl;
return 1;
}
Handler handler;
auto listres = svc.Listen(&handler);
if (!listres) {
std::cerr << listres.error() << std::endl;
return 1;
}
#endif
Server srv;
auto createres = srv.Create("tun10", "10.1.2.1", 30);
if (!createres) {
std::cerr << "Error: " << createres.error() << std::endl;
return 1;
}
std::chrono::milliseconds timesleep(20s);
std::this_thread::sleep_for(timesleep);
return 0;
}
+29
View File
@@ -0,0 +1,29 @@
extern "C" {
#include <arpa/inet.h>
}
#include <expected>
#include <string>
#include <vector>
#include <span>
#include <iostream>
#include <thread>
#include <chrono>
#include <cstring>
#include <tunnel.hpp>
#include <service.hpp>
#include <hello.pb.h>
using namespace std::chrono_literals;
class Server {
private:
Interface iface;
public:
std::expected<void, std::string> Create(const std::string name, const std::string addr, const int prefix);
};
+23
View File
@@ -0,0 +1,23 @@
#include <expected>
#include <string>
#include <chrono>
#include <cstring>
#include <tunnel.hpp>
#include <server.hpp>
using namespace std::chrono_literals;
int main(int argc, char** argv) {
Server srv;
auto createres = srv.Create("tun10", "10.1.2.1", 30);
if (!createres) {
std::cerr << "Error: " << createres.error() << std::endl;
return 1;
}
std::chrono::milliseconds timesleep(20s);
std::this_thread::sleep_for(timesleep);
return 0;
}
+27
View File
@@ -0,0 +1,27 @@
extern "C" {
#include <arpa/inet.h>
}
#include <expected>
#include <string>
#include <cstring>
#include <iostream>
#include <tunnel.hpp>
#include <service.hpp>
int main(int argc, char** argv) {
Service svc(1025);
auto bindres = svc.Bind();
if (!bindres) {
std::cerr << bindres.error() << std::endl;
return 1;
}
Handler handler;
auto listres = svc.Listen(&handler);
if (!listres) {
std::cerr << listres.error() << std::endl;
return 1;
}
}
+96
View File
@@ -0,0 +1,96 @@
extern "C" {
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <arpa/inet.h>
}
#include <cstring>
#include <expected>
#include <string>
#include <iostream>
#include <resolver.hpp>
#include <udpclient.hpp>
UDPClient::UDPClient(void){
sockfd = 0;
rmax = 2024;
};
std::expected<void, std::string> UDPClient::Bind(std::string hostname, int nport) {
port = nport;
Resolver resolver;
auto resolveRes = resolver.Resolve(hostname);
if (!resolveRes) {
auto msg = std::format("Cannot resolve hostname {}: {}", hostname, resolveRes.error());
return std::unexpected(msg);
}
auto addr = resolveRes.value();
address = addr.GetAddress();
family = addr.GetFamily();
if ((sockfd = socket(family, SOCK_DGRAM, 0)) < 0) {
int errnocopy = errno;
std::string error = std::strerror(errnocopy);
return std::unexpected("Create socket error: " + error);
}
return {};
}
std::expected<void, std::string> UDPClient::Send(std::string message) {
struct sockaddr_in servaddr;
memset(&servaddr, 0, sizeof(servaddr));
servaddr.sin_family = family;
servaddr.sin_port = htons(port);
servaddr.sin_addr.s_addr = inet_addr(address.c_str());
if (sendto(sockfd, message.data(), message.size(), 0,
(const struct sockaddr*)&servaddr, sizeof(servaddr)) < 0) {
int errnocopy = errno;
std::string error = std::strerror(errnocopy);
return std::unexpected("Send datagram error: " + error);
}
return {};
}
std::expected<std::string, std::string> UDPClient::Recv() {
struct sockaddr_in servaddr;
memset(&servaddr, 0, sizeof(servaddr));
servaddr.sin_family = family;
servaddr.sin_port = htons(port);
servaddr.sin_addr.s_addr = inet_addr(address.c_str());
socklen_t len = sizeof(servaddr);
int rsize = 0;
std::string buffer(rmax, 0);
if((rsize = recvfrom(sockfd, buffer.data(), buffer.size(),
0, (struct sockaddr *)&servaddr, &len)) < 0) {
int errnocopy = errno;
std::string error = std::strerror(errnocopy);
return std::unexpected("Receive datagram error: " + error);
}
std::string reply(buffer.begin(), buffer.begin() + rsize);
return reply;
}
void UDPClient::Close(void) {
if (sockfd > 0) {
close(sockfd);
sockfd = 0;
}
};
UDPClient::~UDPClient(void) {
if (sockfd > 0) {
close(sockfd);
}
};
+21
View File
@@ -0,0 +1,21 @@
#ifndef UPDCLIENT_HPP
#define UPDCLIENT_HPP
class UDPClient {
private:
int sockfd;
std::string address;
int port;
int rmax;
int family;
public:
UDPClient(void);
std::expected<void, std::string> Bind(std::string address, int port);
std::expected<void, std::string> Send(std::string buffer);
std::expected<std::string, std::string> Recv();
void Close(void);
~UDPClient(void);
};
#endif
+26
View File
@@ -0,0 +1,26 @@
#include <expected>
#include <iostream>
#include <format>
#include <udpclient.hpp>
int main(int argc, char** argv) {
UDPClient cli;
std::string message("Hello");
{
auto res = cli.Bind("www.gnu.org", 1025);
if (!res) {
std::cerr << std::format("Error: {}", res.error()) << std::endl;
return 1;
}
}
{
auto res = cli.Send(message);
if (!res) {
std::cerr << std::format("Error: {}", res.error()) << std::endl;
return 1;
}
}
return 0;
}