working commit
This commit is contained in:
@@ -88,11 +88,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
sbin_PROGRAMS = helmetd$(EXEEXT) helmetcli$(EXEEXT)
|
||||
noinst_PROGRAMS = tcpclient_test$(EXEEXT) udpclient_test$(EXEEXT) \
|
||||
service_test$(EXEEXT) tunclient_test$(EXEEXT) \
|
||||
rpcclient_test$(EXEEXT) rpcclient_msg_test$(EXEEXT) \
|
||||
testconnect_test$(EXEEXT)
|
||||
sbin_PROGRAMS = helmetd$(EXEEXT)
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
@@ -103,46 +99,16 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = defines.h
|
||||
CONFIG_HEADER = defines.hpp
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(sbindir)"
|
||||
PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
|
||||
am__objects_1 = abrpchandler.$(OBJEXT) control.pb.$(OBJEXT) \
|
||||
interface.$(OBJEXT) iprouter.$(OBJEXT) logger.$(OBJEXT) \
|
||||
netclient.$(OBJEXT) resolver.$(OBJEXT) rpcclient.$(OBJEXT) \
|
||||
msgheader.$(OBJEXT) service.$(OBJEXT) tcpclient.$(OBJEXT) \
|
||||
testconnect.$(OBJEXT) tunclient.$(OBJEXT) udpclient.$(OBJEXT)
|
||||
am_helmetcli_OBJECTS = helmetcli.$(OBJEXT) $(am__objects_1)
|
||||
helmetcli_OBJECTS = $(am_helmetcli_OBJECTS)
|
||||
helmetcli_LDADD = $(LDADD)
|
||||
PROGRAMS = $(sbin_PROGRAMS)
|
||||
am__objects_1 = uxlogger.$(OBJEXT) tservice.$(OBJEXT) \
|
||||
sockhand.$(OBJEXT) msgheader.$(OBJEXT)
|
||||
am_helmetd_OBJECTS = helmetd.$(OBJEXT) $(am__objects_1)
|
||||
helmetd_OBJECTS = $(am_helmetd_OBJECTS)
|
||||
helmetd_LDADD = $(LDADD)
|
||||
am_rpcclient_msg_test_OBJECTS = rpcclient_msg_test.$(OBJEXT) \
|
||||
$(am__objects_1)
|
||||
rpcclient_msg_test_OBJECTS = $(am_rpcclient_msg_test_OBJECTS)
|
||||
rpcclient_msg_test_LDADD = $(LDADD)
|
||||
am_rpcclient_test_OBJECTS = rpcclient_test.$(OBJEXT) $(am__objects_1)
|
||||
rpcclient_test_OBJECTS = $(am_rpcclient_test_OBJECTS)
|
||||
rpcclient_test_LDADD = $(LDADD)
|
||||
am_service_test_OBJECTS = service_test.$(OBJEXT) $(am__objects_1)
|
||||
service_test_OBJECTS = $(am_service_test_OBJECTS)
|
||||
service_test_LDADD = $(LDADD)
|
||||
am_tcpclient_test_OBJECTS = tcpclient_test.$(OBJEXT) $(am__objects_1)
|
||||
tcpclient_test_OBJECTS = $(am_tcpclient_test_OBJECTS)
|
||||
tcpclient_test_LDADD = $(LDADD)
|
||||
am_testconnect_test_OBJECTS = testconnect_test.$(OBJEXT) \
|
||||
$(am__objects_1)
|
||||
testconnect_test_OBJECTS = $(am_testconnect_test_OBJECTS)
|
||||
testconnect_test_LDADD = $(LDADD)
|
||||
am_tunclient_test_OBJECTS = tunclient_test.$(OBJEXT) \
|
||||
tunclient.$(OBJEXT) interface.$(OBJEXT)
|
||||
tunclient_test_OBJECTS = $(am_tunclient_test_OBJECTS)
|
||||
tunclient_test_LDADD = $(LDADD)
|
||||
am_udpclient_test_OBJECTS = udpclient_test.$(OBJEXT) $(am__objects_1)
|
||||
udpclient_test_OBJECTS = $(am_udpclient_test_OBJECTS)
|
||||
udpclient_test_LDADD = $(LDADD)
|
||||
AM_V_P = $(am__v_P_$(V))
|
||||
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_P_0 = false
|
||||
@@ -183,23 +149,15 @@ AM_V_CCLD = $(am__v_CCLD_$(V))
|
||||
am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(helmetcli_SOURCES) $(helmetd_SOURCES) \
|
||||
$(rpcclient_msg_test_SOURCES) $(rpcclient_test_SOURCES) \
|
||||
$(service_test_SOURCES) $(tcpclient_test_SOURCES) \
|
||||
$(testconnect_test_SOURCES) $(tunclient_test_SOURCES) \
|
||||
$(udpclient_test_SOURCES)
|
||||
DIST_SOURCES = $(helmetcli_SOURCES) $(helmetd_SOURCES) \
|
||||
$(rpcclient_msg_test_SOURCES) $(rpcclient_test_SOURCES) \
|
||||
$(service_test_SOURCES) $(tcpclient_test_SOURCES) \
|
||||
$(testconnect_test_SOURCES) $(tunclient_test_SOURCES) \
|
||||
$(udpclient_test_SOURCES)
|
||||
SOURCES = $(helmetd_SOURCES)
|
||||
DIST_SOURCES = $(helmetd_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
|
||||
defines.h.in
|
||||
defines.hpp.in
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
@@ -217,8 +175,8 @@ am__define_uniq_tagged_files = \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
AM_RECURSIVE_TARGETS = cscope
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/defines.h.in compile \
|
||||
install-sh missing
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/defines.hpp.in \
|
||||
compile install-sh missing
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
@@ -240,13 +198,13 @@ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
distcleancheck_listfiles = \
|
||||
find . \( -type f -a \! \
|
||||
\( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print
|
||||
ACLOCAL = ${SHELL} '/home/ziggi/Projects/stvpn/missing' aclocal-1.17
|
||||
ACLOCAL = ${SHELL} '/home/ziggi/projects/stmsg/missing' aclocal-1.17
|
||||
AMTAR = $${TAR-tar}
|
||||
AM_DEFAULT_VERBOSITY = 1
|
||||
ASTYLE = /bin/astyle
|
||||
AUTOCONF = ${SHELL} '/home/ziggi/Projects/stvpn/missing' autoconf
|
||||
AUTOHEADER = ${SHELL} '/home/ziggi/Projects/stvpn/missing' autoheader
|
||||
AUTOMAKE = ${SHELL} '/home/ziggi/Projects/stvpn/missing' automake-1.17
|
||||
AUTOCONF = ${SHELL} '/home/ziggi/projects/stmsg/missing' autoconf
|
||||
AUTOHEADER = ${SHELL} '/home/ziggi/projects/stmsg/missing' autoheader
|
||||
AUTOMAKE = ${SHELL} '/home/ziggi/projects/stmsg/missing' automake-1.17
|
||||
AWK = mawk
|
||||
CC = gcc
|
||||
CCDEPMODE = depmode=none
|
||||
@@ -274,7 +232,7 @@ LDFLAGS = -pthread
|
||||
LIBOBJS =
|
||||
LIBS = -Wl,--as-need -lprotobuf
|
||||
LTLIBOBJS =
|
||||
MAKEINFO = ${SHELL} '/home/ziggi/Projects/stvpn/missing' makeinfo
|
||||
MAKEINFO = ${SHELL} '/home/ziggi/projects/stmsg/missing' makeinfo
|
||||
MKDIR_P = /bin/mkdir -p
|
||||
OBJEXT = o
|
||||
PACKAGE = helmet
|
||||
@@ -291,10 +249,10 @@ SET_MAKE =
|
||||
SHELL = /bin/bash
|
||||
STRIP =
|
||||
VERSION = 0.0.1
|
||||
abs_builddir = /home/ziggi/Projects/stvpn
|
||||
abs_srcdir = /home/ziggi/Projects/stvpn
|
||||
abs_top_builddir = /home/ziggi/Projects/stvpn
|
||||
abs_top_srcdir = /home/ziggi/Projects/stvpn
|
||||
abs_builddir = /home/ziggi/projects/stmsg
|
||||
abs_srcdir = /home/ziggi/projects/stmsg
|
||||
abs_top_builddir = /home/ziggi/projects/stmsg
|
||||
abs_top_srcdir = /home/ziggi/projects/stmsg
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = g++
|
||||
am__include = include
|
||||
@@ -316,7 +274,7 @@ host_alias =
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /home/ziggi/Projects/stvpn/install-sh
|
||||
install_sh = ${SHELL} /home/ziggi/projects/stmsg/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
@@ -338,40 +296,19 @@ top_build_prefix =
|
||||
top_builddir = .
|
||||
top_srcdir = .
|
||||
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects
|
||||
helmetcli_SOURCES = helmetcli.cpp $(helmet_SOURCES)
|
||||
helmetd_SOURCES = helmetd.cpp $(helmet_SOURCES)
|
||||
helmet_SOURCES = \
|
||||
abrpchandler.cpp abrpchandler.hpp \
|
||||
control.pb.cc control.pb.h \
|
||||
interface.cpp interface.hpp \
|
||||
iprouter.cpp iprouter.hpp \
|
||||
logger.cpp logger.hpp \
|
||||
netclient.cpp netclient.hpp \
|
||||
resolver.cpp resolver.hpp \
|
||||
rpcclient.cpp rpcclient.hpp \
|
||||
msgheader.cpp msgheader.hpp \
|
||||
service.cpp service.hpp \
|
||||
tcpclient.cpp tcpclient.hpp \
|
||||
testconnect.cpp testconnect.hpp \
|
||||
tunclient.cpp tunclient.hpp \
|
||||
udpclient.cpp udpclient.hpp
|
||||
uxlogger.cpp uxlogger.hpp \
|
||||
tservice.cpp tservice.hpp \
|
||||
sockhand.cpp dockhand.hpp \
|
||||
msgheader.cpp msgheader.hpp
|
||||
|
||||
tunclient_test_SOURCES = tunclient_test.cpp \
|
||||
tunclient.cpp tunclient.hpp \
|
||||
interface.cpp interface.hpp
|
||||
|
||||
service_test_SOURCES = service_test.cpp $(helmet_SOURCES)
|
||||
udpclient_test_SOURCES = udpclient_test.cpp $(helmet_SOURCES)
|
||||
tcpclient_test_SOURCES = tcpclient_test.cpp $(helmet_SOURCES)
|
||||
rpcclient_test_SOURCES = rpcclient_test.cpp $(helmet_SOURCES)
|
||||
rpcclient_msg_test_SOURCES = rpcclient_msg_test.cpp $(helmet_SOURCES)
|
||||
testconnect_test_SOURCES = testconnect_test.cpp $(helmet_SOURCES)
|
||||
ASTYLE_OPTS = --indent=spaces=8 --style=java
|
||||
all: defines.h
|
||||
all: defines.hpp
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cc .cpp .o .obj
|
||||
.SUFFIXES: .cpp .o .obj
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@@ -406,23 +343,20 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
defines.h: stamp-h1
|
||||
defines.hpp: stamp-h1
|
||||
@test -f $@ || rm -f stamp-h1
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
||||
|
||||
stamp-h1: $(srcdir)/defines.h.in $(top_builddir)/config.status
|
||||
stamp-h1: $(srcdir)/defines.hpp.in $(top_builddir)/config.status
|
||||
$(AM_V_at)rm -f stamp-h1
|
||||
$(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status defines.h
|
||||
$(srcdir)/defines.h.in: $(am__configure_deps)
|
||||
$(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status defines.hpp
|
||||
$(srcdir)/defines.hpp.in: $(am__configure_deps)
|
||||
$(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
$(AM_V_at)rm -f stamp-h1
|
||||
$(AM_V_at)touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f defines.h stamp-h1
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
-$(am__rm_f) $(noinst_PROGRAMS)
|
||||
-rm -f defines.hpp stamp-h1
|
||||
install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
|
||||
@@ -466,54 +400,16 @@ uninstall-sbinPROGRAMS:
|
||||
clean-sbinPROGRAMS:
|
||||
-$(am__rm_f) $(sbin_PROGRAMS)
|
||||
|
||||
helmetcli$(EXEEXT): $(helmetcli_OBJECTS) $(helmetcli_DEPENDENCIES) $(EXTRA_helmetcli_DEPENDENCIES)
|
||||
@rm -f helmetcli$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(helmetcli_OBJECTS) $(helmetcli_LDADD) $(LIBS)
|
||||
|
||||
helmetd$(EXEEXT): $(helmetd_OBJECTS) $(helmetd_DEPENDENCIES) $(EXTRA_helmetd_DEPENDENCIES)
|
||||
@rm -f helmetd$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(helmetd_OBJECTS) $(helmetd_LDADD) $(LIBS)
|
||||
|
||||
rpcclient_msg_test$(EXEEXT): $(rpcclient_msg_test_OBJECTS) $(rpcclient_msg_test_DEPENDENCIES) $(EXTRA_rpcclient_msg_test_DEPENDENCIES)
|
||||
@rm -f rpcclient_msg_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(rpcclient_msg_test_OBJECTS) $(rpcclient_msg_test_LDADD) $(LIBS)
|
||||
|
||||
rpcclient_test$(EXEEXT): $(rpcclient_test_OBJECTS) $(rpcclient_test_DEPENDENCIES) $(EXTRA_rpcclient_test_DEPENDENCIES)
|
||||
@rm -f rpcclient_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(rpcclient_test_OBJECTS) $(rpcclient_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)
|
||||
|
||||
tcpclient_test$(EXEEXT): $(tcpclient_test_OBJECTS) $(tcpclient_test_DEPENDENCIES) $(EXTRA_tcpclient_test_DEPENDENCIES)
|
||||
@rm -f tcpclient_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(tcpclient_test_OBJECTS) $(tcpclient_test_LDADD) $(LIBS)
|
||||
|
||||
testconnect_test$(EXEEXT): $(testconnect_test_OBJECTS) $(testconnect_test_DEPENDENCIES) $(EXTRA_testconnect_test_DEPENDENCIES)
|
||||
@rm -f testconnect_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(testconnect_test_OBJECTS) $(testconnect_test_LDADD) $(LIBS)
|
||||
|
||||
tunclient_test$(EXEEXT): $(tunclient_test_OBJECTS) $(tunclient_test_DEPENDENCIES) $(EXTRA_tunclient_test_DEPENDENCIES)
|
||||
@rm -f tunclient_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(tunclient_test_OBJECTS) $(tunclient_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:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
.cc.o:
|
||||
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cc.obj:
|
||||
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cpp.o:
|
||||
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
@@ -752,7 +648,7 @@ distcleancheck: distclean
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS) defines.h
|
||||
all-am: Makefile $(PROGRAMS) defines.hpp
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(sbindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
@@ -789,8 +685,7 @@ maintainer-clean-generic:
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-local clean-noinstPROGRAMS \
|
||||
clean-sbinPROGRAMS mostlyclean-am
|
||||
clean-am: clean-generic clean-local clean-sbinPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
@@ -861,40 +756,30 @@ uninstall-am: uninstall-sbinPROGRAMS
|
||||
.MAKE: all install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \
|
||||
clean-cscope clean-generic clean-local clean-noinstPROGRAMS \
|
||||
clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \
|
||||
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
|
||||
dist-xz dist-zip dist-zstd distcheck distclean \
|
||||
distclean-compile distclean-generic distclean-hdr \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS
|
||||
clean-cscope clean-generic clean-local clean-sbinPROGRAMS \
|
||||
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
|
||||
dist-zstd distcheck distclean distclean-compile \
|
||||
distclean-generic distclean-hdr distclean-tags distcleancheck \
|
||||
distdir distuninstallcheck dvi dvi-am html html-am info \
|
||||
info-am install install-am install-data install-data-am \
|
||||
install-dvi install-dvi-am install-exec install-exec-am \
|
||||
install-html install-html-am install-info install-info-am \
|
||||
install-man install-pdf install-pdf-am install-ps \
|
||||
install-ps-am install-sbinPROGRAMS install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am uninstall-sbinPROGRAMS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
#test: testconnect_test
|
||||
# ./testconnect_test
|
||||
#test: rpcclient_test
|
||||
# ./rpcclient_test
|
||||
|
||||
test: service_test rpcclient_test
|
||||
|
||||
proto:
|
||||
$(PROTOC) --cpp_out=. control.proto
|
||||
|
||||
control.pb.cc control.pb.h: control.proto
|
||||
$(PROTOC) --cpp_out=. control.proto
|
||||
format:
|
||||
$(ASTYLE) $(ASTYLE_OPTS) *.hpp *.cpp
|
||||
|
||||
proto:
|
||||
$(PROTOC) --cpp_out=. uxcontrol.proto
|
||||
|
||||
clean-local:
|
||||
rm -rf autom4te.cache
|
||||
rm -f *~
|
||||
|
||||
+9
-50
@@ -5,65 +5,24 @@ CXXFLAGS = -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1 -MMD -MP
|
||||
LDFLAGS = -pthread
|
||||
LIBS = -Wl,--as-need -lprotobuf
|
||||
|
||||
sbin_PROGRAMS = helmetd helmetcli
|
||||
sbin_PROGRAMS = helmetd
|
||||
|
||||
helmetcli_SOURCES = helmetcli.cpp $(helmet_SOURCES)
|
||||
helmetd_SOURCES = helmetd.cpp $(helmet_SOURCES)
|
||||
|
||||
helmet_SOURCES = \
|
||||
abrpchandler.cpp abrpchandler.hpp \
|
||||
control.pb.cc control.pb.h \
|
||||
interface.cpp interface.hpp \
|
||||
iprouter.cpp iprouter.hpp \
|
||||
logger.cpp logger.hpp \
|
||||
netclient.cpp netclient.hpp \
|
||||
resolver.cpp resolver.hpp \
|
||||
rpcclient.cpp rpcclient.hpp \
|
||||
msgheader.cpp msgheader.hpp \
|
||||
service.cpp service.hpp \
|
||||
tcpclient.cpp tcpclient.hpp \
|
||||
testconnect.cpp testconnect.hpp \
|
||||
tunclient.cpp tunclient.hpp \
|
||||
udpclient.cpp udpclient.hpp
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
tcpclient_test \
|
||||
udpclient_test \
|
||||
service_test \
|
||||
tunclient_test \
|
||||
rpcclient_test \
|
||||
rpcclient_msg_test \
|
||||
testconnect_test
|
||||
|
||||
tunclient_test_SOURCES = tunclient_test.cpp \
|
||||
tunclient.cpp tunclient.hpp \
|
||||
interface.cpp interface.hpp
|
||||
|
||||
service_test_SOURCES = service_test.cpp $(helmet_SOURCES)
|
||||
udpclient_test_SOURCES = udpclient_test.cpp $(helmet_SOURCES)
|
||||
tcpclient_test_SOURCES = tcpclient_test.cpp $(helmet_SOURCES)
|
||||
rpcclient_test_SOURCES = rpcclient_test.cpp $(helmet_SOURCES)
|
||||
rpcclient_msg_test_SOURCES = rpcclient_msg_test.cpp $(helmet_SOURCES)
|
||||
|
||||
testconnect_test_SOURCES = testconnect_test.cpp $(helmet_SOURCES)
|
||||
|
||||
#test: testconnect_test
|
||||
# ./testconnect_test
|
||||
#test: rpcclient_test
|
||||
# ./rpcclient_test
|
||||
|
||||
test: service_test rpcclient_test
|
||||
|
||||
proto:
|
||||
$(PROTOC) --cpp_out=. control.proto
|
||||
|
||||
control.pb.cc control.pb.h: control.proto
|
||||
$(PROTOC) --cpp_out=. control.proto
|
||||
uxlogger.cpp uxlogger.hpp \
|
||||
tservice.cpp tservice.hpp \
|
||||
sockhand.cpp dockhand.hpp \
|
||||
msgheader.cpp msgheader.hpp
|
||||
|
||||
ASTYLE_OPTS = --indent=spaces=8 --style=java
|
||||
format:
|
||||
$(ASTYLE) $(ASTYLE_OPTS) *.hpp *.cpp
|
||||
|
||||
proto:
|
||||
$(PROTOC) --cpp_out=. uxcontrol.proto
|
||||
|
||||
|
||||
clean-local:
|
||||
rm -rf autom4te.cache
|
||||
rm -f *~
|
||||
|
||||
+41
-156
@@ -88,11 +88,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
sbin_PROGRAMS = helmetd$(EXEEXT) helmetcli$(EXEEXT)
|
||||
noinst_PROGRAMS = tcpclient_test$(EXEEXT) udpclient_test$(EXEEXT) \
|
||||
service_test$(EXEEXT) tunclient_test$(EXEEXT) \
|
||||
rpcclient_test$(EXEEXT) rpcclient_msg_test$(EXEEXT) \
|
||||
testconnect_test$(EXEEXT)
|
||||
sbin_PROGRAMS = helmetd$(EXEEXT)
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
@@ -103,46 +99,16 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = defines.h
|
||||
CONFIG_HEADER = defines.hpp
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(sbindir)"
|
||||
PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
|
||||
am__objects_1 = abrpchandler.$(OBJEXT) control.pb.$(OBJEXT) \
|
||||
interface.$(OBJEXT) iprouter.$(OBJEXT) logger.$(OBJEXT) \
|
||||
netclient.$(OBJEXT) resolver.$(OBJEXT) rpcclient.$(OBJEXT) \
|
||||
msgheader.$(OBJEXT) service.$(OBJEXT) tcpclient.$(OBJEXT) \
|
||||
testconnect.$(OBJEXT) tunclient.$(OBJEXT) udpclient.$(OBJEXT)
|
||||
am_helmetcli_OBJECTS = helmetcli.$(OBJEXT) $(am__objects_1)
|
||||
helmetcli_OBJECTS = $(am_helmetcli_OBJECTS)
|
||||
helmetcli_LDADD = $(LDADD)
|
||||
PROGRAMS = $(sbin_PROGRAMS)
|
||||
am__objects_1 = uxlogger.$(OBJEXT) tservice.$(OBJEXT) \
|
||||
sockhand.$(OBJEXT) msgheader.$(OBJEXT)
|
||||
am_helmetd_OBJECTS = helmetd.$(OBJEXT) $(am__objects_1)
|
||||
helmetd_OBJECTS = $(am_helmetd_OBJECTS)
|
||||
helmetd_LDADD = $(LDADD)
|
||||
am_rpcclient_msg_test_OBJECTS = rpcclient_msg_test.$(OBJEXT) \
|
||||
$(am__objects_1)
|
||||
rpcclient_msg_test_OBJECTS = $(am_rpcclient_msg_test_OBJECTS)
|
||||
rpcclient_msg_test_LDADD = $(LDADD)
|
||||
am_rpcclient_test_OBJECTS = rpcclient_test.$(OBJEXT) $(am__objects_1)
|
||||
rpcclient_test_OBJECTS = $(am_rpcclient_test_OBJECTS)
|
||||
rpcclient_test_LDADD = $(LDADD)
|
||||
am_service_test_OBJECTS = service_test.$(OBJEXT) $(am__objects_1)
|
||||
service_test_OBJECTS = $(am_service_test_OBJECTS)
|
||||
service_test_LDADD = $(LDADD)
|
||||
am_tcpclient_test_OBJECTS = tcpclient_test.$(OBJEXT) $(am__objects_1)
|
||||
tcpclient_test_OBJECTS = $(am_tcpclient_test_OBJECTS)
|
||||
tcpclient_test_LDADD = $(LDADD)
|
||||
am_testconnect_test_OBJECTS = testconnect_test.$(OBJEXT) \
|
||||
$(am__objects_1)
|
||||
testconnect_test_OBJECTS = $(am_testconnect_test_OBJECTS)
|
||||
testconnect_test_LDADD = $(LDADD)
|
||||
am_tunclient_test_OBJECTS = tunclient_test.$(OBJEXT) \
|
||||
tunclient.$(OBJEXT) interface.$(OBJEXT)
|
||||
tunclient_test_OBJECTS = $(am_tunclient_test_OBJECTS)
|
||||
tunclient_test_LDADD = $(LDADD)
|
||||
am_udpclient_test_OBJECTS = udpclient_test.$(OBJEXT) $(am__objects_1)
|
||||
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_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
@@ -183,23 +149,15 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(helmetcli_SOURCES) $(helmetd_SOURCES) \
|
||||
$(rpcclient_msg_test_SOURCES) $(rpcclient_test_SOURCES) \
|
||||
$(service_test_SOURCES) $(tcpclient_test_SOURCES) \
|
||||
$(testconnect_test_SOURCES) $(tunclient_test_SOURCES) \
|
||||
$(udpclient_test_SOURCES)
|
||||
DIST_SOURCES = $(helmetcli_SOURCES) $(helmetd_SOURCES) \
|
||||
$(rpcclient_msg_test_SOURCES) $(rpcclient_test_SOURCES) \
|
||||
$(service_test_SOURCES) $(tcpclient_test_SOURCES) \
|
||||
$(testconnect_test_SOURCES) $(tunclient_test_SOURCES) \
|
||||
$(udpclient_test_SOURCES)
|
||||
SOURCES = $(helmetd_SOURCES)
|
||||
DIST_SOURCES = $(helmetd_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
|
||||
defines.h.in
|
||||
defines.hpp.in
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
@@ -217,8 +175,8 @@ am__define_uniq_tagged_files = \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
AM_RECURSIVE_TARGETS = cscope
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/defines.h.in compile \
|
||||
install-sh missing
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/defines.hpp.in \
|
||||
compile install-sh missing
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
@@ -338,40 +296,19 @@ top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects
|
||||
helmetcli_SOURCES = helmetcli.cpp $(helmet_SOURCES)
|
||||
helmetd_SOURCES = helmetd.cpp $(helmet_SOURCES)
|
||||
helmet_SOURCES = \
|
||||
abrpchandler.cpp abrpchandler.hpp \
|
||||
control.pb.cc control.pb.h \
|
||||
interface.cpp interface.hpp \
|
||||
iprouter.cpp iprouter.hpp \
|
||||
logger.cpp logger.hpp \
|
||||
netclient.cpp netclient.hpp \
|
||||
resolver.cpp resolver.hpp \
|
||||
rpcclient.cpp rpcclient.hpp \
|
||||
msgheader.cpp msgheader.hpp \
|
||||
service.cpp service.hpp \
|
||||
tcpclient.cpp tcpclient.hpp \
|
||||
testconnect.cpp testconnect.hpp \
|
||||
tunclient.cpp tunclient.hpp \
|
||||
udpclient.cpp udpclient.hpp
|
||||
uxlogger.cpp uxlogger.hpp \
|
||||
tservice.cpp tservice.hpp \
|
||||
sockhand.cpp dockhand.hpp \
|
||||
msgheader.cpp msgheader.hpp
|
||||
|
||||
tunclient_test_SOURCES = tunclient_test.cpp \
|
||||
tunclient.cpp tunclient.hpp \
|
||||
interface.cpp interface.hpp
|
||||
|
||||
service_test_SOURCES = service_test.cpp $(helmet_SOURCES)
|
||||
udpclient_test_SOURCES = udpclient_test.cpp $(helmet_SOURCES)
|
||||
tcpclient_test_SOURCES = tcpclient_test.cpp $(helmet_SOURCES)
|
||||
rpcclient_test_SOURCES = rpcclient_test.cpp $(helmet_SOURCES)
|
||||
rpcclient_msg_test_SOURCES = rpcclient_msg_test.cpp $(helmet_SOURCES)
|
||||
testconnect_test_SOURCES = testconnect_test.cpp $(helmet_SOURCES)
|
||||
ASTYLE_OPTS = --indent=spaces=8 --style=java
|
||||
all: defines.h
|
||||
all: defines.hpp
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cc .cpp .o .obj
|
||||
.SUFFIXES: .cpp .o .obj
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@@ -406,23 +343,20 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
defines.h: stamp-h1
|
||||
defines.hpp: stamp-h1
|
||||
@test -f $@ || rm -f stamp-h1
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
||||
|
||||
stamp-h1: $(srcdir)/defines.h.in $(top_builddir)/config.status
|
||||
stamp-h1: $(srcdir)/defines.hpp.in $(top_builddir)/config.status
|
||||
$(AM_V_at)rm -f stamp-h1
|
||||
$(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status defines.h
|
||||
$(srcdir)/defines.h.in: $(am__configure_deps)
|
||||
$(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status defines.hpp
|
||||
$(srcdir)/defines.hpp.in: $(am__configure_deps)
|
||||
$(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
$(AM_V_at)rm -f stamp-h1
|
||||
$(AM_V_at)touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f defines.h stamp-h1
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
-$(am__rm_f) $(noinst_PROGRAMS)
|
||||
-rm -f defines.hpp stamp-h1
|
||||
install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
|
||||
@@ -466,54 +400,16 @@ uninstall-sbinPROGRAMS:
|
||||
clean-sbinPROGRAMS:
|
||||
-$(am__rm_f) $(sbin_PROGRAMS)
|
||||
|
||||
helmetcli$(EXEEXT): $(helmetcli_OBJECTS) $(helmetcli_DEPENDENCIES) $(EXTRA_helmetcli_DEPENDENCIES)
|
||||
@rm -f helmetcli$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(helmetcli_OBJECTS) $(helmetcli_LDADD) $(LIBS)
|
||||
|
||||
helmetd$(EXEEXT): $(helmetd_OBJECTS) $(helmetd_DEPENDENCIES) $(EXTRA_helmetd_DEPENDENCIES)
|
||||
@rm -f helmetd$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(helmetd_OBJECTS) $(helmetd_LDADD) $(LIBS)
|
||||
|
||||
rpcclient_msg_test$(EXEEXT): $(rpcclient_msg_test_OBJECTS) $(rpcclient_msg_test_DEPENDENCIES) $(EXTRA_rpcclient_msg_test_DEPENDENCIES)
|
||||
@rm -f rpcclient_msg_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(rpcclient_msg_test_OBJECTS) $(rpcclient_msg_test_LDADD) $(LIBS)
|
||||
|
||||
rpcclient_test$(EXEEXT): $(rpcclient_test_OBJECTS) $(rpcclient_test_DEPENDENCIES) $(EXTRA_rpcclient_test_DEPENDENCIES)
|
||||
@rm -f rpcclient_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(rpcclient_test_OBJECTS) $(rpcclient_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)
|
||||
|
||||
tcpclient_test$(EXEEXT): $(tcpclient_test_OBJECTS) $(tcpclient_test_DEPENDENCIES) $(EXTRA_tcpclient_test_DEPENDENCIES)
|
||||
@rm -f tcpclient_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(tcpclient_test_OBJECTS) $(tcpclient_test_LDADD) $(LIBS)
|
||||
|
||||
testconnect_test$(EXEEXT): $(testconnect_test_OBJECTS) $(testconnect_test_DEPENDENCIES) $(EXTRA_testconnect_test_DEPENDENCIES)
|
||||
@rm -f testconnect_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(testconnect_test_OBJECTS) $(testconnect_test_LDADD) $(LIBS)
|
||||
|
||||
tunclient_test$(EXEEXT): $(tunclient_test_OBJECTS) $(tunclient_test_DEPENDENCIES) $(EXTRA_tunclient_test_DEPENDENCIES)
|
||||
@rm -f tunclient_test$(EXEEXT)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(tunclient_test_OBJECTS) $(tunclient_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:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
.cc.o:
|
||||
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cc.obj:
|
||||
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cpp.o:
|
||||
$(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
@@ -752,7 +648,7 @@ distcleancheck: distclean
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS) defines.h
|
||||
all-am: Makefile $(PROGRAMS) defines.hpp
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(sbindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
@@ -789,8 +685,7 @@ maintainer-clean-generic:
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-local clean-noinstPROGRAMS \
|
||||
clean-sbinPROGRAMS mostlyclean-am
|
||||
clean-am: clean-generic clean-local clean-sbinPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
@@ -861,40 +756,30 @@ uninstall-am: uninstall-sbinPROGRAMS
|
||||
.MAKE: all install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \
|
||||
clean-cscope clean-generic clean-local clean-noinstPROGRAMS \
|
||||
clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \
|
||||
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
|
||||
dist-xz dist-zip dist-zstd distcheck distclean \
|
||||
distclean-compile distclean-generic distclean-hdr \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS
|
||||
clean-cscope clean-generic clean-local clean-sbinPROGRAMS \
|
||||
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
|
||||
dist-zstd distcheck distclean distclean-compile \
|
||||
distclean-generic distclean-hdr distclean-tags distcleancheck \
|
||||
distdir distuninstallcheck dvi dvi-am html html-am info \
|
||||
info-am install install-am install-data install-data-am \
|
||||
install-dvi install-dvi-am install-exec install-exec-am \
|
||||
install-html install-html-am install-info install-info-am \
|
||||
install-man install-pdf install-pdf-am install-ps \
|
||||
install-ps-am install-sbinPROGRAMS install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am uninstall-sbinPROGRAMS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
#test: testconnect_test
|
||||
# ./testconnect_test
|
||||
#test: rpcclient_test
|
||||
# ./rpcclient_test
|
||||
|
||||
test: service_test rpcclient_test
|
||||
|
||||
proto:
|
||||
$(PROTOC) --cpp_out=. control.proto
|
||||
|
||||
control.pb.cc control.pb.h: control.proto
|
||||
$(PROTOC) --cpp_out=. control.proto
|
||||
format:
|
||||
$(ASTYLE) $(ASTYLE_OPTS) *.hpp *.cpp
|
||||
|
||||
proto:
|
||||
$(PROTOC) --cpp_out=. uxcontrol.proto
|
||||
|
||||
clean-local:
|
||||
rm -rf autom4te.cache
|
||||
rm -f *~
|
||||
|
||||
@@ -3295,7 +3295,7 @@ fi
|
||||
|
||||
|
||||
|
||||
ac_config_headers="$ac_config_headers defines.h"
|
||||
ac_config_headers="$ac_config_headers defines.hpp"
|
||||
|
||||
|
||||
|
||||
@@ -5725,7 +5725,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
for ac_config_target in $ac_config_targets
|
||||
do
|
||||
case $ac_config_target in
|
||||
"defines.h") CONFIG_HEADERS="$CONFIG_HEADERS defines.h" ;;
|
||||
"defines.hpp") CONFIG_HEADERS="$CONFIG_HEADERS defines.hpp" ;;
|
||||
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
|
||||
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
AC_INIT([helmet],[0.0.1])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_PREFIX_DEFAULT(/usr/local)
|
||||
AC_CONFIG_HEADERS([defines.h])
|
||||
AC_CONFIG_HEADERS([defines.hpp])
|
||||
|
||||
AC_PROG_CC([gcc cc])
|
||||
AC_PROG_RANLIB
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* defines.h. Generated from defines.h.in by configure. */
|
||||
/* defines.h.in. Generated from configure.ac by autoheader. */
|
||||
/* defines.hpp. Generated from defines.hpp.in by configure. */
|
||||
/* defines.hpp.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "helmet"
|
||||
@@ -1,4 +1,4 @@
|
||||
/* defines.h.in. Generated from configure.ac by autoheader. */
|
||||
/* defines.hpp.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
+15
-2
@@ -3,10 +3,23 @@
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
#include <interface.hpp>
|
||||
#include <service.hpp>
|
||||
#include <tservice.hpp>
|
||||
#include <uxlogger.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
TCPService service(1025);
|
||||
auto bindRes = service.Bind();
|
||||
if (!bindRes) {
|
||||
uxlogger.Log("Bind error: " + bindRes.error());
|
||||
return 1;
|
||||
}
|
||||
auto listenRes = service.Listen();
|
||||
if (!listenRes) {
|
||||
uxlogger.Log("Listen error: " + listenRes.error());
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ MessageHeader::MessageHeader(void) {
|
||||
|
||||
std::string MessageHeader::Encode() {
|
||||
std::string buffer, tmp;
|
||||
auto magic = htonl(MAGIC);
|
||||
auto magic = htonl(msgMagic);
|
||||
tmp = std::string(reinterpret_cast<const char*>(&magic), sizeof(magic));
|
||||
buffer.append(tmp);
|
||||
|
||||
@@ -36,7 +36,7 @@ std::expected<void, std::string> MessageHeader::Decode(const std::string rawHead
|
||||
uint32_t tmp;
|
||||
std::memcpy(&tmp, rawHeader.data(), sizeof(uint32_t));
|
||||
auto magic = ntohl(tmp);
|
||||
if (magic != MAGIC) {
|
||||
if (magic != msgMagic) {
|
||||
return std::unexpected("Wrong magic code");
|
||||
}
|
||||
std::memcpy(&tmp, rawHeader.data() + sizeof(uint32_t), sizeof(uint32_t));
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
constexpr uint32_t MAGIC = 0xABBA;
|
||||
constexpr int rpcHeaderSize = 8;
|
||||
constexpr uint32_t msgMagic = 0xABBA;
|
||||
constexpr int msgHeaderSize = 8;
|
||||
|
||||
class MessageHeader {
|
||||
private:
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
#include <semaphore>
|
||||
|
||||
#include <msgheader.hpp>
|
||||
#include <sockhand.hpp>
|
||||
#include <uxlogger.hpp>
|
||||
|
||||
//#include <uxcontrol.pb.h>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
void SocketHandler::RecvMessages(void) {
|
||||
while (true) {
|
||||
uxlogger.Log("Handle socket");
|
||||
int rsize = 0;
|
||||
std::string rawHeader(msgHeaderSize, 0);
|
||||
{
|
||||
|
||||
if ((rsize = read(sock, rawHeader.data(), rawHeader.size())) < 0) {
|
||||
int errnoCopy = errno;
|
||||
std::string error = std::strerror(errnoCopy);
|
||||
uxlogger.Log(std::format("Read header error: {}", error));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rsize < msgHeaderSize) {
|
||||
uxlogger.Log(std::format("Read only {} from {} bytes", rsize, msgHeaderSize));
|
||||
break;
|
||||
}
|
||||
MessageHeader header;
|
||||
auto decodeRes = header.Decode(rawHeader);
|
||||
if (!decodeRes) {
|
||||
uxlogger.Log(std::format("Decode header error: {}", decodeRes.error()));
|
||||
}
|
||||
std::string rawMessage(header.PacketSize(), 0);
|
||||
{
|
||||
if ((rsize = read(sock, rawMessage.data(), rawMessage.size())) < 0) {
|
||||
int errnoCopy = errno;
|
||||
std::string error = std::strerror(errnoCopy);
|
||||
uxlogger.Log(std::format("Read message error: {}", error));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
done.release();
|
||||
uxlogger.Log("RecvMessages done");
|
||||
}
|
||||
|
||||
void SocketHandler::SendMessages(void) {
|
||||
while (true) {
|
||||
MessageHeader header(0);
|
||||
auto rawHeader = header.Encode();
|
||||
int wsize;
|
||||
{
|
||||
if ((wsize = write(sock, rawHeader.data(), rawHeader.size())) < 0) {
|
||||
int errnoCopy = errno;
|
||||
std::string error = std::strerror(errnoCopy);
|
||||
uxlogger.Log(std::format("Write message error: {}", error));
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
}
|
||||
done.release();
|
||||
uxlogger.Log("SendMessages done");
|
||||
}
|
||||
|
||||
void SocketHandler::Handle(int newsock) {
|
||||
sock = newsock;
|
||||
|
||||
std::thread sendThr(&SocketHandler::SendMessages, this);
|
||||
sendThr.detach();
|
||||
|
||||
std::thread recvThr(&SocketHandler::RecvMessages, this);
|
||||
recvThr.detach();
|
||||
|
||||
done.acquire();
|
||||
uxlogger.Log("Handler done");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
#ifndef SOCKHAND_HPP
|
||||
#define SOCKHAND_HPP
|
||||
|
||||
#include <expected>
|
||||
#include <semaphore>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
|
||||
class SocketHandler {
|
||||
private:
|
||||
int sock;
|
||||
std::mutex sockMtx;
|
||||
std::binary_semaphore done{0};
|
||||
public:
|
||||
void Handle(int newsock);
|
||||
void RecvMessages(void);
|
||||
void SendMessages(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
extern "C" {
|
||||
#include <arpa/inet.h>
|
||||
}
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
|
||||
#include <tservice.hpp>
|
||||
#include <uxlogger.hpp>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
TCPService::TCPService(int svcport) {
|
||||
port = svcport;
|
||||
}
|
||||
|
||||
TCPService::~TCPService() {
|
||||
close(port);
|
||||
}
|
||||
|
||||
std::expected<void, std::string> TCPService::Bind(void) {
|
||||
struct sockaddr_in address;
|
||||
int srvsock;
|
||||
if ((srvsock = socket(AF_INET, SOCK_STREAM, 0)) == 0) {
|
||||
int errnocopy = errno;
|
||||
std::string error = std::strerror(errnocopy);
|
||||
return std::unexpected("Create socker error: " + error);
|
||||
}
|
||||
int opt = 1;
|
||||
if (setsockopt(srvsock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt))) {
|
||||
int errnocopy = errno;
|
||||
std::string error = std::strerror(errnocopy);
|
||||
return std::unexpected("Set socket option error: " + error);
|
||||
}
|
||||
address.sin_family = AF_INET;
|
||||
address.sin_addr.s_addr = INADDR_ANY;
|
||||
address.sin_port = htons(port);
|
||||
if (bind(srvsock, (struct sockaddr *)&address, sizeof(address)) < 0) {
|
||||
int errnocopy = errno;
|
||||
std::string error = std::strerror(errnocopy);
|
||||
return std::unexpected("Bind error: " + error);
|
||||
}
|
||||
if (listen(srvsock, 3) < 0) {
|
||||
int errnocopy = errno;
|
||||
std::string error = std::strerror(errnocopy);
|
||||
return std::unexpected("Listen error: " + error);
|
||||
}
|
||||
sock = srvsock;
|
||||
return {};
|
||||
}
|
||||
|
||||
std::expected<void, std::string> TCPService::Listen(void) {
|
||||
struct sockaddr_in address;
|
||||
int addrlen = sizeof(address);
|
||||
int newsock = 0;
|
||||
for (;;) {
|
||||
if ((newsock = accept(sock, (struct sockaddr *)&address, (socklen_t *)&addrlen)) < 0) {
|
||||
int errnocopy = errno;
|
||||
std::string error = std::strerror(errnocopy);
|
||||
return std::unexpected("Accept error: " + error);
|
||||
}
|
||||
std::jthread t(&TCPService::Handle, this, newsock);
|
||||
t.detach();
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
void TCPService::Handle(int sock) {
|
||||
uxlogger.Log("Start socker handler");
|
||||
SocketHandler handler;
|
||||
handler.Handle(sock);
|
||||
uxlogger.Log("Stop socker handler");
|
||||
close(sock);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
#ifndef TSERVICE_HPP
|
||||
#define TSERVICE_HPP
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
|
||||
#include <sockhand.hpp>
|
||||
|
||||
class TCPService {
|
||||
private:
|
||||
int port;
|
||||
int sock;
|
||||
public:
|
||||
explicit TCPService(int port);
|
||||
std::expected<void, std::string> Bind(void);
|
||||
std::expected<void, std::string> Listen(void);
|
||||
void Handle(int sock);
|
||||
~TCPService();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+2541
File diff suppressed because it is too large
Load Diff
+2802
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,54 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package uxcontrol;
|
||||
//option optimize_for = LITE_RUNTIME;
|
||||
//option cc_generic_services = false;
|
||||
|
||||
|
||||
message MsgMeta {
|
||||
string kind = 1;
|
||||
}
|
||||
|
||||
message Message {
|
||||
MsgMeta meta = 1;
|
||||
}
|
||||
|
||||
message InternetPacket {
|
||||
MsgMeta meta = 1;
|
||||
string payload = 2;
|
||||
}
|
||||
|
||||
message HelloMsg {
|
||||
MsgMeta meta = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
|
||||
message ReqMeta {
|
||||
string kind = 1;
|
||||
}
|
||||
|
||||
message ResMeta {
|
||||
bool error = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message Request {
|
||||
ReqMeta meta = 1;
|
||||
}
|
||||
|
||||
message Result {
|
||||
ResMeta meta = 1;
|
||||
}
|
||||
|
||||
message HelloRequest {
|
||||
ReqMeta meta = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message HelloResult {
|
||||
ResMeta meta = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
|
||||
#include <chrono>
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
|
||||
#include <uxlogger.hpp>
|
||||
|
||||
UxLogger uxlogger;
|
||||
|
||||
static std::mutex mtx;
|
||||
|
||||
UxLogger::UxLogger(const std::string ilabel) {
|
||||
label = ilabel;
|
||||
}
|
||||
|
||||
UxLogger::UxLogger(void) {
|
||||
label = "global";
|
||||
}
|
||||
void UxLogger::Log(const std::string& message) {
|
||||
auto now = std::chrono::system_clock::now();
|
||||
std::chrono::zoned_time localnow{std::chrono::current_zone(), now};
|
||||
std::string timenow = std::format("{:%Y-%m-%dT%H:%M:%OS%Z}", localnow);
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
std::cout << std::format("{} {} {}\n", timenow, label, message);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
#ifndef UXLOGGER_HPP
|
||||
#define UXLOGGER_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include <ctime>
|
||||
|
||||
class UxLogger {
|
||||
private:
|
||||
std::string label;
|
||||
public:
|
||||
UxLogger(std::string ilabel);
|
||||
UxLogger();
|
||||
void Log(const std::string& message);
|
||||
};
|
||||
|
||||
extern UxLogger uxlogger;
|
||||
|
||||
#endif
|
||||
@@ -21,10 +21,49 @@ namespace _pb = ::PROTOBUF_NAMESPACE_ID;
|
||||
namespace _pbi = _pb::internal;
|
||||
|
||||
namespace control {
|
||||
PROTOBUF_CONSTEXPR MsgMeta::MsgMeta(
|
||||
::_pbi::ConstantInitialized): _impl_{
|
||||
/*decltype(_impl_.kind_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
|
||||
, /*decltype(_impl_._cached_size_)*/{}} {}
|
||||
struct MsgMetaDefaultTypeInternal {
|
||||
PROTOBUF_CONSTEXPR MsgMetaDefaultTypeInternal()
|
||||
: _instance(::_pbi::ConstantInitialized{}) {}
|
||||
~MsgMetaDefaultTypeInternal() {}
|
||||
union {
|
||||
MsgMeta _instance;
|
||||
};
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MsgMetaDefaultTypeInternal _MsgMeta_default_instance_;
|
||||
PROTOBUF_CONSTEXPR Message::Message(
|
||||
::_pbi::ConstantInitialized): _impl_{
|
||||
/*decltype(_impl_.meta_)*/nullptr
|
||||
, /*decltype(_impl_._cached_size_)*/{}} {}
|
||||
struct MessageDefaultTypeInternal {
|
||||
PROTOBUF_CONSTEXPR MessageDefaultTypeInternal()
|
||||
: _instance(::_pbi::ConstantInitialized{}) {}
|
||||
~MessageDefaultTypeInternal() {}
|
||||
union {
|
||||
Message _instance;
|
||||
};
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageDefaultTypeInternal _Message_default_instance_;
|
||||
PROTOBUF_CONSTEXPR InternetPacket::InternetPacket(
|
||||
::_pbi::ConstantInitialized): _impl_{
|
||||
/*decltype(_impl_.payload_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
|
||||
, /*decltype(_impl_.meta_)*/nullptr
|
||||
, /*decltype(_impl_._cached_size_)*/{}} {}
|
||||
struct InternetPacketDefaultTypeInternal {
|
||||
PROTOBUF_CONSTEXPR InternetPacketDefaultTypeInternal()
|
||||
: _instance(::_pbi::ConstantInitialized{}) {}
|
||||
~InternetPacketDefaultTypeInternal() {}
|
||||
union {
|
||||
InternetPacket _instance;
|
||||
};
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InternetPacketDefaultTypeInternal _InternetPacket_default_instance_;
|
||||
PROTOBUF_CONSTEXPR ReqMeta::ReqMeta(
|
||||
::_pbi::ConstantInitialized): _impl_{
|
||||
/*decltype(_impl_.kind_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
|
||||
, /*decltype(_impl_.rpc_)*/false
|
||||
, /*decltype(_impl_._cached_size_)*/{}} {}
|
||||
struct ReqMetaDefaultTypeInternal {
|
||||
PROTOBUF_CONSTEXPR ReqMetaDefaultTypeInternal()
|
||||
@@ -104,11 +143,33 @@ struct HelloResultDefaultTypeInternal {
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HelloResultDefaultTypeInternal _HelloResult_default_instance_;
|
||||
} // namespace control
|
||||
static ::_pb::Metadata file_level_metadata_control_2eproto[6];
|
||||
static ::_pb::Metadata file_level_metadata_control_2eproto[9];
|
||||
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_control_2eproto = nullptr;
|
||||
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_control_2eproto = nullptr;
|
||||
|
||||
const uint32_t TableStruct_control_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::control::MsgMeta, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
~0u, // no _oneof_case_
|
||||
~0u, // no _weak_field_map_
|
||||
~0u, // no _inlined_string_donated_
|
||||
PROTOBUF_FIELD_OFFSET(::control::MsgMeta, _impl_.kind_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::control::Message, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
~0u, // no _oneof_case_
|
||||
~0u, // no _weak_field_map_
|
||||
~0u, // no _inlined_string_donated_
|
||||
PROTOBUF_FIELD_OFFSET(::control::Message, _impl_.meta_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::control::InternetPacket, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
~0u, // no _oneof_case_
|
||||
~0u, // no _weak_field_map_
|
||||
~0u, // no _inlined_string_donated_
|
||||
PROTOBUF_FIELD_OFFSET(::control::InternetPacket, _impl_.meta_),
|
||||
PROTOBUF_FIELD_OFFSET(::control::InternetPacket, _impl_.payload_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::control::ReqMeta, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
@@ -116,7 +177,6 @@ const uint32_t TableStruct_control_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
|
||||
~0u, // no _weak_field_map_
|
||||
~0u, // no _inlined_string_donated_
|
||||
PROTOBUF_FIELD_OFFSET(::control::ReqMeta, _impl_.kind_),
|
||||
PROTOBUF_FIELD_OFFSET(::control::ReqMeta, _impl_.rpc_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::control::ResMeta, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
@@ -157,15 +217,21 @@ const uint32_t TableStruct_control_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
|
||||
PROTOBUF_FIELD_OFFSET(::control::HelloResult, _impl_.message_),
|
||||
};
|
||||
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
|
||||
{ 0, -1, -1, sizeof(::control::ReqMeta)},
|
||||
{ 8, -1, -1, sizeof(::control::ResMeta)},
|
||||
{ 16, -1, -1, sizeof(::control::Request)},
|
||||
{ 23, -1, -1, sizeof(::control::Result)},
|
||||
{ 30, -1, -1, sizeof(::control::HelloRequest)},
|
||||
{ 38, -1, -1, sizeof(::control::HelloResult)},
|
||||
{ 0, -1, -1, sizeof(::control::MsgMeta)},
|
||||
{ 7, -1, -1, sizeof(::control::Message)},
|
||||
{ 14, -1, -1, sizeof(::control::InternetPacket)},
|
||||
{ 22, -1, -1, sizeof(::control::ReqMeta)},
|
||||
{ 29, -1, -1, sizeof(::control::ResMeta)},
|
||||
{ 37, -1, -1, sizeof(::control::Request)},
|
||||
{ 44, -1, -1, sizeof(::control::Result)},
|
||||
{ 51, -1, -1, sizeof(::control::HelloRequest)},
|
||||
{ 59, -1, -1, sizeof(::control::HelloResult)},
|
||||
};
|
||||
|
||||
static const ::_pb::Message* const file_default_instances[] = {
|
||||
&::control::_MsgMeta_default_instance_._instance,
|
||||
&::control::_Message_default_instance_._instance,
|
||||
&::control::_InternetPacket_default_instance_._instance,
|
||||
&::control::_ReqMeta_default_instance_._instance,
|
||||
&::control::_ResMeta_default_instance_._instance,
|
||||
&::control::_Request_default_instance_._instance,
|
||||
@@ -175,21 +241,24 @@ static const ::_pb::Message* const file_default_instances[] = {
|
||||
};
|
||||
|
||||
const char descriptor_table_protodef_control_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
|
||||
"\n\rcontrol.proto\022\007control\"$\n\007ReqMeta\022\014\n\004k"
|
||||
"ind\030\001 \001(\t\022\013\n\003rpc\030\002 \001(\010\")\n\007ResMeta\022\r\n\005err"
|
||||
"or\030\001 \001(\010\022\017\n\007message\030\002 \001(\t\")\n\007Request\022\036\n\004"
|
||||
"meta\030\001 \001(\0132\020.control.ReqMeta\"(\n\006Result\022\036"
|
||||
"\n\004meta\030\001 \001(\0132\020.control.ResMeta\"\?\n\014HelloR"
|
||||
"equest\022\036\n\004meta\030\001 \001(\0132\020.control.ReqMeta\022\017"
|
||||
"\n\007message\030\002 \001(\t\">\n\013HelloResult\022\036\n\004meta\030\001"
|
||||
" \001(\0132\020.control.ResMeta\022\017\n\007message\030\002 \001(\tb"
|
||||
"\006proto3"
|
||||
"\n\rcontrol.proto\022\007control\"\027\n\007MsgMeta\022\014\n\004k"
|
||||
"ind\030\001 \001(\t\")\n\007Message\022\036\n\004meta\030\001 \001(\0132\020.con"
|
||||
"trol.MsgMeta\"A\n\016InternetPacket\022\036\n\004meta\030\001"
|
||||
" \001(\0132\020.control.MsgMeta\022\017\n\007payload\030\002 \001(\t\""
|
||||
"\027\n\007ReqMeta\022\014\n\004kind\030\001 \001(\t\")\n\007ResMeta\022\r\n\005e"
|
||||
"rror\030\001 \001(\010\022\017\n\007message\030\002 \001(\t\")\n\007Request\022\036"
|
||||
"\n\004meta\030\001 \001(\0132\020.control.ReqMeta\"(\n\006Result"
|
||||
"\022\036\n\004meta\030\001 \001(\0132\020.control.ResMeta\"\?\n\014Hell"
|
||||
"oRequest\022\036\n\004meta\030\001 \001(\0132\020.control.ReqMeta"
|
||||
"\022\017\n\007message\030\002 \001(\t\">\n\013HelloResult\022\036\n\004meta"
|
||||
"\030\001 \001(\0132\020.control.ResMeta\022\017\n\007message\030\002 \001("
|
||||
"\tb\006proto3"
|
||||
;
|
||||
static ::_pbi::once_flag descriptor_table_control_2eproto_once;
|
||||
const ::_pbi::DescriptorTable descriptor_table_control_2eproto = {
|
||||
false, false, 327, descriptor_table_protodef_control_2eproto,
|
||||
false, false, 449, descriptor_table_protodef_control_2eproto,
|
||||
"control.proto",
|
||||
&descriptor_table_control_2eproto_once, nullptr, 0, 6,
|
||||
&descriptor_table_control_2eproto_once, nullptr, 0, 9,
|
||||
schemas, file_default_instances, TableStruct_control_2eproto::offsets,
|
||||
file_level_metadata_control_2eproto, file_level_enum_descriptors_control_2eproto,
|
||||
file_level_service_descriptors_control_2eproto,
|
||||
@@ -204,6 +273,647 @@ namespace control {
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class MsgMeta::_Internal {
|
||||
public:
|
||||
};
|
||||
|
||||
MsgMeta::MsgMeta(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
|
||||
SharedCtor(arena, is_message_owned);
|
||||
// @@protoc_insertion_point(arena_constructor:control.MsgMeta)
|
||||
}
|
||||
MsgMeta::MsgMeta(const MsgMeta& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message() {
|
||||
MsgMeta* const _this = this; (void)_this;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.kind_){}
|
||||
, /*decltype(_impl_._cached_size_)*/{}};
|
||||
|
||||
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
_impl_.kind_.InitDefault();
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
_impl_.kind_.Set("", GetArenaForAllocation());
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
if (!from._internal_kind().empty()) {
|
||||
_this->_impl_.kind_.Set(from._internal_kind(),
|
||||
_this->GetArenaForAllocation());
|
||||
}
|
||||
// @@protoc_insertion_point(copy_constructor:control.MsgMeta)
|
||||
}
|
||||
|
||||
inline void MsgMeta::SharedCtor(
|
||||
::_pb::Arena* arena, bool is_message_owned) {
|
||||
(void)arena;
|
||||
(void)is_message_owned;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.kind_){}
|
||||
, /*decltype(_impl_._cached_size_)*/{}
|
||||
};
|
||||
_impl_.kind_.InitDefault();
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
_impl_.kind_.Set("", GetArenaForAllocation());
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
}
|
||||
|
||||
MsgMeta::~MsgMeta() {
|
||||
// @@protoc_insertion_point(destructor:control.MsgMeta)
|
||||
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
|
||||
(void)arena;
|
||||
return;
|
||||
}
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
inline void MsgMeta::SharedDtor() {
|
||||
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
|
||||
_impl_.kind_.Destroy();
|
||||
}
|
||||
|
||||
void MsgMeta::SetCachedSize(int size) const {
|
||||
_impl_._cached_size_.Set(size);
|
||||
}
|
||||
|
||||
void MsgMeta::Clear() {
|
||||
// @@protoc_insertion_point(message_clear_start:control.MsgMeta)
|
||||
uint32_t cached_has_bits = 0;
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
_impl_.kind_.ClearToEmpty();
|
||||
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
|
||||
}
|
||||
|
||||
const char* MsgMeta::_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) {
|
||||
// string kind = 1;
|
||||
case 1:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
|
||||
auto str = _internal_mutable_kind();
|
||||
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
|
||||
CHK_(ptr);
|
||||
CHK_(::_pbi::VerifyUTF8(str, "control.MsgMeta.kind"));
|
||||
} 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
|
||||
ptr, ctx);
|
||||
CHK_(ptr != nullptr);
|
||||
} // while
|
||||
message_done:
|
||||
return ptr;
|
||||
failure:
|
||||
ptr = nullptr;
|
||||
goto message_done;
|
||||
#undef CHK_
|
||||
}
|
||||
|
||||
uint8_t* MsgMeta::_InternalSerialize(
|
||||
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
|
||||
// @@protoc_insertion_point(serialize_to_array_start:control.MsgMeta)
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// string kind = 1;
|
||||
if (!this->_internal_kind().empty()) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->_internal_kind().data(), static_cast<int>(this->_internal_kind().length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"control.MsgMeta.kind");
|
||||
target = stream->WriteStringMaybeAliased(
|
||||
1, this->_internal_kind(), target);
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
|
||||
}
|
||||
// @@protoc_insertion_point(serialize_to_array_end:control.MsgMeta)
|
||||
return target;
|
||||
}
|
||||
|
||||
size_t MsgMeta::ByteSizeLong() const {
|
||||
// @@protoc_insertion_point(message_byte_size_start:control.MsgMeta)
|
||||
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 kind = 1;
|
||||
if (!this->_internal_kind().empty()) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
|
||||
this->_internal_kind());
|
||||
}
|
||||
|
||||
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
|
||||
}
|
||||
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MsgMeta::_class_data_ = {
|
||||
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
|
||||
MsgMeta::MergeImpl
|
||||
};
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MsgMeta::GetClassData() const { return &_class_data_; }
|
||||
|
||||
|
||||
void MsgMeta::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
|
||||
auto* const _this = static_cast<MsgMeta*>(&to_msg);
|
||||
auto& from = static_cast<const MsgMeta&>(from_msg);
|
||||
// @@protoc_insertion_point(class_specific_merge_from_start:control.MsgMeta)
|
||||
GOOGLE_DCHECK_NE(&from, _this);
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
if (!from._internal_kind().empty()) {
|
||||
_this->_internal_set_kind(from._internal_kind());
|
||||
}
|
||||
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
}
|
||||
|
||||
void MsgMeta::CopyFrom(const MsgMeta& from) {
|
||||
// @@protoc_insertion_point(class_specific_copy_from_start:control.MsgMeta)
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
bool MsgMeta::IsInitialized() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
void MsgMeta::InternalSwap(MsgMeta* 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_.kind_, lhs_arena,
|
||||
&other->_impl_.kind_, rhs_arena
|
||||
);
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata MsgMeta::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[0]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class Message::_Internal {
|
||||
public:
|
||||
static const ::control::MsgMeta& meta(const Message* msg);
|
||||
};
|
||||
|
||||
const ::control::MsgMeta&
|
||||
Message::_Internal::meta(const Message* msg) {
|
||||
return *msg->_impl_.meta_;
|
||||
}
|
||||
Message::Message(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
|
||||
SharedCtor(arena, is_message_owned);
|
||||
// @@protoc_insertion_point(arena_constructor:control.Message)
|
||||
}
|
||||
Message::Message(const Message& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message() {
|
||||
Message* const _this = this; (void)_this;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.meta_){nullptr}
|
||||
, /*decltype(_impl_._cached_size_)*/{}};
|
||||
|
||||
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
if (from._internal_has_meta()) {
|
||||
_this->_impl_.meta_ = new ::control::MsgMeta(*from._impl_.meta_);
|
||||
}
|
||||
// @@protoc_insertion_point(copy_constructor:control.Message)
|
||||
}
|
||||
|
||||
inline void Message::SharedCtor(
|
||||
::_pb::Arena* arena, bool is_message_owned) {
|
||||
(void)arena;
|
||||
(void)is_message_owned;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.meta_){nullptr}
|
||||
, /*decltype(_impl_._cached_size_)*/{}
|
||||
};
|
||||
}
|
||||
|
||||
Message::~Message() {
|
||||
// @@protoc_insertion_point(destructor:control.Message)
|
||||
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
|
||||
(void)arena;
|
||||
return;
|
||||
}
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
inline void Message::SharedDtor() {
|
||||
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
|
||||
if (this != internal_default_instance()) delete _impl_.meta_;
|
||||
}
|
||||
|
||||
void Message::SetCachedSize(int size) const {
|
||||
_impl_._cached_size_.Set(size);
|
||||
}
|
||||
|
||||
void Message::Clear() {
|
||||
// @@protoc_insertion_point(message_clear_start:control.Message)
|
||||
uint32_t cached_has_bits = 0;
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) {
|
||||
delete _impl_.meta_;
|
||||
}
|
||||
_impl_.meta_ = nullptr;
|
||||
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
|
||||
}
|
||||
|
||||
const char* Message::_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) {
|
||||
// .control.MsgMeta meta = 1;
|
||||
case 1:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
|
||||
ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr);
|
||||
CHK_(ptr);
|
||||
} 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
|
||||
ptr, ctx);
|
||||
CHK_(ptr != nullptr);
|
||||
} // while
|
||||
message_done:
|
||||
return ptr;
|
||||
failure:
|
||||
ptr = nullptr;
|
||||
goto message_done;
|
||||
#undef CHK_
|
||||
}
|
||||
|
||||
uint8_t* Message::_InternalSerialize(
|
||||
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
|
||||
// @@protoc_insertion_point(serialize_to_array_start:control.Message)
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .control.MsgMeta meta = 1;
|
||||
if (this->_internal_has_meta()) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessage(1, _Internal::meta(this),
|
||||
_Internal::meta(this).GetCachedSize(), target, stream);
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
|
||||
}
|
||||
// @@protoc_insertion_point(serialize_to_array_end:control.Message)
|
||||
return target;
|
||||
}
|
||||
|
||||
size_t Message::ByteSizeLong() const {
|
||||
// @@protoc_insertion_point(message_byte_size_start:control.Message)
|
||||
size_t total_size = 0;
|
||||
|
||||
uint32_t cached_has_bits = 0;
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .control.MsgMeta meta = 1;
|
||||
if (this->_internal_has_meta()) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
|
||||
*_impl_.meta_);
|
||||
}
|
||||
|
||||
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
|
||||
}
|
||||
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Message::_class_data_ = {
|
||||
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
|
||||
Message::MergeImpl
|
||||
};
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Message::GetClassData() const { return &_class_data_; }
|
||||
|
||||
|
||||
void Message::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
|
||||
auto* const _this = static_cast<Message*>(&to_msg);
|
||||
auto& from = static_cast<const Message&>(from_msg);
|
||||
// @@protoc_insertion_point(class_specific_merge_from_start:control.Message)
|
||||
GOOGLE_DCHECK_NE(&from, _this);
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
if (from._internal_has_meta()) {
|
||||
_this->_internal_mutable_meta()->::control::MsgMeta::MergeFrom(
|
||||
from._internal_meta());
|
||||
}
|
||||
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
}
|
||||
|
||||
void Message::CopyFrom(const Message& from) {
|
||||
// @@protoc_insertion_point(class_specific_copy_from_start:control.Message)
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
bool Message::IsInitialized() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Message::InternalSwap(Message* other) {
|
||||
using std::swap;
|
||||
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
|
||||
swap(_impl_.meta_, other->_impl_.meta_);
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata Message::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[1]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class InternetPacket::_Internal {
|
||||
public:
|
||||
static const ::control::MsgMeta& meta(const InternetPacket* msg);
|
||||
};
|
||||
|
||||
const ::control::MsgMeta&
|
||||
InternetPacket::_Internal::meta(const InternetPacket* msg) {
|
||||
return *msg->_impl_.meta_;
|
||||
}
|
||||
InternetPacket::InternetPacket(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
|
||||
SharedCtor(arena, is_message_owned);
|
||||
// @@protoc_insertion_point(arena_constructor:control.InternetPacket)
|
||||
}
|
||||
InternetPacket::InternetPacket(const InternetPacket& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message() {
|
||||
InternetPacket* const _this = this; (void)_this;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.payload_){}
|
||||
, decltype(_impl_.meta_){nullptr}
|
||||
, /*decltype(_impl_._cached_size_)*/{}};
|
||||
|
||||
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
_impl_.payload_.InitDefault();
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
_impl_.payload_.Set("", GetArenaForAllocation());
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
if (!from._internal_payload().empty()) {
|
||||
_this->_impl_.payload_.Set(from._internal_payload(),
|
||||
_this->GetArenaForAllocation());
|
||||
}
|
||||
if (from._internal_has_meta()) {
|
||||
_this->_impl_.meta_ = new ::control::MsgMeta(*from._impl_.meta_);
|
||||
}
|
||||
// @@protoc_insertion_point(copy_constructor:control.InternetPacket)
|
||||
}
|
||||
|
||||
inline void InternetPacket::SharedCtor(
|
||||
::_pb::Arena* arena, bool is_message_owned) {
|
||||
(void)arena;
|
||||
(void)is_message_owned;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.payload_){}
|
||||
, decltype(_impl_.meta_){nullptr}
|
||||
, /*decltype(_impl_._cached_size_)*/{}
|
||||
};
|
||||
_impl_.payload_.InitDefault();
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
_impl_.payload_.Set("", GetArenaForAllocation());
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
}
|
||||
|
||||
InternetPacket::~InternetPacket() {
|
||||
// @@protoc_insertion_point(destructor:control.InternetPacket)
|
||||
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
|
||||
(void)arena;
|
||||
return;
|
||||
}
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
inline void InternetPacket::SharedDtor() {
|
||||
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
|
||||
_impl_.payload_.Destroy();
|
||||
if (this != internal_default_instance()) delete _impl_.meta_;
|
||||
}
|
||||
|
||||
void InternetPacket::SetCachedSize(int size) const {
|
||||
_impl_._cached_size_.Set(size);
|
||||
}
|
||||
|
||||
void InternetPacket::Clear() {
|
||||
// @@protoc_insertion_point(message_clear_start:control.InternetPacket)
|
||||
uint32_t cached_has_bits = 0;
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
_impl_.payload_.ClearToEmpty();
|
||||
if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) {
|
||||
delete _impl_.meta_;
|
||||
}
|
||||
_impl_.meta_ = nullptr;
|
||||
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
|
||||
}
|
||||
|
||||
const char* InternetPacket::_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) {
|
||||
// .control.MsgMeta meta = 1;
|
||||
case 1:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
|
||||
ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr);
|
||||
CHK_(ptr);
|
||||
} else
|
||||
goto handle_unusual;
|
||||
continue;
|
||||
// string payload = 2;
|
||||
case 2:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
|
||||
auto str = _internal_mutable_payload();
|
||||
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
|
||||
CHK_(ptr);
|
||||
CHK_(::_pbi::VerifyUTF8(str, "control.InternetPacket.payload"));
|
||||
} 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
|
||||
ptr, ctx);
|
||||
CHK_(ptr != nullptr);
|
||||
} // while
|
||||
message_done:
|
||||
return ptr;
|
||||
failure:
|
||||
ptr = nullptr;
|
||||
goto message_done;
|
||||
#undef CHK_
|
||||
}
|
||||
|
||||
uint8_t* InternetPacket::_InternalSerialize(
|
||||
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
|
||||
// @@protoc_insertion_point(serialize_to_array_start:control.InternetPacket)
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .control.MsgMeta meta = 1;
|
||||
if (this->_internal_has_meta()) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessage(1, _Internal::meta(this),
|
||||
_Internal::meta(this).GetCachedSize(), target, stream);
|
||||
}
|
||||
|
||||
// string payload = 2;
|
||||
if (!this->_internal_payload().empty()) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->_internal_payload().data(), static_cast<int>(this->_internal_payload().length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"control.InternetPacket.payload");
|
||||
target = stream->WriteStringMaybeAliased(
|
||||
2, this->_internal_payload(), target);
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
|
||||
}
|
||||
// @@protoc_insertion_point(serialize_to_array_end:control.InternetPacket)
|
||||
return target;
|
||||
}
|
||||
|
||||
size_t InternetPacket::ByteSizeLong() const {
|
||||
// @@protoc_insertion_point(message_byte_size_start:control.InternetPacket)
|
||||
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 payload = 2;
|
||||
if (!this->_internal_payload().empty()) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
|
||||
this->_internal_payload());
|
||||
}
|
||||
|
||||
// .control.MsgMeta meta = 1;
|
||||
if (this->_internal_has_meta()) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
|
||||
*_impl_.meta_);
|
||||
}
|
||||
|
||||
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
|
||||
}
|
||||
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData InternetPacket::_class_data_ = {
|
||||
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
|
||||
InternetPacket::MergeImpl
|
||||
};
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*InternetPacket::GetClassData() const { return &_class_data_; }
|
||||
|
||||
|
||||
void InternetPacket::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
|
||||
auto* const _this = static_cast<InternetPacket*>(&to_msg);
|
||||
auto& from = static_cast<const InternetPacket&>(from_msg);
|
||||
// @@protoc_insertion_point(class_specific_merge_from_start:control.InternetPacket)
|
||||
GOOGLE_DCHECK_NE(&from, _this);
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
if (!from._internal_payload().empty()) {
|
||||
_this->_internal_set_payload(from._internal_payload());
|
||||
}
|
||||
if (from._internal_has_meta()) {
|
||||
_this->_internal_mutable_meta()->::control::MsgMeta::MergeFrom(
|
||||
from._internal_meta());
|
||||
}
|
||||
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
}
|
||||
|
||||
void InternetPacket::CopyFrom(const InternetPacket& from) {
|
||||
// @@protoc_insertion_point(class_specific_copy_from_start:control.InternetPacket)
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
bool InternetPacket::IsInitialized() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
void InternetPacket::InternalSwap(InternetPacket* 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_.payload_, lhs_arena,
|
||||
&other->_impl_.payload_, rhs_arena
|
||||
);
|
||||
swap(_impl_.meta_, other->_impl_.meta_);
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata InternetPacket::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[2]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class ReqMeta::_Internal {
|
||||
public:
|
||||
};
|
||||
@@ -219,7 +929,6 @@ ReqMeta::ReqMeta(const ReqMeta& from)
|
||||
ReqMeta* const _this = this; (void)_this;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.kind_){}
|
||||
, decltype(_impl_.rpc_){}
|
||||
, /*decltype(_impl_._cached_size_)*/{}};
|
||||
|
||||
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
@@ -231,7 +940,6 @@ ReqMeta::ReqMeta(const ReqMeta& from)
|
||||
_this->_impl_.kind_.Set(from._internal_kind(),
|
||||
_this->GetArenaForAllocation());
|
||||
}
|
||||
_this->_impl_.rpc_ = from._impl_.rpc_;
|
||||
// @@protoc_insertion_point(copy_constructor:control.ReqMeta)
|
||||
}
|
||||
|
||||
@@ -241,7 +949,6 @@ inline void ReqMeta::SharedCtor(
|
||||
(void)is_message_owned;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.kind_){}
|
||||
, decltype(_impl_.rpc_){false}
|
||||
, /*decltype(_impl_._cached_size_)*/{}
|
||||
};
|
||||
_impl_.kind_.InitDefault();
|
||||
@@ -275,7 +982,6 @@ void ReqMeta::Clear() {
|
||||
(void) cached_has_bits;
|
||||
|
||||
_impl_.kind_.ClearToEmpty();
|
||||
_impl_.rpc_ = false;
|
||||
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
|
||||
}
|
||||
|
||||
@@ -295,14 +1001,6 @@ const char* ReqMeta::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx)
|
||||
} else
|
||||
goto handle_unusual;
|
||||
continue;
|
||||
// bool rpc = 2;
|
||||
case 2:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
|
||||
_impl_.rpc_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
|
||||
CHK_(ptr);
|
||||
} else
|
||||
goto handle_unusual;
|
||||
continue;
|
||||
default:
|
||||
goto handle_unusual;
|
||||
} // switch
|
||||
@@ -342,12 +1040,6 @@ uint8_t* ReqMeta::_InternalSerialize(
|
||||
1, this->_internal_kind(), target);
|
||||
}
|
||||
|
||||
// bool rpc = 2;
|
||||
if (this->_internal_rpc() != 0) {
|
||||
target = stream->EnsureSpace(target);
|
||||
target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_rpc(), target);
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
|
||||
@@ -371,11 +1063,6 @@ size_t ReqMeta::ByteSizeLong() const {
|
||||
this->_internal_kind());
|
||||
}
|
||||
|
||||
// bool rpc = 2;
|
||||
if (this->_internal_rpc() != 0) {
|
||||
total_size += 1 + 1;
|
||||
}
|
||||
|
||||
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
|
||||
}
|
||||
|
||||
@@ -397,9 +1084,6 @@ void ReqMeta::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOB
|
||||
if (!from._internal_kind().empty()) {
|
||||
_this->_internal_set_kind(from._internal_kind());
|
||||
}
|
||||
if (from._internal_rpc() != 0) {
|
||||
_this->_internal_set_rpc(from._internal_rpc());
|
||||
}
|
||||
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
}
|
||||
|
||||
@@ -423,13 +1107,12 @@ void ReqMeta::InternalSwap(ReqMeta* other) {
|
||||
&_impl_.kind_, lhs_arena,
|
||||
&other->_impl_.kind_, rhs_arena
|
||||
);
|
||||
swap(_impl_.rpc_, other->_impl_.rpc_);
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata ReqMeta::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[0]);
|
||||
file_level_metadata_control_2eproto[3]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -659,7 +1342,7 @@ void ResMeta::InternalSwap(ResMeta* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata ResMeta::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[1]);
|
||||
file_level_metadata_control_2eproto[4]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -852,7 +1535,7 @@ void Request::InternalSwap(Request* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata Request::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[2]);
|
||||
file_level_metadata_control_2eproto[5]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -1045,7 +1728,7 @@ void Result::InternalSwap(Result* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata Result::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[3]);
|
||||
file_level_metadata_control_2eproto[6]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -1290,7 +1973,7 @@ void HelloRequest::InternalSwap(HelloRequest* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata HelloRequest::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[4]);
|
||||
file_level_metadata_control_2eproto[7]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -1535,12 +2218,24 @@ void HelloResult::InternalSwap(HelloResult* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata HelloResult::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_control_2eproto_getter, &descriptor_table_control_2eproto_once,
|
||||
file_level_metadata_control_2eproto[5]);
|
||||
file_level_metadata_control_2eproto[8]);
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
} // namespace control
|
||||
PROTOBUF_NAMESPACE_OPEN
|
||||
template<> PROTOBUF_NOINLINE ::control::MsgMeta*
|
||||
Arena::CreateMaybeMessage< ::control::MsgMeta >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::control::MsgMeta >(arena);
|
||||
}
|
||||
template<> PROTOBUF_NOINLINE ::control::Message*
|
||||
Arena::CreateMaybeMessage< ::control::Message >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::control::Message >(arena);
|
||||
}
|
||||
template<> PROTOBUF_NOINLINE ::control::InternetPacket*
|
||||
Arena::CreateMaybeMessage< ::control::InternetPacket >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::control::InternetPacket >(arena);
|
||||
}
|
||||
template<> PROTOBUF_NOINLINE ::control::ReqMeta*
|
||||
Arena::CreateMaybeMessage< ::control::ReqMeta >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::control::ReqMeta >(arena);
|
||||
@@ -51,6 +51,15 @@ extern HelloRequestDefaultTypeInternal _HelloRequest_default_instance_;
|
||||
class HelloResult;
|
||||
struct HelloResultDefaultTypeInternal;
|
||||
extern HelloResultDefaultTypeInternal _HelloResult_default_instance_;
|
||||
class InternetPacket;
|
||||
struct InternetPacketDefaultTypeInternal;
|
||||
extern InternetPacketDefaultTypeInternal _InternetPacket_default_instance_;
|
||||
class Message;
|
||||
struct MessageDefaultTypeInternal;
|
||||
extern MessageDefaultTypeInternal _Message_default_instance_;
|
||||
class MsgMeta;
|
||||
struct MsgMetaDefaultTypeInternal;
|
||||
extern MsgMetaDefaultTypeInternal _MsgMeta_default_instance_;
|
||||
class ReqMeta;
|
||||
struct ReqMetaDefaultTypeInternal;
|
||||
extern ReqMetaDefaultTypeInternal _ReqMeta_default_instance_;
|
||||
@@ -67,6 +76,9 @@ extern ResultDefaultTypeInternal _Result_default_instance_;
|
||||
PROTOBUF_NAMESPACE_OPEN
|
||||
template<> ::control::HelloRequest* Arena::CreateMaybeMessage<::control::HelloRequest>(Arena*);
|
||||
template<> ::control::HelloResult* Arena::CreateMaybeMessage<::control::HelloResult>(Arena*);
|
||||
template<> ::control::InternetPacket* Arena::CreateMaybeMessage<::control::InternetPacket>(Arena*);
|
||||
template<> ::control::Message* Arena::CreateMaybeMessage<::control::Message>(Arena*);
|
||||
template<> ::control::MsgMeta* Arena::CreateMaybeMessage<::control::MsgMeta>(Arena*);
|
||||
template<> ::control::ReqMeta* Arena::CreateMaybeMessage<::control::ReqMeta>(Arena*);
|
||||
template<> ::control::Request* Arena::CreateMaybeMessage<::control::Request>(Arena*);
|
||||
template<> ::control::ResMeta* Arena::CreateMaybeMessage<::control::ResMeta>(Arena*);
|
||||
@@ -76,6 +88,489 @@ namespace control {
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class MsgMeta final :
|
||||
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:control.MsgMeta) */ {
|
||||
public:
|
||||
inline MsgMeta() : MsgMeta(nullptr) {}
|
||||
~MsgMeta() override;
|
||||
explicit PROTOBUF_CONSTEXPR MsgMeta(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
|
||||
|
||||
MsgMeta(const MsgMeta& from);
|
||||
MsgMeta(MsgMeta&& from) noexcept
|
||||
: MsgMeta() {
|
||||
*this = ::std::move(from);
|
||||
}
|
||||
|
||||
inline MsgMeta& operator=(const MsgMeta& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
inline MsgMeta& operator=(MsgMeta&& 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 ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
|
||||
return GetDescriptor();
|
||||
}
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
|
||||
return default_instance().GetMetadata().descriptor;
|
||||
}
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
|
||||
return default_instance().GetMetadata().reflection;
|
||||
}
|
||||
static const MsgMeta& default_instance() {
|
||||
return *internal_default_instance();
|
||||
}
|
||||
static inline const MsgMeta* internal_default_instance() {
|
||||
return reinterpret_cast<const MsgMeta*>(
|
||||
&_MsgMeta_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
0;
|
||||
|
||||
friend void swap(MsgMeta& a, MsgMeta& b) {
|
||||
a.Swap(&b);
|
||||
}
|
||||
inline void Swap(MsgMeta* 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(MsgMeta* other) {
|
||||
if (other == this) return;
|
||||
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
|
||||
InternalSwap(other);
|
||||
}
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
MsgMeta* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
|
||||
return CreateMaybeMessage<MsgMeta>(arena);
|
||||
}
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
|
||||
void CopyFrom(const MsgMeta& from);
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
|
||||
void MergeFrom( const MsgMeta& from) {
|
||||
MsgMeta::MergeImpl(*this, from);
|
||||
}
|
||||
private:
|
||||
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
|
||||
public:
|
||||
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 final;
|
||||
void InternalSwap(MsgMeta* other);
|
||||
|
||||
private:
|
||||
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
|
||||
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
|
||||
return "control.MsgMeta";
|
||||
}
|
||||
protected:
|
||||
explicit MsgMeta(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned = false);
|
||||
public:
|
||||
|
||||
static const ClassData _class_data_;
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
enum : int {
|
||||
kKindFieldNumber = 1,
|
||||
};
|
||||
// string kind = 1;
|
||||
void clear_kind();
|
||||
const std::string& kind() const;
|
||||
template <typename ArgT0 = const std::string&, typename... ArgT>
|
||||
void set_kind(ArgT0&& arg0, ArgT... args);
|
||||
std::string* mutable_kind();
|
||||
PROTOBUF_NODISCARD std::string* release_kind();
|
||||
void set_allocated_kind(std::string* kind);
|
||||
private:
|
||||
const std::string& _internal_kind() const;
|
||||
inline PROTOBUF_ALWAYS_INLINE void _internal_set_kind(const std::string& value);
|
||||
std::string* _internal_mutable_kind();
|
||||
public:
|
||||
|
||||
// @@protoc_insertion_point(class_scope:control.MsgMeta)
|
||||
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 kind_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
};
|
||||
union { Impl_ _impl_; };
|
||||
friend struct ::TableStruct_control_2eproto;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class Message final :
|
||||
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:control.Message) */ {
|
||||
public:
|
||||
inline Message() : Message(nullptr) {}
|
||||
~Message() override;
|
||||
explicit PROTOBUF_CONSTEXPR Message(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
|
||||
|
||||
Message(const Message& from);
|
||||
Message(Message&& from) noexcept
|
||||
: Message() {
|
||||
*this = ::std::move(from);
|
||||
}
|
||||
|
||||
inline Message& operator=(const Message& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
inline Message& operator=(Message&& 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 ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
|
||||
return GetDescriptor();
|
||||
}
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
|
||||
return default_instance().GetMetadata().descriptor;
|
||||
}
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
|
||||
return default_instance().GetMetadata().reflection;
|
||||
}
|
||||
static const Message& default_instance() {
|
||||
return *internal_default_instance();
|
||||
}
|
||||
static inline const Message* internal_default_instance() {
|
||||
return reinterpret_cast<const Message*>(
|
||||
&_Message_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
1;
|
||||
|
||||
friend void swap(Message& a, Message& b) {
|
||||
a.Swap(&b);
|
||||
}
|
||||
inline void Swap(Message* 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(Message* other) {
|
||||
if (other == this) return;
|
||||
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
|
||||
InternalSwap(other);
|
||||
}
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
Message* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
|
||||
return CreateMaybeMessage<Message>(arena);
|
||||
}
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
|
||||
void CopyFrom(const Message& from);
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
|
||||
void MergeFrom( const Message& from) {
|
||||
Message::MergeImpl(*this, from);
|
||||
}
|
||||
private:
|
||||
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
|
||||
public:
|
||||
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 final;
|
||||
void InternalSwap(Message* other);
|
||||
|
||||
private:
|
||||
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
|
||||
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
|
||||
return "control.Message";
|
||||
}
|
||||
protected:
|
||||
explicit Message(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned = false);
|
||||
public:
|
||||
|
||||
static const ClassData _class_data_;
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
enum : int {
|
||||
kMetaFieldNumber = 1,
|
||||
};
|
||||
// .control.MsgMeta meta = 1;
|
||||
bool has_meta() const;
|
||||
private:
|
||||
bool _internal_has_meta() const;
|
||||
public:
|
||||
void clear_meta();
|
||||
const ::control::MsgMeta& meta() const;
|
||||
PROTOBUF_NODISCARD ::control::MsgMeta* release_meta();
|
||||
::control::MsgMeta* mutable_meta();
|
||||
void set_allocated_meta(::control::MsgMeta* meta);
|
||||
private:
|
||||
const ::control::MsgMeta& _internal_meta() const;
|
||||
::control::MsgMeta* _internal_mutable_meta();
|
||||
public:
|
||||
void unsafe_arena_set_allocated_meta(
|
||||
::control::MsgMeta* meta);
|
||||
::control::MsgMeta* unsafe_arena_release_meta();
|
||||
|
||||
// @@protoc_insertion_point(class_scope:control.Message)
|
||||
private:
|
||||
class _Internal;
|
||||
|
||||
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
|
||||
typedef void InternalArenaConstructable_;
|
||||
typedef void DestructorSkippable_;
|
||||
struct Impl_ {
|
||||
::control::MsgMeta* meta_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
};
|
||||
union { Impl_ _impl_; };
|
||||
friend struct ::TableStruct_control_2eproto;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class InternetPacket final :
|
||||
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:control.InternetPacket) */ {
|
||||
public:
|
||||
inline InternetPacket() : InternetPacket(nullptr) {}
|
||||
~InternetPacket() override;
|
||||
explicit PROTOBUF_CONSTEXPR InternetPacket(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
|
||||
|
||||
InternetPacket(const InternetPacket& from);
|
||||
InternetPacket(InternetPacket&& from) noexcept
|
||||
: InternetPacket() {
|
||||
*this = ::std::move(from);
|
||||
}
|
||||
|
||||
inline InternetPacket& operator=(const InternetPacket& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
inline InternetPacket& operator=(InternetPacket&& 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 ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
|
||||
return GetDescriptor();
|
||||
}
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
|
||||
return default_instance().GetMetadata().descriptor;
|
||||
}
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
|
||||
return default_instance().GetMetadata().reflection;
|
||||
}
|
||||
static const InternetPacket& default_instance() {
|
||||
return *internal_default_instance();
|
||||
}
|
||||
static inline const InternetPacket* internal_default_instance() {
|
||||
return reinterpret_cast<const InternetPacket*>(
|
||||
&_InternetPacket_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
2;
|
||||
|
||||
friend void swap(InternetPacket& a, InternetPacket& b) {
|
||||
a.Swap(&b);
|
||||
}
|
||||
inline void Swap(InternetPacket* 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(InternetPacket* other) {
|
||||
if (other == this) return;
|
||||
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
|
||||
InternalSwap(other);
|
||||
}
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
InternetPacket* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
|
||||
return CreateMaybeMessage<InternetPacket>(arena);
|
||||
}
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
|
||||
void CopyFrom(const InternetPacket& from);
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
|
||||
void MergeFrom( const InternetPacket& from) {
|
||||
InternetPacket::MergeImpl(*this, from);
|
||||
}
|
||||
private:
|
||||
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
|
||||
public:
|
||||
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 final;
|
||||
void InternalSwap(InternetPacket* other);
|
||||
|
||||
private:
|
||||
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
|
||||
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
|
||||
return "control.InternetPacket";
|
||||
}
|
||||
protected:
|
||||
explicit InternetPacket(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned = false);
|
||||
public:
|
||||
|
||||
static const ClassData _class_data_;
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
enum : int {
|
||||
kPayloadFieldNumber = 2,
|
||||
kMetaFieldNumber = 1,
|
||||
};
|
||||
// string payload = 2;
|
||||
void clear_payload();
|
||||
const std::string& payload() const;
|
||||
template <typename ArgT0 = const std::string&, typename... ArgT>
|
||||
void set_payload(ArgT0&& arg0, ArgT... args);
|
||||
std::string* mutable_payload();
|
||||
PROTOBUF_NODISCARD std::string* release_payload();
|
||||
void set_allocated_payload(std::string* payload);
|
||||
private:
|
||||
const std::string& _internal_payload() const;
|
||||
inline PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const std::string& value);
|
||||
std::string* _internal_mutable_payload();
|
||||
public:
|
||||
|
||||
// .control.MsgMeta meta = 1;
|
||||
bool has_meta() const;
|
||||
private:
|
||||
bool _internal_has_meta() const;
|
||||
public:
|
||||
void clear_meta();
|
||||
const ::control::MsgMeta& meta() const;
|
||||
PROTOBUF_NODISCARD ::control::MsgMeta* release_meta();
|
||||
::control::MsgMeta* mutable_meta();
|
||||
void set_allocated_meta(::control::MsgMeta* meta);
|
||||
private:
|
||||
const ::control::MsgMeta& _internal_meta() const;
|
||||
::control::MsgMeta* _internal_mutable_meta();
|
||||
public:
|
||||
void unsafe_arena_set_allocated_meta(
|
||||
::control::MsgMeta* meta);
|
||||
::control::MsgMeta* unsafe_arena_release_meta();
|
||||
|
||||
// @@protoc_insertion_point(class_scope:control.InternetPacket)
|
||||
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 payload_;
|
||||
::control::MsgMeta* meta_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
};
|
||||
union { Impl_ _impl_; };
|
||||
friend struct ::TableStruct_control_2eproto;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class ReqMeta final :
|
||||
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:control.ReqMeta) */ {
|
||||
public:
|
||||
@@ -124,7 +619,7 @@ class ReqMeta final :
|
||||
&_ReqMeta_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
0;
|
||||
3;
|
||||
|
||||
friend void swap(ReqMeta& a, ReqMeta& b) {
|
||||
a.Swap(&b);
|
||||
@@ -198,7 +693,6 @@ class ReqMeta final :
|
||||
|
||||
enum : int {
|
||||
kKindFieldNumber = 1,
|
||||
kRpcFieldNumber = 2,
|
||||
};
|
||||
// string kind = 1;
|
||||
void clear_kind();
|
||||
@@ -214,15 +708,6 @@ class ReqMeta final :
|
||||
std::string* _internal_mutable_kind();
|
||||
public:
|
||||
|
||||
// bool rpc = 2;
|
||||
void clear_rpc();
|
||||
bool rpc() const;
|
||||
void set_rpc(bool value);
|
||||
private:
|
||||
bool _internal_rpc() const;
|
||||
void _internal_set_rpc(bool value);
|
||||
public:
|
||||
|
||||
// @@protoc_insertion_point(class_scope:control.ReqMeta)
|
||||
private:
|
||||
class _Internal;
|
||||
@@ -232,7 +717,6 @@ class ReqMeta final :
|
||||
typedef void DestructorSkippable_;
|
||||
struct Impl_ {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr kind_;
|
||||
bool rpc_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
};
|
||||
union { Impl_ _impl_; };
|
||||
@@ -288,7 +772,7 @@ class ResMeta final :
|
||||
&_ResMeta_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
1;
|
||||
4;
|
||||
|
||||
friend void swap(ResMeta& a, ResMeta& b) {
|
||||
a.Swap(&b);
|
||||
@@ -452,7 +936,7 @@ class Request final :
|
||||
&_Request_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
2;
|
||||
5;
|
||||
|
||||
friend void swap(Request& a, Request& b) {
|
||||
a.Swap(&b);
|
||||
@@ -609,7 +1093,7 @@ class Result final :
|
||||
&_Result_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
3;
|
||||
6;
|
||||
|
||||
friend void swap(Result& a, Result& b) {
|
||||
a.Swap(&b);
|
||||
@@ -766,7 +1250,7 @@ class HelloRequest final :
|
||||
&_HelloRequest_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
4;
|
||||
7;
|
||||
|
||||
friend void swap(HelloRequest& a, HelloRequest& b) {
|
||||
a.Swap(&b);
|
||||
@@ -939,7 +1423,7 @@ class HelloResult final :
|
||||
&_HelloResult_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
5;
|
||||
8;
|
||||
|
||||
friend void swap(HelloResult& a, HelloResult& b) {
|
||||
a.Swap(&b);
|
||||
@@ -1071,6 +1555,298 @@ class HelloResult final :
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif // __GNUC__
|
||||
// MsgMeta
|
||||
|
||||
// string kind = 1;
|
||||
inline void MsgMeta::clear_kind() {
|
||||
_impl_.kind_.ClearToEmpty();
|
||||
}
|
||||
inline const std::string& MsgMeta::kind() const {
|
||||
// @@protoc_insertion_point(field_get:control.MsgMeta.kind)
|
||||
return _internal_kind();
|
||||
}
|
||||
template <typename ArgT0, typename... ArgT>
|
||||
inline PROTOBUF_ALWAYS_INLINE
|
||||
void MsgMeta::set_kind(ArgT0&& arg0, ArgT... args) {
|
||||
|
||||
_impl_.kind_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
|
||||
// @@protoc_insertion_point(field_set:control.MsgMeta.kind)
|
||||
}
|
||||
inline std::string* MsgMeta::mutable_kind() {
|
||||
std::string* _s = _internal_mutable_kind();
|
||||
// @@protoc_insertion_point(field_mutable:control.MsgMeta.kind)
|
||||
return _s;
|
||||
}
|
||||
inline const std::string& MsgMeta::_internal_kind() const {
|
||||
return _impl_.kind_.Get();
|
||||
}
|
||||
inline void MsgMeta::_internal_set_kind(const std::string& value) {
|
||||
|
||||
_impl_.kind_.Set(value, GetArenaForAllocation());
|
||||
}
|
||||
inline std::string* MsgMeta::_internal_mutable_kind() {
|
||||
|
||||
return _impl_.kind_.Mutable(GetArenaForAllocation());
|
||||
}
|
||||
inline std::string* MsgMeta::release_kind() {
|
||||
// @@protoc_insertion_point(field_release:control.MsgMeta.kind)
|
||||
return _impl_.kind_.Release();
|
||||
}
|
||||
inline void MsgMeta::set_allocated_kind(std::string* kind) {
|
||||
if (kind != nullptr) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
_impl_.kind_.SetAllocated(kind, GetArenaForAllocation());
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
if (_impl_.kind_.IsDefault()) {
|
||||
_impl_.kind_.Set("", GetArenaForAllocation());
|
||||
}
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
// @@protoc_insertion_point(field_set_allocated:control.MsgMeta.kind)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// Message
|
||||
|
||||
// .control.MsgMeta meta = 1;
|
||||
inline bool Message::_internal_has_meta() const {
|
||||
return this != internal_default_instance() && _impl_.meta_ != nullptr;
|
||||
}
|
||||
inline bool Message::has_meta() const {
|
||||
return _internal_has_meta();
|
||||
}
|
||||
inline void Message::clear_meta() {
|
||||
if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) {
|
||||
delete _impl_.meta_;
|
||||
}
|
||||
_impl_.meta_ = nullptr;
|
||||
}
|
||||
inline const ::control::MsgMeta& Message::_internal_meta() const {
|
||||
const ::control::MsgMeta* p = _impl_.meta_;
|
||||
return p != nullptr ? *p : reinterpret_cast<const ::control::MsgMeta&>(
|
||||
::control::_MsgMeta_default_instance_);
|
||||
}
|
||||
inline const ::control::MsgMeta& Message::meta() const {
|
||||
// @@protoc_insertion_point(field_get:control.Message.meta)
|
||||
return _internal_meta();
|
||||
}
|
||||
inline void Message::unsafe_arena_set_allocated_meta(
|
||||
::control::MsgMeta* meta) {
|
||||
if (GetArenaForAllocation() == nullptr) {
|
||||
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.meta_);
|
||||
}
|
||||
_impl_.meta_ = meta;
|
||||
if (meta) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:control.Message.meta)
|
||||
}
|
||||
inline ::control::MsgMeta* Message::release_meta() {
|
||||
|
||||
::control::MsgMeta* temp = _impl_.meta_;
|
||||
_impl_.meta_ = nullptr;
|
||||
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
|
||||
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
|
||||
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
|
||||
if (GetArenaForAllocation() == nullptr) { delete old; }
|
||||
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
|
||||
if (GetArenaForAllocation() != nullptr) {
|
||||
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
|
||||
}
|
||||
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
|
||||
return temp;
|
||||
}
|
||||
inline ::control::MsgMeta* Message::unsafe_arena_release_meta() {
|
||||
// @@protoc_insertion_point(field_release:control.Message.meta)
|
||||
|
||||
::control::MsgMeta* temp = _impl_.meta_;
|
||||
_impl_.meta_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::control::MsgMeta* Message::_internal_mutable_meta() {
|
||||
|
||||
if (_impl_.meta_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::control::MsgMeta>(GetArenaForAllocation());
|
||||
_impl_.meta_ = p;
|
||||
}
|
||||
return _impl_.meta_;
|
||||
}
|
||||
inline ::control::MsgMeta* Message::mutable_meta() {
|
||||
::control::MsgMeta* _msg = _internal_mutable_meta();
|
||||
// @@protoc_insertion_point(field_mutable:control.Message.meta)
|
||||
return _msg;
|
||||
}
|
||||
inline void Message::set_allocated_meta(::control::MsgMeta* meta) {
|
||||
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
|
||||
if (message_arena == nullptr) {
|
||||
delete _impl_.meta_;
|
||||
}
|
||||
if (meta) {
|
||||
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
|
||||
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(meta);
|
||||
if (message_arena != submessage_arena) {
|
||||
meta = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
|
||||
message_arena, meta, submessage_arena);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
_impl_.meta_ = meta;
|
||||
// @@protoc_insertion_point(field_set_allocated:control.Message.meta)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// InternetPacket
|
||||
|
||||
// .control.MsgMeta meta = 1;
|
||||
inline bool InternetPacket::_internal_has_meta() const {
|
||||
return this != internal_default_instance() && _impl_.meta_ != nullptr;
|
||||
}
|
||||
inline bool InternetPacket::has_meta() const {
|
||||
return _internal_has_meta();
|
||||
}
|
||||
inline void InternetPacket::clear_meta() {
|
||||
if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) {
|
||||
delete _impl_.meta_;
|
||||
}
|
||||
_impl_.meta_ = nullptr;
|
||||
}
|
||||
inline const ::control::MsgMeta& InternetPacket::_internal_meta() const {
|
||||
const ::control::MsgMeta* p = _impl_.meta_;
|
||||
return p != nullptr ? *p : reinterpret_cast<const ::control::MsgMeta&>(
|
||||
::control::_MsgMeta_default_instance_);
|
||||
}
|
||||
inline const ::control::MsgMeta& InternetPacket::meta() const {
|
||||
// @@protoc_insertion_point(field_get:control.InternetPacket.meta)
|
||||
return _internal_meta();
|
||||
}
|
||||
inline void InternetPacket::unsafe_arena_set_allocated_meta(
|
||||
::control::MsgMeta* meta) {
|
||||
if (GetArenaForAllocation() == nullptr) {
|
||||
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.meta_);
|
||||
}
|
||||
_impl_.meta_ = meta;
|
||||
if (meta) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:control.InternetPacket.meta)
|
||||
}
|
||||
inline ::control::MsgMeta* InternetPacket::release_meta() {
|
||||
|
||||
::control::MsgMeta* temp = _impl_.meta_;
|
||||
_impl_.meta_ = nullptr;
|
||||
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
|
||||
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
|
||||
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
|
||||
if (GetArenaForAllocation() == nullptr) { delete old; }
|
||||
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
|
||||
if (GetArenaForAllocation() != nullptr) {
|
||||
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
|
||||
}
|
||||
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
|
||||
return temp;
|
||||
}
|
||||
inline ::control::MsgMeta* InternetPacket::unsafe_arena_release_meta() {
|
||||
// @@protoc_insertion_point(field_release:control.InternetPacket.meta)
|
||||
|
||||
::control::MsgMeta* temp = _impl_.meta_;
|
||||
_impl_.meta_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::control::MsgMeta* InternetPacket::_internal_mutable_meta() {
|
||||
|
||||
if (_impl_.meta_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::control::MsgMeta>(GetArenaForAllocation());
|
||||
_impl_.meta_ = p;
|
||||
}
|
||||
return _impl_.meta_;
|
||||
}
|
||||
inline ::control::MsgMeta* InternetPacket::mutable_meta() {
|
||||
::control::MsgMeta* _msg = _internal_mutable_meta();
|
||||
// @@protoc_insertion_point(field_mutable:control.InternetPacket.meta)
|
||||
return _msg;
|
||||
}
|
||||
inline void InternetPacket::set_allocated_meta(::control::MsgMeta* meta) {
|
||||
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
|
||||
if (message_arena == nullptr) {
|
||||
delete _impl_.meta_;
|
||||
}
|
||||
if (meta) {
|
||||
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
|
||||
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(meta);
|
||||
if (message_arena != submessage_arena) {
|
||||
meta = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
|
||||
message_arena, meta, submessage_arena);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
_impl_.meta_ = meta;
|
||||
// @@protoc_insertion_point(field_set_allocated:control.InternetPacket.meta)
|
||||
}
|
||||
|
||||
// string payload = 2;
|
||||
inline void InternetPacket::clear_payload() {
|
||||
_impl_.payload_.ClearToEmpty();
|
||||
}
|
||||
inline const std::string& InternetPacket::payload() const {
|
||||
// @@protoc_insertion_point(field_get:control.InternetPacket.payload)
|
||||
return _internal_payload();
|
||||
}
|
||||
template <typename ArgT0, typename... ArgT>
|
||||
inline PROTOBUF_ALWAYS_INLINE
|
||||
void InternetPacket::set_payload(ArgT0&& arg0, ArgT... args) {
|
||||
|
||||
_impl_.payload_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
|
||||
// @@protoc_insertion_point(field_set:control.InternetPacket.payload)
|
||||
}
|
||||
inline std::string* InternetPacket::mutable_payload() {
|
||||
std::string* _s = _internal_mutable_payload();
|
||||
// @@protoc_insertion_point(field_mutable:control.InternetPacket.payload)
|
||||
return _s;
|
||||
}
|
||||
inline const std::string& InternetPacket::_internal_payload() const {
|
||||
return _impl_.payload_.Get();
|
||||
}
|
||||
inline void InternetPacket::_internal_set_payload(const std::string& value) {
|
||||
|
||||
_impl_.payload_.Set(value, GetArenaForAllocation());
|
||||
}
|
||||
inline std::string* InternetPacket::_internal_mutable_payload() {
|
||||
|
||||
return _impl_.payload_.Mutable(GetArenaForAllocation());
|
||||
}
|
||||
inline std::string* InternetPacket::release_payload() {
|
||||
// @@protoc_insertion_point(field_release:control.InternetPacket.payload)
|
||||
return _impl_.payload_.Release();
|
||||
}
|
||||
inline void InternetPacket::set_allocated_payload(std::string* payload) {
|
||||
if (payload != nullptr) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
_impl_.payload_.SetAllocated(payload, GetArenaForAllocation());
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
if (_impl_.payload_.IsDefault()) {
|
||||
_impl_.payload_.Set("", GetArenaForAllocation());
|
||||
}
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
// @@protoc_insertion_point(field_set_allocated:control.InternetPacket.payload)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// ReqMeta
|
||||
|
||||
// string kind = 1;
|
||||
@@ -1123,26 +1899,6 @@ inline void ReqMeta::set_allocated_kind(std::string* kind) {
|
||||
// @@protoc_insertion_point(field_set_allocated:control.ReqMeta.kind)
|
||||
}
|
||||
|
||||
// bool rpc = 2;
|
||||
inline void ReqMeta::clear_rpc() {
|
||||
_impl_.rpc_ = false;
|
||||
}
|
||||
inline bool ReqMeta::_internal_rpc() const {
|
||||
return _impl_.rpc_;
|
||||
}
|
||||
inline bool ReqMeta::rpc() const {
|
||||
// @@protoc_insertion_point(field_get:control.ReqMeta.rpc)
|
||||
return _internal_rpc();
|
||||
}
|
||||
inline void ReqMeta::_internal_set_rpc(bool value) {
|
||||
|
||||
_impl_.rpc_ = value;
|
||||
}
|
||||
inline void ReqMeta::set_rpc(bool value) {
|
||||
_internal_set_rpc(value);
|
||||
// @@protoc_insertion_point(field_set:control.ReqMeta.rpc)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// ResMeta
|
||||
@@ -1706,6 +2462,12 @@ inline void HelloResult::set_allocated_message(std::string* message) {
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
@@ -4,9 +4,23 @@ package control;
|
||||
//option optimize_for = LITE_RUNTIME;
|
||||
//option cc_generic_services = false;
|
||||
|
||||
|
||||
message MsgMeta {
|
||||
string kind = 1;
|
||||
}
|
||||
|
||||
message Message {
|
||||
MsgMeta meta = 1;
|
||||
}
|
||||
|
||||
message InternetPacket {
|
||||
MsgMeta meta = 1;
|
||||
string payload = 2;
|
||||
}
|
||||
|
||||
|
||||
message ReqMeta {
|
||||
string kind = 1;
|
||||
bool rpc = 2;
|
||||
}
|
||||
|
||||
message ResMeta {
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
#include <interface.hpp>
|
||||
#include <service.hpp>
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
extern "C" {
|
||||
#include <arpa/inet.h>
|
||||
}
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <format>
|
||||
#include <cstdint>
|
||||
|
||||
#include <msgheader.hpp>
|
||||
|
||||
MessageHeader::MessageHeader(const uint32_t ipSize) {
|
||||
pSize = ipSize;
|
||||
}
|
||||
|
||||
MessageHeader::MessageHeader(void) {
|
||||
pSize = 0;
|
||||
}
|
||||
|
||||
std::string MessageHeader::Encode() {
|
||||
std::string buffer, tmp;
|
||||
auto magic = htonl(MAGIC);
|
||||
tmp = std::string(reinterpret_cast<const char*>(&magic), sizeof(magic));
|
||||
buffer.append(tmp);
|
||||
|
||||
auto size = htonl(pSize);
|
||||
tmp = std::string(reinterpret_cast<const char*>(&size), sizeof(size));
|
||||
buffer.append(tmp);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
std::expected<void, std::string> MessageHeader::Decode(const std::string rawHeader) {
|
||||
uint32_t tmp;
|
||||
std::memcpy(&tmp, rawHeader.data(), sizeof(uint32_t));
|
||||
auto magic = ntohl(tmp);
|
||||
if (magic != MAGIC) {
|
||||
return std::unexpected("Wrong magic code");
|
||||
}
|
||||
std::memcpy(&tmp, rawHeader.data() + sizeof(uint32_t), sizeof(uint32_t));
|
||||
pSize = ntohl(tmp);
|
||||
return {};
|
||||
}
|
||||
|
||||
uint32_t MessageHeader::PacketSize() {
|
||||
return pSize;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
constexpr uint32_t MAGIC = 0xABBA;
|
||||
constexpr int rpcHeaderSize = 8;
|
||||
|
||||
class MessageHeader {
|
||||
private:
|
||||
uint32_t pSize = 0;
|
||||
public:
|
||||
MessageHeader(const uint32_t pSize);
|
||||
MessageHeader(void);
|
||||
std::string Encode(void);
|
||||
std::expected<void, std::string> Decode(const std::string buffer);
|
||||
uint32_t PacketSize(void);
|
||||
};
|
||||
|
||||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
@@ -0,0 +1,96 @@
|
||||
extern "C" {
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
}
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <span>
|
||||
#include <iostream>
|
||||
|
||||
#include <cstring>
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
#include <tcpclient.hpp>
|
||||
|
||||
TCPClient::TCPClient() {
|
||||
sock = 0;
|
||||
family = 0;
|
||||
}
|
||||
|
||||
std::expected<void, std::string> TCPClient::Connect(const std::string naddress, const int port) {
|
||||
|
||||
struct sockaddr_in sa;
|
||||
if (inet_pton(AF_INET, naddress.c_str(), &(sa.sin_addr)) == 1) {
|
||||
family = AF_INET;
|
||||
} else if (inet_pton(AF_INET6, naddress.c_str(), &(sa.sin_addr)) == 1) {
|
||||
family = AF_INET6;
|
||||
} else {
|
||||
int errnocopy = errno;
|
||||
std::string error = std::strerror(errnocopy);
|
||||
return std::unexpected("Incorrect address " + naddress);
|
||||
}
|
||||
|
||||
sock = socket(family, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
return std::unexpected("Error opening socket");
|
||||
}
|
||||
struct sockaddr_in serv_addr;
|
||||
memset(&serv_addr, 0, sizeof(serv_addr));
|
||||
|
||||
serv_addr.sin_family = AF_INET;
|
||||
serv_addr.sin_port = htons(port);
|
||||
const char* addr = naddress.data();
|
||||
if (inet_pton(AF_INET, addr, &serv_addr.sin_addr) <= 0) {
|
||||
return std::unexpected("Invalid server IP address");
|
||||
}
|
||||
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = 5;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout) < 0) {
|
||||
return std::unexpected("Set timeout error");
|
||||
}
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof timeout) < 0) {
|
||||
return std::unexpected("Set timeout error");
|
||||
}
|
||||
if (connect(sock, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) {
|
||||
return std::unexpected("Connecting error");
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::expected<int, std::string> TCPClient::Write(std::string payload) {
|
||||
int n = 0;
|
||||
if ((n = write(sock, payload.data(), payload.size())) < 0) {
|
||||
return std::unexpected("Write error");
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
std::expected<int, std::string> TCPClient::Read(std::string& res, int size) {
|
||||
char buffer[size + 1];
|
||||
memset(&buffer, 0, size + 1);
|
||||
int rsize = 0;
|
||||
if ((rsize = read(sock, &buffer, size)) < 0) {
|
||||
return std::unexpected("Read error");
|
||||
}
|
||||
res.append(buffer, rsize);
|
||||
return rsize;
|
||||
}
|
||||
|
||||
TCPClient::~TCPClient() {
|
||||
close(sock);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <span>
|
||||
#include <iostream>
|
||||
|
||||
#include <netclient.hpp>
|
||||
|
||||
class TCPClient : public NetClient {
|
||||
private:
|
||||
int sock;
|
||||
int family;
|
||||
public:
|
||||
TCPClient(void);
|
||||
std::expected<void, std::string> Connect(std::string address, const int port);
|
||||
std::expected<int, std::string> Write(std::string payload) override;
|
||||
std::expected<int, std::string> Read(std::string& buffer, int size) override;
|
||||
~TCPClient(void);
|
||||
};
|
||||
Reference in New Issue
Block a user