diff --git a/Makefile b/Makefile index 89350a1..b575c99 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am__objects_1 = uxlogger.$(OBJEXT) msgheader.$(OBJEXT) \ - interface.$(OBJEXT) uxcontrol.pb.$(OBJEXT) + interface.$(OBJEXT) iprouter.$(OBJEXT) uxcontrol.pb.$(OBJEXT) am_helmetcli_OBJECTS = helmetcli.$(OBJEXT) uxclient.$(OBJEXT) \ $(am__objects_1) helmetcli_OBJECTS = $(am_helmetcli_OBJECTS) @@ -219,7 +219,7 @@ CSCOPE = cscope CTAGS = ctags CXX = g++ CXXDEPMODE = depmode=none -CXXFLAGS = -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1 -MMD -MP +CXXFLAGS = -O1 -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1 -MMD -MP CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps @@ -314,6 +314,7 @@ helmet_SOURCES = \ uxlogger.cpp uxlogger.hpp \ msgheader.cpp msgheader.hpp \ interface.cpp interface.hpp \ + iprouter.cpp iprouter.hpp \ uxcontrol.pb.cc uxcontrol.pb.h ASTYLE_OPTS = --indent=spaces=8 --style=java diff --git a/Makefile.am b/Makefile.am index 7855877..dd86bfe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects -CXXFLAGS = -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1 -MMD -MP +CXXFLAGS = -O1 -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1 -MMD -MP LDFLAGS = -pthread LIBS = -Wl,--as-need -lprotobuf @@ -20,6 +20,7 @@ helmet_SOURCES = \ uxlogger.cpp uxlogger.hpp \ msgheader.cpp msgheader.hpp \ interface.cpp interface.hpp \ + iprouter.cpp iprouter.hpp \ uxcontrol.pb.cc uxcontrol.pb.h ASTYLE_OPTS = --indent=spaces=8 --style=java diff --git a/Makefile.in b/Makefile.in index e8cb8dd..f01c3dd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -105,7 +105,7 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am__objects_1 = uxlogger.$(OBJEXT) msgheader.$(OBJEXT) \ - interface.$(OBJEXT) uxcontrol.pb.$(OBJEXT) + interface.$(OBJEXT) iprouter.$(OBJEXT) uxcontrol.pb.$(OBJEXT) am_helmetcli_OBJECTS = helmetcli.$(OBJEXT) uxclient.$(OBJEXT) \ $(am__objects_1) helmetcli_OBJECTS = $(am_helmetcli_OBJECTS) @@ -219,7 +219,7 @@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1 -MMD -MP +CXXFLAGS = -O1 -std=c++23 -Wall -I. -pthread -D_GNU_SOURCE=1 -MMD -MP CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -314,6 +314,7 @@ helmet_SOURCES = \ uxlogger.cpp uxlogger.hpp \ msgheader.cpp msgheader.hpp \ interface.cpp interface.hpp \ + iprouter.cpp iprouter.hpp \ uxcontrol.pb.cc uxcontrol.pb.h ASTYLE_OPTS = --indent=spaces=8 --style=java diff --git a/interface.cpp b/interface.cpp index 2431bd8..79a9f59 100644 --- a/interface.cpp +++ b/interface.cpp @@ -32,10 +32,11 @@ std::expected Interface::Create(const std::string name) { std::string error = std::strerror(errnocopy); return std::unexpected("Create interface error: " + error); } + struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); ifr.ifr_flags = IFF_TUN | IFF_NO_PI; - strncpy(ifr.ifr_name, name.c_str(), IFNAMSIZ - 1); + strncpy(ifr.ifr_name, name.data(), IFNAMSIZ - 1); if (ioctl(tunfd, TUNSETIFF, (void*)(&ifr)) < 0) { close(tunfd); int errnocopy = errno; @@ -43,7 +44,8 @@ std::expected Interface::Create(const std::string name) { return std::unexpected("Create interface error: " + error); } ifname = ifr.ifr_name; -#if 0 + +#if DEFINE_TUNPERSIST if (ioctl(tunfd, TUNSETPERSIST, 0) < 0) { close(tunfd); int errnocopy = errno; @@ -61,7 +63,7 @@ std::expected Interface::Create(const std::string name) { std::string error = std::strerror(errnocopy); return std::unexpected("Get MTU error: " + error); } - strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + strncpy(ifr.ifr_name, ifname.data(), IFNAMSIZ - 1); if (ioctl(sockfd, SIOCGIFMTU, &ifr) < 0) { close(tunfd); close(sockfd); @@ -83,7 +85,7 @@ std::expected Interface::SetMTU(int ifmtu) { } struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + strncpy(ifr.ifr_name, ifname.data(), IFNAMSIZ - 1); ifr.ifr_mtu = ifmtu; if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) { close(sockfd); @@ -104,7 +106,7 @@ std::expected Interface::GetMTU(void) { std::string error = std::strerror(errnocopy); return std::unexpected("Get MTU error: " + error); } - strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + strncpy(ifr.ifr_name, ifname.data(), IFNAMSIZ - 1); if (ioctl(sockfd, SIOCGIFMTU, &ifr) < 0) { close(sockfd); int errnocopy = errno; @@ -125,7 +127,7 @@ std::expected Interface::GetIP4Address(void) { return std::unexpected("Get MTU error: " + error); } ifr.ifr_addr.sa_family = AF_INET; - strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + strncpy(ifr.ifr_name, ifname.data(), IFNAMSIZ - 1); if (ioctl(sockfd, SIOCGIFADDR, &ifr) < 0) { close(sockfd); @@ -143,23 +145,24 @@ std::expected Interface::GetIP4Address(void) { std::expected Interface::SetIP4Address(std::string ipaddr) { struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_addr.sa_family = AF_INET; + strncpy(ifr.ifr_name, ifname.data(), IFNAMSIZ - 1); + + struct sockaddr_in* addr = (struct sockaddr_in *)&ifr.ifr_addr; + addr->sin_family = AF_INET; + if (inet_pton(AF_INET, ipaddr.data(), &addr->sin_addr) <= 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set address error: " + error); + } + int sockfd = 0; if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { int errnocopy = errno; std::string error = std::strerror(errnocopy); return std::unexpected("Set address error: " + error); } - ifr.ifr_addr.sa_family = AF_INET; - strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); - struct sockaddr_in* addr = (struct sockaddr_in *)&ifr.ifr_addr; - addr->sin_family = AF_INET; - if (inet_pton(AF_INET, ipaddr.c_str(), &addr->sin_addr) <= 0) { - close(sockfd); - int errnocopy = errno; - std::string error = std::strerror(errnocopy); - return std::unexpected("Set address error: " + error); - } if (ioctl(sockfd, SIOCSIFADDR, &ifr) < 0) { close(sockfd); int errnocopy = errno; @@ -174,7 +177,8 @@ std::expected Interface::SetIP4Netmask(int prefix) { if (prefix < 0 || prefix > 32) { return std::unexpected("Invalid prefix"); } - uint32_t mask = (prefix == 0) ? 0 : (~0U << (32 - prefix)); + //uint32_t mask = (prefix == 0) ? 0 : (~0U << (32 - prefix)); + uint32_t mask = (prefix == 0) ? 0 : htonl(~((1U << (32 - prefix)) - 1)); struct in_addr maskaddr; maskaddr.s_addr = htonl(mask); @@ -182,28 +186,28 @@ std::expected Interface::SetIP4Netmask(int prefix) { if (inet_ntop(AF_INET, &maskaddr, buffer, sizeof(buffer)) == NULL) { int errnocopy = errno; std::string error = std::strerror(errnocopy); - return std::unexpected("Set1 netmask error: " + error); + return std::unexpected("Set netmask error: " + error); } auto netmask = std::string(buffer); struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_addr.sa_family = AF_INET; + strncpy(ifr.ifr_name, ifname.data(), IFNAMSIZ - 1); + + struct sockaddr_in* addr = (struct sockaddr_in *)&ifr.ifr_addr; + addr->sin_family = AF_INET; + if (inet_pton(AF_INET, netmask.data(), &addr->sin_addr) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set netmask error: " + error); + } + int sockfd = 0; if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { int errnocopy = errno; std::string error = std::strerror(errnocopy); - return std::unexpected("Set2 netmask error: " + error); - } - ifr.ifr_addr.sa_family = AF_INET; - strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); - - struct sockaddr_in* addr = (struct sockaddr_in *)&ifr.ifr_addr; - addr->sin_family = AF_INET; - if (inet_pton(AF_INET, netmask.c_str(), &addr->sin_addr) < 0) { - close(sockfd); - int errnocopy = errno; - std::string error = std::strerror(errnocopy); - return std::unexpected("Set3 netmask error: " + error); + return std::unexpected("Set netmask error: " + error); } if (ioctl(sockfd, SIOCSIFNETMASK, &ifr) < 0) { close(sockfd); @@ -225,7 +229,7 @@ std::expected Interface::Up(void) { struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + strncpy(ifr.ifr_name, ifname.data(), IFNAMSIZ - 1); if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) { close(sockfd); int errnocopy = errno; @@ -252,7 +256,7 @@ std::expected Interface::Down(void) { } struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + strncpy(ifr.ifr_name, ifname.data(), IFNAMSIZ - 1); if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) { close(sockfd); int errnocopy = errno; @@ -295,93 +299,3 @@ Interface::~Interface() { close(tunfd); } - -std::expected Interface::UpN(void) { - int netlinkfd = 0; - if ((netlinkfd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE)) < 0) { - int errnocopy = errno; - std::string error = std::strerror(errnocopy); - return std::unexpected("Create interface error: " + error); - } - - struct { - struct nlmsghdr header; - struct ifinfomsg content; - } request; - - memset(&request, 0, sizeof request); - request.header.nlmsg_len = NLMSG_LENGTH(sizeof request.content); - request.header.nlmsg_flags = NLM_F_REQUEST; - request.header.nlmsg_type = RTM_NEWLINK; - request.content.ifi_index = if_nametoindex(ifname.c_str()); - request.content.ifi_flags = IFF_UP; - request.content.ifi_change = 1; - - if (send(netlinkfd, &request, request.header.nlmsg_len, 0) < 0) { - close(netlinkfd); - int errnocopy = errno; - std::string error = std::strerror(errnocopy); - return std::unexpected("Up interface error: " + error); - } - close(netlinkfd); - return {}; -} - -std::expected Interface::SetIP4AddrMask(const std::string address, const int prefix) { - int netlinkfd = 0; - if ((netlinkfd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE)) < 0) { - int errnocopy = errno; - std::string error = std::strerror(errnocopy); - return std::unexpected("Create interface error: " + error); - } - - int rc = 0; - struct sockaddr_nl sockaddr; - memset(&sockaddr, 0, sizeof sockaddr); - sockaddr.nl_family = AF_NETLINK; - if ((rc = bind(netlinkfd, (struct sockaddr*) &sockaddr, sizeof sockaddr))< 0) { - close(netlinkfd); - int errnocopy = errno; - std::string error = std::strerror(errnocopy); - return std::unexpected("Set interface address error: " + error); - } - struct { - struct nlmsghdr header; - struct ifaddrmsg content; - char attributes_buf[64]; - } request; - - struct rtattr *request_attr; - size_t attributes_buf_avail = sizeof request.attributes_buf; - - memset(&request, 0, sizeof request); - request.header.nlmsg_len = NLMSG_LENGTH(sizeof request.content); - request.header.nlmsg_flags = NLM_F_REQUEST | NLM_F_EXCL | NLM_F_CREATE; - request.header.nlmsg_type = RTM_NEWADDR; - request.content.ifa_index = if_nametoindex(ifname.c_str()); - request.content.ifa_family = AF_INET; - request.content.ifa_prefixlen = prefix; - - /* request.attributes[IFA_LOCAL] = address */ - request_attr = IFA_RTA(&request.content); - request_attr->rta_type = IFA_LOCAL; - request_attr->rta_len = RTA_LENGTH(sizeof (struct in_addr)); - request.header.nlmsg_len += request_attr->rta_len; - inet_pton(AF_INET, address.c_str(), RTA_DATA(request_attr)); - - /* request.attributes[IFA_ADDRESS] = address */ - request_attr = RTA_NEXT(request_attr, attributes_buf_avail); - request_attr->rta_type = IFA_ADDRESS; - request_attr->rta_len = RTA_LENGTH(sizeof (struct in_addr)); - request.header.nlmsg_len += request_attr->rta_len; - inet_pton(AF_INET, address.c_str(), RTA_DATA(request_attr)); - - if (send(netlinkfd, &request, request.header.nlmsg_len, 0) < 0) { - close(netlinkfd); - int errnocopy = errno; - std::string error = std::strerror(errnocopy); - return std::unexpected("Set interface address error: " + error); - } - close(netlinkfd); - return {}; -} diff --git a/interface.hpp b/interface.hpp index 57c5935..9da2d3b 100644 --- a/interface.hpp +++ b/interface.hpp @@ -10,7 +10,6 @@ private: public: std::expected Create(const std::string name); std::string Name(void); - //int TunDescr(void); int MTU(); std::expected SetMTU(int mtu); @@ -21,8 +20,6 @@ public: std::expected Up(void); std::expected Down(void); - std::expected UpN(void); - std::expected SetIP4AddrMask(const std::string address, const int prefix); std::expected Read(void); diff --git a/iprouter.cpp b/iprouter.cpp new file mode 100644 index 0000000..7fc63ef --- /dev/null +++ b/iprouter.cpp @@ -0,0 +1,93 @@ + +extern "C" { +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +} + +#define BUFSIZE 8192 + +#include +#include +#include +#include + +#include + +std::expected Router::AddRoute(std::string address, uint64_t prefix, std::string gateway) { + struct sockaddr_in sa; + if (inet_pton(AF_INET, address.data(), &(sa.sin_addr)) == 1) { + } else { + return std::unexpected(std::format("Incorrect address {}", address)); + } + + struct rtentry rt; + memset(&rt, 0, sizeof(rt)); + + struct sockaddr_in *sin; + sin = (struct sockaddr_in*)&rt.rt_dst; + sin->sin_family = AF_INET; + if (inet_pton(AF_INET, address.data(), &sin->sin_addr) != 1) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Incorrect address {}, error: {}", address, error)); + }; + + sin = (struct sockaddr_in*) &rt.rt_gateway; + sin->sin_family = AF_INET; + if (inet_pton(AF_INET, gateway.data(), &sin->sin_addr) != 1) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Incorrect address {}, error: {}", gateway, error)); + }; + + char buffer[INET_ADDRSTRLEN]; + uint32_t mask = (prefix == 0) ? 0 : htonl(~((1U << (32 - prefix)) - 1)); + //uint32_t mask = (prefix == 0) ? 0 : (~0U << (32 - prefix)); + + struct in_addr addr; + addr.s_addr = mask; + + const char *dottedmask; + if ((dottedmask = inet_ntop(AF_INET, &addr, buffer, INET_ADDRSTRLEN)) == NULL) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Incorrect prefix {}, error: {}", prefix, error)); + }; + + sin = (struct sockaddr_in*) &rt.rt_genmask; + sin->sin_family = AF_INET; + if (inet_pton(AF_INET, dottedmask, &sin->sin_addr) != 1) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Incorrect address {}, error: {}", gateway, error)); + }; + + rt.rt_flags = RTF_UP | RTF_GATEWAY; + //rt.rt_dev = std::string("eth0").data(); + + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Error: {}", error)); + } + + if (ioctl(sockfd, SIOCADDRT, &rt) < 0) { + close(sockfd); + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Cannot set route, error: {}", error)); + } + close(sockfd); + return {}; +} + + diff --git a/works/rpcvar/iprouter.hpp b/iprouter.hpp similarity index 60% rename from works/rpcvar/iprouter.hpp rename to iprouter.hpp index 775c4bd..1675f94 100644 --- a/works/rpcvar/iprouter.hpp +++ b/iprouter.hpp @@ -13,6 +13,7 @@ public: using Routes = std::vector; class Router { - std::expected List(); +public: + std::expected AddRoute(std::string address, uint64_t prefix, std::string gateway); }; diff --git a/msgheader.cpp b/msgheader.cpp index fc65da3..c482f56 100644 --- a/msgheader.cpp +++ b/msgheader.cpp @@ -37,7 +37,7 @@ std::expected MessageHeader::Decode(const std::string rawHead std::memcpy(&tmp, rawHeader.data(), sizeof(uint32_t)); auto magic = ntohl(tmp); if (magic != msgMagic) { - return std::unexpected("Wrong magic code"); + return std::unexpected(std::format("Wrong magic code {:x}", magic)); } std::memcpy(&tmp, rawHeader.data() + sizeof(uint32_t), sizeof(uint32_t)); pSize = ntohl(tmp); diff --git a/resolver.cpp b/resolver.cpp new file mode 100644 index 0000000..7255164 --- /dev/null +++ b/resolver.cpp @@ -0,0 +1,76 @@ + +extern "C" { +#include +#include +#include +} + +#include +#include +#include + +#include + +Address::Address(std::string iaddress, int ifamily) { + address = iaddress; + family = ifamily; +} + +int Address::GetFamily() { + return family; +} + +std::string Address::GetAddress() { + return address; +} + +std::expected Resolver::Resolve(std::string hostname) { + struct sockaddr_in sa; + if (inet_pton(AF_INET, hostname.data(), &(sa.sin_addr)) == 1) { + family = AF_INET; + return Address(hostname, AF_INET); + } + if (inet_pton(AF_INET6, hostname.data(), &(sa.sin_addr)) == 1) { + return Address(hostname, AF_INET6); + } + + struct addrinfo hints, *res; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + + int status = 0; + if ((status = getaddrinfo(hostname.data(), NULL, &hints, &res)) != 0) { + std::string error = gai_strerror(status); + return std::unexpected("Resolve adress error: " + error); + } + struct addrinfo* p; + char ipaddr[INET6_ADDRSTRLEN + 1]; + for (p = res; p != NULL; p = p->ai_next) { + if (p->ai_family == AF_INET) { + struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr; + void* addr = &(ipv4->sin_addr); + if (inet_ntop(p->ai_family, addr, ipaddr, sizeof(ipaddr)) == NULL) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Cannot conver address: " + error); + } + std::string address(ipaddr); + return Address(address, AF_INET);; + } + } + for (p = res; p != NULL; p = p->ai_next) { + if (p->ai_family == AF_INET6) { + struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr; + void* addr = &(ipv6->sin6_addr); + if (inet_ntop(p->ai_family, addr, ipaddr, sizeof(ipaddr)) == NULL) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Cannot conver address: " + error); + } + std::string address(ipaddr); + return Address(address, AF_INET6); + } + } + return std::unexpected("Cannot resolve hostname " + hostname); +} diff --git a/resolver.hpp b/resolver.hpp new file mode 100644 index 0000000..c24fb69 --- /dev/null +++ b/resolver.hpp @@ -0,0 +1,20 @@ + +#include +#include + +class Address { +private: + int family; + std::string address; +public: + Address(const std::string iaddress, const int ifamily); + int GetFamily(); + std::string GetAddress(); +}; + +class Resolver { +private: + int family; +public: + std::expected Resolve(const std::string hostname); +}; diff --git a/sockhand.cpp b/sockhand.cpp index 4560ee8..4cf79c3 100644 --- a/sockhand.cpp +++ b/sockhand.cpp @@ -80,8 +80,6 @@ void SocketHandler::RecvMessages(void) { uxlogger.Log(std::format("Read only {} from {} bytes", rsize, msgHeaderSize)); break; } - uxlogger.Log(std::format("Receive header rsize {}", rsize)); - MessageHeader header; auto decodeRes = header.Decode(rawHeader); if (!decodeRes) { @@ -89,8 +87,6 @@ void SocketHandler::RecvMessages(void) { break; } auto pSize = header.PacketSize(); - uxlogger.Log(std::format("Message size {}", pSize)); - if (pSize > 0) { std::string rawMessage(pSize, 0); if ((rsize = recv(sock, rawMessage.data(), rawMessage.size(), MSG_WAITALL)) < 0) { @@ -99,10 +95,9 @@ void SocketHandler::RecvMessages(void) { uxlogger.Log(std::format("Read message error: {}", error)); break; } - uxlogger.Log(std::format("Receive message rsize {}", rsize)); - uxcontrol::Message msg; + uxcontrol::SimpleMessage msg; msg.ParseFromString(rawMessage); - uxlogger.Log(std::format("Receive message, kind {}", msg.meta().kind())); + uxlogger.Log(std::format("Receive message {}", msg.meta().kind())); } } done.release(); diff --git a/uxclient.cpp b/uxclient.cpp index 954fd39..b66f326 100644 --- a/uxclient.cpp +++ b/uxclient.cpp @@ -19,6 +19,7 @@ extern "C" { #include #include #include +#include #include @@ -116,26 +117,13 @@ void UxClient::RecvMessages(void) { void UxClient::SendMessages(void) { while (true) { - auto readRes = interface.Read(); if (!readRes) { uxlogger.Log(std::format("Read packet error: {}", readRes.error())); } auto packet = readRes.value(); - uxlogger.Log(std::format("Read packet size {}", packet.size())); - int wsize = 0; - MessageHeader header(packet.size()); - auto rawHeader = header.Encode(); - if ((wsize = write(sock, rawHeader.data(), rawHeader.size())) < 0) { - int errnoCopy = errno; - std::string error = std::strerror(errnoCopy); - uxlogger.Log(std::format("Write header error: {}", error)); - break; - } - uxlogger.Log(std::format("Write header wsize: {}", wsize)); - - uxcontrol::InternetPacket intPacket; + uxcontrol::PacketMessage intPacket; auto meta = intPacket.mutable_meta(); meta->set_kind("internetPacket"); intPacket.set_payload(packet); @@ -143,15 +131,22 @@ void UxClient::SendMessages(void) { std::string rawMessage; intPacket.SerializeToString(&rawMessage); - if ((wsize = write(sock, rawMessage.data(), rawMessage.size())) < 0) { + MessageHeader header(rawMessage.size()); + auto rawHeader = header.Encode(); + int wsize = 0; + if ((wsize = send(sock, rawHeader.data(), rawHeader.size(), 0)) < 0) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + uxlogger.Log(std::format("Write header error: {}", error)); + break; + } + if ((wsize = send(sock, rawMessage.data(), rawMessage.size(), 0)) < 0) { int errnoCopy = errno; std::string error = std::strerror(errnoCopy); uxlogger.Log(std::format("Write message error: {}", error)); break; } uxlogger.Log("Send message"); - - //std::this_thread::sleep_for(std::chrono::seconds(1)); } done.release(); return; @@ -168,7 +163,7 @@ std::expected UxClient::Run(void) { if (!setAddrRes) { return std::unexpected(setAddrRes.error()); } - auto setMaskRes = interface.SetIP4Netmask(24); + auto setMaskRes = interface.SetIP4Netmask(30); if (!setMaskRes) { return std::unexpected(setMaskRes.error()); } @@ -180,6 +175,13 @@ std::expected UxClient::Run(void) { if (!createRes) { return std::unexpected(createRes.error()); } + + Router router; + auto addRouteRes = router.AddRoute("1.1.1.2", 32, "10.1.1.2"); + if (!addRouteRes) { + return std::unexpected(addRouteRes.error()); + } + std::thread sendThr(&UxClient::SendMessages, this); sendThr.detach(); diff --git a/uxcontrol.pb.cc b/uxcontrol.pb.cc index 25d99ea..52040c3 100644 --- a/uxcontrol.pb.cc +++ b/uxcontrol.pb.cc @@ -21,270 +21,184 @@ namespace _pb = ::PROTOBUF_NAMESPACE_ID; namespace _pbi = _pb::internal; namespace uxcontrol { -PROTOBUF_CONSTEXPR MsgMeta::MsgMeta( +PROTOBUF_CONSTEXPR MetaHeader::MetaHeader( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.kind_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_._cached_size_)*/{}} {} -struct MsgMetaDefaultTypeInternal { - PROTOBUF_CONSTEXPR MsgMetaDefaultTypeInternal() +struct MetaHeaderDefaultTypeInternal { + PROTOBUF_CONSTEXPR MetaHeaderDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~MsgMetaDefaultTypeInternal() {} + ~MetaHeaderDefaultTypeInternal() {} union { - MsgMeta _instance; + MetaHeader _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MsgMetaDefaultTypeInternal _MsgMeta_default_instance_; -PROTOBUF_CONSTEXPR Message::Message( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetaHeaderDefaultTypeInternal _MetaHeader_default_instance_; +PROTOBUF_CONSTEXPR SimpleMessage::SimpleMessage( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.meta_)*/nullptr , /*decltype(_impl_._cached_size_)*/{}} {} -struct MessageDefaultTypeInternal { - PROTOBUF_CONSTEXPR MessageDefaultTypeInternal() +struct SimpleMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR SimpleMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~MessageDefaultTypeInternal() {} + ~SimpleMessageDefaultTypeInternal() {} union { - Message _instance; + SimpleMessage _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageDefaultTypeInternal _Message_default_instance_; -PROTOBUF_CONSTEXPR InternetPacket::InternetPacket( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SimpleMessageDefaultTypeInternal _SimpleMessage_default_instance_; +PROTOBUF_CONSTEXPR PacketMessage::PacketMessage( ::_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() +struct PacketMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR PacketMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~InternetPacketDefaultTypeInternal() {} + ~PacketMessageDefaultTypeInternal() {} union { - InternetPacket _instance; + PacketMessage _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InternetPacketDefaultTypeInternal _InternetPacket_default_instance_; -PROTOBUF_CONSTEXPR HelloMsg::HelloMsg( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PacketMessageDefaultTypeInternal _PacketMessage_default_instance_; +PROTOBUF_CONSTEXPR AddressMessage::AddressMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.address_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.meta_)*/nullptr + , /*decltype(_impl_.prefix_)*/uint64_t{0u} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct AddressMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR AddressMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~AddressMessageDefaultTypeInternal() {} + union { + AddressMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AddressMessageDefaultTypeInternal _AddressMessage_default_instance_; +PROTOBUF_CONSTEXPR RouteMessage::RouteMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.address_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.gateway_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.meta_)*/nullptr + , /*decltype(_impl_.prefix_)*/uint64_t{0u} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct RouteMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR RouteMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~RouteMessageDefaultTypeInternal() {} + union { + RouteMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RouteMessageDefaultTypeInternal _RouteMessage_default_instance_; +PROTOBUF_CONSTEXPR HelloMessage::HelloMessage( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.message_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.meta_)*/nullptr , /*decltype(_impl_._cached_size_)*/{}} {} -struct HelloMsgDefaultTypeInternal { - PROTOBUF_CONSTEXPR HelloMsgDefaultTypeInternal() +struct HelloMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR HelloMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~HelloMsgDefaultTypeInternal() {} + ~HelloMessageDefaultTypeInternal() {} union { - HelloMsg _instance; + HelloMessage _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HelloMsgDefaultTypeInternal _HelloMsg_default_instance_; -PROTOBUF_CONSTEXPR ReqMeta::ReqMeta( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.kind_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_._cached_size_)*/{}} {} -struct ReqMetaDefaultTypeInternal { - PROTOBUF_CONSTEXPR ReqMetaDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ReqMetaDefaultTypeInternal() {} - union { - ReqMeta _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReqMetaDefaultTypeInternal _ReqMeta_default_instance_; -PROTOBUF_CONSTEXPR ResMeta::ResMeta( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.message_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.error_)*/false - , /*decltype(_impl_._cached_size_)*/{}} {} -struct ResMetaDefaultTypeInternal { - PROTOBUF_CONSTEXPR ResMetaDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ResMetaDefaultTypeInternal() {} - union { - ResMeta _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResMetaDefaultTypeInternal _ResMeta_default_instance_; -PROTOBUF_CONSTEXPR Request::Request( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.meta_)*/nullptr - , /*decltype(_impl_._cached_size_)*/{}} {} -struct RequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RequestDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~RequestDefaultTypeInternal() {} - union { - Request _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RequestDefaultTypeInternal _Request_default_instance_; -PROTOBUF_CONSTEXPR Result::Result( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.meta_)*/nullptr - , /*decltype(_impl_._cached_size_)*/{}} {} -struct ResultDefaultTypeInternal { - PROTOBUF_CONSTEXPR ResultDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ResultDefaultTypeInternal() {} - union { - Result _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResultDefaultTypeInternal _Result_default_instance_; -PROTOBUF_CONSTEXPR HelloRequest::HelloRequest( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.message_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.meta_)*/nullptr - , /*decltype(_impl_._cached_size_)*/{}} {} -struct HelloRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR HelloRequestDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~HelloRequestDefaultTypeInternal() {} - union { - HelloRequest _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HelloRequestDefaultTypeInternal _HelloRequest_default_instance_; -PROTOBUF_CONSTEXPR HelloResult::HelloResult( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.message_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.meta_)*/nullptr - , /*decltype(_impl_._cached_size_)*/{}} {} -struct HelloResultDefaultTypeInternal { - PROTOBUF_CONSTEXPR HelloResultDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~HelloResultDefaultTypeInternal() {} - union { - HelloResult _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HelloResultDefaultTypeInternal _HelloResult_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HelloMessageDefaultTypeInternal _HelloMessage_default_instance_; } // namespace uxcontrol -static ::_pb::Metadata file_level_metadata_uxcontrol_2eproto[10]; +static ::_pb::Metadata file_level_metadata_uxcontrol_2eproto[6]; static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_uxcontrol_2eproto = nullptr; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_uxcontrol_2eproto = nullptr; const uint32_t TableStruct_uxcontrol_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::MsgMeta, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::MetaHeader, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::MsgMeta, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::MetaHeader, _impl_.kind_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::Message, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::SimpleMessage, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::Message, _impl_.meta_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::SimpleMessage, _impl_.meta_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::InternetPacket, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::PacketMessage, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::InternetPacket, _impl_.meta_), - PROTOBUF_FIELD_OFFSET(::uxcontrol::InternetPacket, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::PacketMessage, _impl_.meta_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::PacketMessage, _impl_.payload_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloMsg, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::AddressMessage, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloMsg, _impl_.meta_), - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloMsg, _impl_.message_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::AddressMessage, _impl_.meta_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::AddressMessage, _impl_.address_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::AddressMessage, _impl_.prefix_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::ReqMeta, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::RouteMessage, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::ReqMeta, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::RouteMessage, _impl_.meta_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::RouteMessage, _impl_.address_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::RouteMessage, _impl_.prefix_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::RouteMessage, _impl_.gateway_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::ResMeta, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloMessage, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::ResMeta, _impl_.error_), - PROTOBUF_FIELD_OFFSET(::uxcontrol::ResMeta, _impl_.message_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::Request, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::Request, _impl_.meta_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::Result, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::Result, _impl_.meta_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloRequest, _impl_.meta_), - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloRequest, _impl_.message_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloResult, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloResult, _impl_.meta_), - PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloResult, _impl_.message_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloMessage, _impl_.meta_), + PROTOBUF_FIELD_OFFSET(::uxcontrol::HelloMessage, _impl_.message_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::uxcontrol::MsgMeta)}, - { 7, -1, -1, sizeof(::uxcontrol::Message)}, - { 14, -1, -1, sizeof(::uxcontrol::InternetPacket)}, - { 22, -1, -1, sizeof(::uxcontrol::HelloMsg)}, - { 30, -1, -1, sizeof(::uxcontrol::ReqMeta)}, - { 37, -1, -1, sizeof(::uxcontrol::ResMeta)}, - { 45, -1, -1, sizeof(::uxcontrol::Request)}, - { 52, -1, -1, sizeof(::uxcontrol::Result)}, - { 59, -1, -1, sizeof(::uxcontrol::HelloRequest)}, - { 67, -1, -1, sizeof(::uxcontrol::HelloResult)}, + { 0, -1, -1, sizeof(::uxcontrol::MetaHeader)}, + { 7, -1, -1, sizeof(::uxcontrol::SimpleMessage)}, + { 14, -1, -1, sizeof(::uxcontrol::PacketMessage)}, + { 22, -1, -1, sizeof(::uxcontrol::AddressMessage)}, + { 31, -1, -1, sizeof(::uxcontrol::RouteMessage)}, + { 41, -1, -1, sizeof(::uxcontrol::HelloMessage)}, }; static const ::_pb::Message* const file_default_instances[] = { - &::uxcontrol::_MsgMeta_default_instance_._instance, - &::uxcontrol::_Message_default_instance_._instance, - &::uxcontrol::_InternetPacket_default_instance_._instance, - &::uxcontrol::_HelloMsg_default_instance_._instance, - &::uxcontrol::_ReqMeta_default_instance_._instance, - &::uxcontrol::_ResMeta_default_instance_._instance, - &::uxcontrol::_Request_default_instance_._instance, - &::uxcontrol::_Result_default_instance_._instance, - &::uxcontrol::_HelloRequest_default_instance_._instance, - &::uxcontrol::_HelloResult_default_instance_._instance, + &::uxcontrol::_MetaHeader_default_instance_._instance, + &::uxcontrol::_SimpleMessage_default_instance_._instance, + &::uxcontrol::_PacketMessage_default_instance_._instance, + &::uxcontrol::_AddressMessage_default_instance_._instance, + &::uxcontrol::_RouteMessage_default_instance_._instance, + &::uxcontrol::_HelloMessage_default_instance_._instance, }; const char descriptor_table_protodef_uxcontrol_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\017uxcontrol.proto\022\tuxcontrol\"\027\n\007MsgMeta\022" - "\014\n\004kind\030\001 \001(\t\"+\n\007Message\022 \n\004meta\030\001 \001(\0132\022" - ".uxcontrol.MsgMeta\"C\n\016InternetPacket\022 \n\004" - "meta\030\001 \001(\0132\022.uxcontrol.MsgMeta\022\017\n\007payloa" - "d\030\002 \001(\014\"=\n\010HelloMsg\022 \n\004meta\030\001 \001(\0132\022.uxco" - "ntrol.MsgMeta\022\017\n\007message\030\002 \001(\t\"\027\n\007ReqMet" - "a\022\014\n\004kind\030\001 \001(\t\")\n\007ResMeta\022\r\n\005error\030\001 \001(" - "\010\022\017\n\007message\030\002 \001(\t\"+\n\007Request\022 \n\004meta\030\001 " - "\001(\0132\022.uxcontrol.ReqMeta\"*\n\006Result\022 \n\004met" - "a\030\001 \001(\0132\022.uxcontrol.ResMeta\"A\n\014HelloRequ" - "est\022 \n\004meta\030\001 \001(\0132\022.uxcontrol.ReqMeta\022\017\n" - "\007message\030\002 \001(\t\"@\n\013HelloResult\022 \n\004meta\030\001 " - "\001(\0132\022.uxcontrol.ResMeta\022\017\n\007message\030\002 \001(\t" - "b\006proto3" + "\n\017uxcontrol.proto\022\tuxcontrol\"\032\n\nMetaHead" + "er\022\014\n\004kind\030\001 \001(\t\"4\n\rSimpleMessage\022#\n\004met" + "a\030\001 \001(\0132\025.uxcontrol.MetaHeader\"E\n\rPacket" + "Message\022#\n\004meta\030\001 \001(\0132\025.uxcontrol.MetaHe" + "ader\022\017\n\007payload\030\002 \001(\014\"V\n\016AddressMessage\022" + "#\n\004meta\030\001 \001(\0132\025.uxcontrol.MetaHeader\022\017\n\007" + "address\030\002 \001(\t\022\016\n\006prefix\030\003 \001(\004\"e\n\014RouteMe" + "ssage\022#\n\004meta\030\001 \001(\0132\025.uxcontrol.MetaHead" + "er\022\017\n\007address\030\002 \001(\t\022\016\n\006prefix\030\003 \001(\004\022\017\n\007g" + "ateway\030\004 \001(\t\"D\n\014HelloMessage\022#\n\004meta\030\001 \001" + "(\0132\025.uxcontrol.MetaHeader\022\017\n\007message\030\002 \001" + "(\tb\006proto3" ; static ::_pbi::once_flag descriptor_table_uxcontrol_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_uxcontrol_2eproto = { - false, false, 528, descriptor_table_protodef_uxcontrol_2eproto, + false, false, 450, descriptor_table_protodef_uxcontrol_2eproto, "uxcontrol.proto", - &descriptor_table_uxcontrol_2eproto_once, nullptr, 0, 10, + &descriptor_table_uxcontrol_2eproto_once, nullptr, 0, 6, schemas, file_default_instances, TableStruct_uxcontrol_2eproto::offsets, file_level_metadata_uxcontrol_2eproto, file_level_enum_descriptors_uxcontrol_2eproto, file_level_service_descriptors_uxcontrol_2eproto, @@ -299,19 +213,19 @@ namespace uxcontrol { // =================================================================== -class MsgMeta::_Internal { +class MetaHeader::_Internal { public: }; -MsgMeta::MsgMeta(::PROTOBUF_NAMESPACE_ID::Arena* arena, +MetaHeader::MetaHeader(::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:uxcontrol.MsgMeta) + // @@protoc_insertion_point(arena_constructor:uxcontrol.MetaHeader) } -MsgMeta::MsgMeta(const MsgMeta& from) +MetaHeader::MetaHeader(const MetaHeader& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MsgMeta* const _this = this; (void)_this; + MetaHeader* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.kind_){} , /*decltype(_impl_._cached_size_)*/{}}; @@ -325,10 +239,10 @@ MsgMeta::MsgMeta(const MsgMeta& from) _this->_impl_.kind_.Set(from._internal_kind(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:uxcontrol.MsgMeta) + // @@protoc_insertion_point(copy_constructor:uxcontrol.MetaHeader) } -inline void MsgMeta::SharedCtor( +inline void MetaHeader::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -342,8 +256,8 @@ inline void MsgMeta::SharedCtor( #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -MsgMeta::~MsgMeta() { - // @@protoc_insertion_point(destructor:uxcontrol.MsgMeta) +MetaHeader::~MetaHeader() { + // @@protoc_insertion_point(destructor:uxcontrol.MetaHeader) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -351,17 +265,17 @@ MsgMeta::~MsgMeta() { SharedDtor(); } -inline void MsgMeta::SharedDtor() { +inline void MetaHeader::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.kind_.Destroy(); } -void MsgMeta::SetCachedSize(int size) const { +void MetaHeader::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void MsgMeta::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.MsgMeta) +void MetaHeader::Clear() { +// @@protoc_insertion_point(message_clear_start:uxcontrol.MetaHeader) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -370,7 +284,7 @@ void MsgMeta::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* MsgMeta::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* MetaHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; @@ -382,7 +296,7 @@ const char* MsgMeta::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) auto str = _internal_mutable_kind(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.MsgMeta.kind")); + CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.MetaHeader.kind")); } else goto handle_unusual; continue; @@ -409,9 +323,9 @@ failure: #undef CHK_ } -uint8_t* MsgMeta::_InternalSerialize( +uint8_t* MetaHeader::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.MsgMeta) + // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.MetaHeader) uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -420,7 +334,7 @@ uint8_t* MsgMeta::_InternalSerialize( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_kind().data(), static_cast(this->_internal_kind().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "uxcontrol.MsgMeta.kind"); + "uxcontrol.MetaHeader.kind"); target = stream->WriteStringMaybeAliased( 1, this->_internal_kind(), target); } @@ -429,12 +343,12 @@ uint8_t* MsgMeta::_InternalSerialize( 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:uxcontrol.MsgMeta) + // @@protoc_insertion_point(serialize_to_array_end:uxcontrol.MetaHeader) return target; } -size_t MsgMeta::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.MsgMeta) +size_t MetaHeader::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:uxcontrol.MetaHeader) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -451,17 +365,17 @@ size_t MsgMeta::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MsgMeta::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MetaHeader::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MsgMeta::MergeImpl + MetaHeader::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MsgMeta::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MetaHeader::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(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.MsgMeta) +void MetaHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.MetaHeader) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -472,18 +386,18 @@ void MsgMeta::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOB _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:uxcontrol.MsgMeta) +void MetaHeader::CopyFrom(const MetaHeader& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.MetaHeader) if (&from == this) return; Clear(); MergeFrom(from); } -bool MsgMeta::IsInitialized() const { +bool MetaHeader::IsInitialized() const { return true; } -void MsgMeta::InternalSwap(MsgMeta* other) { +void MetaHeader::InternalSwap(MetaHeader* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); @@ -494,7 +408,7 @@ void MsgMeta::InternalSwap(MsgMeta* other) { ); } -::PROTOBUF_NAMESPACE_ID::Metadata MsgMeta::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata MetaHeader::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, file_level_metadata_uxcontrol_2eproto[0]); @@ -502,36 +416,36 @@ void MsgMeta::InternalSwap(MsgMeta* other) { // =================================================================== -class Message::_Internal { +class SimpleMessage::_Internal { public: - static const ::uxcontrol::MsgMeta& meta(const Message* msg); + static const ::uxcontrol::MetaHeader& meta(const SimpleMessage* msg); }; -const ::uxcontrol::MsgMeta& -Message::_Internal::meta(const Message* msg) { +const ::uxcontrol::MetaHeader& +SimpleMessage::_Internal::meta(const SimpleMessage* msg) { return *msg->_impl_.meta_; } -Message::Message(::PROTOBUF_NAMESPACE_ID::Arena* arena, +SimpleMessage::SimpleMessage(::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:uxcontrol.Message) + // @@protoc_insertion_point(arena_constructor:uxcontrol.SimpleMessage) } -Message::Message(const Message& from) +SimpleMessage::SimpleMessage(const SimpleMessage& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - Message* const _this = this; (void)_this; + SimpleMessage* 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 ::uxcontrol::MsgMeta(*from._impl_.meta_); + _this->_impl_.meta_ = new ::uxcontrol::MetaHeader(*from._impl_.meta_); } - // @@protoc_insertion_point(copy_constructor:uxcontrol.Message) + // @@protoc_insertion_point(copy_constructor:uxcontrol.SimpleMessage) } -inline void Message::SharedCtor( +inline void SimpleMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -541,8 +455,8 @@ inline void Message::SharedCtor( }; } -Message::~Message() { - // @@protoc_insertion_point(destructor:uxcontrol.Message) +SimpleMessage::~SimpleMessage() { + // @@protoc_insertion_point(destructor:uxcontrol.SimpleMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -550,17 +464,17 @@ Message::~Message() { SharedDtor(); } -inline void Message::SharedDtor() { +inline void SimpleMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); if (this != internal_default_instance()) delete _impl_.meta_; } -void Message::SetCachedSize(int size) const { +void SimpleMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Message::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.Message) +void SimpleMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:uxcontrol.SimpleMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -572,13 +486,13 @@ void Message::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Message::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* SimpleMessage::_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) { - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr); @@ -609,13 +523,13 @@ failure: #undef CHK_ } -uint8_t* Message::_InternalSerialize( +uint8_t* SimpleMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.Message) + // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.SimpleMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; if (this->_internal_has_meta()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage(1, _Internal::meta(this), @@ -626,19 +540,19 @@ uint8_t* Message::_InternalSerialize( 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:uxcontrol.Message) + // @@protoc_insertion_point(serialize_to_array_end:uxcontrol.SimpleMessage) return target; } -size_t Message::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.Message) +size_t SimpleMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:uxcontrol.SimpleMessage) size_t total_size = 0; uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; if (this->_internal_has_meta()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( @@ -648,46 +562,46 @@ size_t Message::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Message::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SimpleMessage::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Message::MergeImpl + SimpleMessage::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Message::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SimpleMessage::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(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.Message) +void SimpleMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.SimpleMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_meta()) { - _this->_internal_mutable_meta()->::uxcontrol::MsgMeta::MergeFrom( + _this->_internal_mutable_meta()->::uxcontrol::MetaHeader::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:uxcontrol.Message) +void SimpleMessage::CopyFrom(const SimpleMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.SimpleMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool Message::IsInitialized() const { +bool SimpleMessage::IsInitialized() const { return true; } -void Message::InternalSwap(Message* other) { +void SimpleMessage::InternalSwap(SimpleMessage* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_.meta_, other->_impl_.meta_); } -::PROTOBUF_NAMESPACE_ID::Metadata Message::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata SimpleMessage::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, file_level_metadata_uxcontrol_2eproto[1]); @@ -695,24 +609,24 @@ void Message::InternalSwap(Message* other) { // =================================================================== -class InternetPacket::_Internal { +class PacketMessage::_Internal { public: - static const ::uxcontrol::MsgMeta& meta(const InternetPacket* msg); + static const ::uxcontrol::MetaHeader& meta(const PacketMessage* msg); }; -const ::uxcontrol::MsgMeta& -InternetPacket::_Internal::meta(const InternetPacket* msg) { +const ::uxcontrol::MetaHeader& +PacketMessage::_Internal::meta(const PacketMessage* msg) { return *msg->_impl_.meta_; } -InternetPacket::InternetPacket(::PROTOBUF_NAMESPACE_ID::Arena* arena, +PacketMessage::PacketMessage(::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:uxcontrol.InternetPacket) + // @@protoc_insertion_point(arena_constructor:uxcontrol.PacketMessage) } -InternetPacket::InternetPacket(const InternetPacket& from) +PacketMessage::PacketMessage(const PacketMessage& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - InternetPacket* const _this = this; (void)_this; + PacketMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.payload_){} , decltype(_impl_.meta_){nullptr} @@ -728,12 +642,12 @@ InternetPacket::InternetPacket(const InternetPacket& from) _this->GetArenaForAllocation()); } if (from._internal_has_meta()) { - _this->_impl_.meta_ = new ::uxcontrol::MsgMeta(*from._impl_.meta_); + _this->_impl_.meta_ = new ::uxcontrol::MetaHeader(*from._impl_.meta_); } - // @@protoc_insertion_point(copy_constructor:uxcontrol.InternetPacket) + // @@protoc_insertion_point(copy_constructor:uxcontrol.PacketMessage) } -inline void InternetPacket::SharedCtor( +inline void PacketMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -748,8 +662,8 @@ inline void InternetPacket::SharedCtor( #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -InternetPacket::~InternetPacket() { - // @@protoc_insertion_point(destructor:uxcontrol.InternetPacket) +PacketMessage::~PacketMessage() { + // @@protoc_insertion_point(destructor:uxcontrol.PacketMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -757,18 +671,18 @@ InternetPacket::~InternetPacket() { SharedDtor(); } -inline void InternetPacket::SharedDtor() { +inline void PacketMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.payload_.Destroy(); if (this != internal_default_instance()) delete _impl_.meta_; } -void InternetPacket::SetCachedSize(int size) const { +void PacketMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void InternetPacket::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.InternetPacket) +void PacketMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:uxcontrol.PacketMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -781,13 +695,13 @@ void InternetPacket::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* InternetPacket::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* PacketMessage::_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) { - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr); @@ -827,13 +741,13 @@ failure: #undef CHK_ } -uint8_t* InternetPacket::_InternalSerialize( +uint8_t* PacketMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.InternetPacket) + // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.PacketMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; if (this->_internal_has_meta()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage(1, _Internal::meta(this), @@ -850,12 +764,12 @@ uint8_t* InternetPacket::_InternalSerialize( 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:uxcontrol.InternetPacket) + // @@protoc_insertion_point(serialize_to_array_end:uxcontrol.PacketMessage) return target; } -size_t InternetPacket::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.InternetPacket) +size_t PacketMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:uxcontrol.PacketMessage) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -869,7 +783,7 @@ size_t InternetPacket::ByteSizeLong() const { this->_internal_payload()); } - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; if (this->_internal_has_meta()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( @@ -879,17 +793,17 @@ size_t InternetPacket::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData InternetPacket::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PacketMessage::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - InternetPacket::MergeImpl + PacketMessage::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*InternetPacket::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PacketMessage::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(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.InternetPacket) +void PacketMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.PacketMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -898,24 +812,24 @@ void InternetPacket::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const : _this->_internal_set_payload(from._internal_payload()); } if (from._internal_has_meta()) { - _this->_internal_mutable_meta()->::uxcontrol::MsgMeta::MergeFrom( + _this->_internal_mutable_meta()->::uxcontrol::MetaHeader::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:uxcontrol.InternetPacket) +void PacketMessage::CopyFrom(const PacketMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.PacketMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool InternetPacket::IsInitialized() const { +bool PacketMessage::IsInitialized() const { return true; } -void InternetPacket::InternalSwap(InternetPacket* other) { +void PacketMessage::InternalSwap(PacketMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); @@ -927,7 +841,7 @@ void InternetPacket::InternalSwap(InternetPacket* other) { swap(_impl_.meta_, other->_impl_.meta_); } -::PROTOBUF_NAMESPACE_ID::Metadata InternetPacket::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata PacketMessage::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, file_level_metadata_uxcontrol_2eproto[2]); @@ -935,61 +849,64 @@ void InternetPacket::InternalSwap(InternetPacket* other) { // =================================================================== -class HelloMsg::_Internal { +class AddressMessage::_Internal { public: - static const ::uxcontrol::MsgMeta& meta(const HelloMsg* msg); + static const ::uxcontrol::MetaHeader& meta(const AddressMessage* msg); }; -const ::uxcontrol::MsgMeta& -HelloMsg::_Internal::meta(const HelloMsg* msg) { +const ::uxcontrol::MetaHeader& +AddressMessage::_Internal::meta(const AddressMessage* msg) { return *msg->_impl_.meta_; } -HelloMsg::HelloMsg(::PROTOBUF_NAMESPACE_ID::Arena* arena, +AddressMessage::AddressMessage(::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:uxcontrol.HelloMsg) + // @@protoc_insertion_point(arena_constructor:uxcontrol.AddressMessage) } -HelloMsg::HelloMsg(const HelloMsg& from) +AddressMessage::AddressMessage(const AddressMessage& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - HelloMsg* const _this = this; (void)_this; + AddressMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.message_){} + decltype(_impl_.address_){} , decltype(_impl_.meta_){nullptr} + , decltype(_impl_.prefix_){} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.message_.InitDefault(); + _impl_.address_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.message_.Set("", GetArenaForAllocation()); + _impl_.address_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_message().empty()) { - _this->_impl_.message_.Set(from._internal_message(), + if (!from._internal_address().empty()) { + _this->_impl_.address_.Set(from._internal_address(), _this->GetArenaForAllocation()); } if (from._internal_has_meta()) { - _this->_impl_.meta_ = new ::uxcontrol::MsgMeta(*from._impl_.meta_); + _this->_impl_.meta_ = new ::uxcontrol::MetaHeader(*from._impl_.meta_); } - // @@protoc_insertion_point(copy_constructor:uxcontrol.HelloMsg) + _this->_impl_.prefix_ = from._impl_.prefix_; + // @@protoc_insertion_point(copy_constructor:uxcontrol.AddressMessage) } -inline void HelloMsg::SharedCtor( +inline void AddressMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.message_){} + decltype(_impl_.address_){} , decltype(_impl_.meta_){nullptr} + , decltype(_impl_.prefix_){uint64_t{0u}} , /*decltype(_impl_._cached_size_)*/{} }; - _impl_.message_.InitDefault(); + _impl_.address_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.message_.Set("", GetArenaForAllocation()); + _impl_.address_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -HelloMsg::~HelloMsg() { - // @@protoc_insertion_point(destructor:uxcontrol.HelloMsg) +AddressMessage::~AddressMessage() { + // @@protoc_insertion_point(destructor:uxcontrol.AddressMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -997,37 +914,38 @@ HelloMsg::~HelloMsg() { SharedDtor(); } -inline void HelloMsg::SharedDtor() { +inline void AddressMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.message_.Destroy(); + _impl_.address_.Destroy(); if (this != internal_default_instance()) delete _impl_.meta_; } -void HelloMsg::SetCachedSize(int size) const { +void AddressMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void HelloMsg::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.HelloMsg) +void AddressMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:uxcontrol.AddressMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.message_.ClearToEmpty(); + _impl_.address_.ClearToEmpty(); if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { delete _impl_.meta_; } _impl_.meta_ = nullptr; + _impl_.prefix_ = uint64_t{0u}; _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* HelloMsg::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* AddressMessage::_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) { - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr); @@ -1035,13 +953,21 @@ const char* HelloMsg::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } else goto handle_unusual; continue; - // string message = 2; + // string address = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_message(); + auto str = _internal_mutable_address(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.HelloMsg.message")); + CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.AddressMessage.address")); + } else + goto handle_unusual; + continue; + // uint64 prefix = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.prefix_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); } else goto handle_unusual; continue; @@ -1068,111 +994,130 @@ failure: #undef CHK_ } -uint8_t* HelloMsg::_InternalSerialize( +uint8_t* AddressMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.HelloMsg) + // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.AddressMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader 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 message = 2; - if (!this->_internal_message().empty()) { + // string address = 2; + if (!this->_internal_address().empty()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_message().data(), static_cast(this->_internal_message().length()), + this->_internal_address().data(), static_cast(this->_internal_address().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "uxcontrol.HelloMsg.message"); + "uxcontrol.AddressMessage.address"); target = stream->WriteStringMaybeAliased( - 2, this->_internal_message(), target); + 2, this->_internal_address(), target); + } + + // uint64 prefix = 3; + if (this->_internal_prefix() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_prefix(), 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:uxcontrol.HelloMsg) + // @@protoc_insertion_point(serialize_to_array_end:uxcontrol.AddressMessage) return target; } -size_t HelloMsg::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.HelloMsg) +size_t AddressMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:uxcontrol.AddressMessage) 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 message = 2; - if (!this->_internal_message().empty()) { + // string address = 2; + if (!this->_internal_address().empty()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_message()); + this->_internal_address()); } - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; if (this->_internal_has_meta()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *_impl_.meta_); } + // uint64 prefix = 3; + if (this->_internal_prefix() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_prefix()); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData HelloMsg::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData AddressMessage::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - HelloMsg::MergeImpl + AddressMessage::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HelloMsg::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AddressMessage::GetClassData() const { return &_class_data_; } -void HelloMsg::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.HelloMsg) +void AddressMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.AddressMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_message().empty()) { - _this->_internal_set_message(from._internal_message()); + if (!from._internal_address().empty()) { + _this->_internal_set_address(from._internal_address()); } if (from._internal_has_meta()) { - _this->_internal_mutable_meta()->::uxcontrol::MsgMeta::MergeFrom( + _this->_internal_mutable_meta()->::uxcontrol::MetaHeader::MergeFrom( from._internal_meta()); } + if (from._internal_prefix() != 0) { + _this->_internal_set_prefix(from._internal_prefix()); + } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void HelloMsg::CopyFrom(const HelloMsg& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.HelloMsg) +void AddressMessage::CopyFrom(const AddressMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.AddressMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool HelloMsg::IsInitialized() const { +bool AddressMessage::IsInitialized() const { return true; } -void HelloMsg::InternalSwap(HelloMsg* other) { +void AddressMessage::InternalSwap(AddressMessage* 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_.message_, lhs_arena, - &other->_impl_.message_, rhs_arena + &_impl_.address_, lhs_arena, + &other->_impl_.address_, rhs_arena ); - swap(_impl_.meta_, other->_impl_.meta_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(AddressMessage, _impl_.prefix_) + + sizeof(AddressMessage::_impl_.prefix_) + - PROTOBUF_FIELD_OFFSET(AddressMessage, _impl_.meta_)>( + reinterpret_cast(&_impl_.meta_), + reinterpret_cast(&other->_impl_.meta_)); } -::PROTOBUF_NAMESPACE_ID::Metadata HelloMsg::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata AddressMessage::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, file_level_metadata_uxcontrol_2eproto[3]); @@ -1180,51 +1125,78 @@ void HelloMsg::InternalSwap(HelloMsg* other) { // =================================================================== -class ReqMeta::_Internal { +class RouteMessage::_Internal { public: + static const ::uxcontrol::MetaHeader& meta(const RouteMessage* msg); }; -ReqMeta::ReqMeta(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::uxcontrol::MetaHeader& +RouteMessage::_Internal::meta(const RouteMessage* msg) { + return *msg->_impl_.meta_; +} +RouteMessage::RouteMessage(::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:uxcontrol.ReqMeta) + // @@protoc_insertion_point(arena_constructor:uxcontrol.RouteMessage) } -ReqMeta::ReqMeta(const ReqMeta& from) +RouteMessage::RouteMessage(const RouteMessage& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - ReqMeta* const _this = this; (void)_this; + RouteMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.kind_){} + decltype(_impl_.address_){} + , decltype(_impl_.gateway_){} + , decltype(_impl_.meta_){nullptr} + , decltype(_impl_.prefix_){} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.kind_.InitDefault(); + _impl_.address_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.kind_.Set("", GetArenaForAllocation()); + _impl_.address_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_kind().empty()) { - _this->_impl_.kind_.Set(from._internal_kind(), + if (!from._internal_address().empty()) { + _this->_impl_.address_.Set(from._internal_address(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:uxcontrol.ReqMeta) + _impl_.gateway_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.gateway_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_gateway().empty()) { + _this->_impl_.gateway_.Set(from._internal_gateway(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_meta()) { + _this->_impl_.meta_ = new ::uxcontrol::MetaHeader(*from._impl_.meta_); + } + _this->_impl_.prefix_ = from._impl_.prefix_; + // @@protoc_insertion_point(copy_constructor:uxcontrol.RouteMessage) } -inline void ReqMeta::SharedCtor( +inline void RouteMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.kind_){} + decltype(_impl_.address_){} + , decltype(_impl_.gateway_){} + , decltype(_impl_.meta_){nullptr} + , decltype(_impl_.prefix_){uint64_t{0u}} , /*decltype(_impl_._cached_size_)*/{} }; - _impl_.kind_.InitDefault(); + _impl_.address_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.kind_.Set("", GetArenaForAllocation()); + _impl_.address_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.gateway_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.gateway_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ReqMeta::~ReqMeta() { - // @@protoc_insertion_point(destructor:uxcontrol.ReqMeta) +RouteMessage::~RouteMessage() { + // @@protoc_insertion_point(destructor:uxcontrol.RouteMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -1232,38 +1204,72 @@ ReqMeta::~ReqMeta() { SharedDtor(); } -inline void ReqMeta::SharedDtor() { +inline void RouteMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.kind_.Destroy(); + _impl_.address_.Destroy(); + _impl_.gateway_.Destroy(); + if (this != internal_default_instance()) delete _impl_.meta_; } -void ReqMeta::SetCachedSize(int size) const { +void RouteMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ReqMeta::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.ReqMeta) +void RouteMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:uxcontrol.RouteMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.kind_.ClearToEmpty(); + _impl_.address_.ClearToEmpty(); + _impl_.gateway_.ClearToEmpty(); + if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { + delete _impl_.meta_; + } + _impl_.meta_ = nullptr; + _impl_.prefix_ = uint64_t{0u}; _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ReqMeta::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* RouteMessage::_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; + // .uxcontrol.MetaHeader meta = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_kind(); + ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string address = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_address(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.ReqMeta.kind")); + CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.RouteMessage.address")); + } else + goto handle_unusual; + continue; + // uint64 prefix = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.prefix_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string gateway = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + auto str = _internal_mutable_gateway(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.RouteMessage.gateway")); } else goto handle_unusual; continue; @@ -1290,92 +1296,154 @@ failure: #undef CHK_ } -uint8_t* ReqMeta::_InternalSerialize( +uint8_t* RouteMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.ReqMeta) + // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.RouteMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // string kind = 1; - if (!this->_internal_kind().empty()) { + // .uxcontrol.MetaHeader 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 address = 2; + if (!this->_internal_address().empty()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_kind().data(), static_cast(this->_internal_kind().length()), + this->_internal_address().data(), static_cast(this->_internal_address().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "uxcontrol.ReqMeta.kind"); + "uxcontrol.RouteMessage.address"); target = stream->WriteStringMaybeAliased( - 1, this->_internal_kind(), target); + 2, this->_internal_address(), target); + } + + // uint64 prefix = 3; + if (this->_internal_prefix() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_prefix(), target); + } + + // string gateway = 4; + if (!this->_internal_gateway().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_gateway().data(), static_cast(this->_internal_gateway().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "uxcontrol.RouteMessage.gateway"); + target = stream->WriteStringMaybeAliased( + 4, this->_internal_gateway(), 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:uxcontrol.ReqMeta) + // @@protoc_insertion_point(serialize_to_array_end:uxcontrol.RouteMessage) return target; } -size_t ReqMeta::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.ReqMeta) +size_t RouteMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:uxcontrol.RouteMessage) 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()) { + // string address = 2; + if (!this->_internal_address().empty()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_kind()); + this->_internal_address()); + } + + // string gateway = 4; + if (!this->_internal_gateway().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_gateway()); + } + + // .uxcontrol.MetaHeader meta = 1; + if (this->_internal_has_meta()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.meta_); + } + + // uint64 prefix = 3; + if (this->_internal_prefix() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_prefix()); } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ReqMeta::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData RouteMessage::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - ReqMeta::MergeImpl + RouteMessage::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ReqMeta::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*RouteMessage::GetClassData() const { return &_class_data_; } -void ReqMeta::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.ReqMeta) +void RouteMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.RouteMessage) 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()); + if (!from._internal_address().empty()) { + _this->_internal_set_address(from._internal_address()); + } + if (!from._internal_gateway().empty()) { + _this->_internal_set_gateway(from._internal_gateway()); + } + if (from._internal_has_meta()) { + _this->_internal_mutable_meta()->::uxcontrol::MetaHeader::MergeFrom( + from._internal_meta()); + } + if (from._internal_prefix() != 0) { + _this->_internal_set_prefix(from._internal_prefix()); } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void ReqMeta::CopyFrom(const ReqMeta& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.ReqMeta) +void RouteMessage::CopyFrom(const RouteMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.RouteMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ReqMeta::IsInitialized() const { +bool RouteMessage::IsInitialized() const { return true; } -void ReqMeta::InternalSwap(ReqMeta* other) { +void RouteMessage::InternalSwap(RouteMessage* 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 + &_impl_.address_, lhs_arena, + &other->_impl_.address_, rhs_arena ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.gateway_, lhs_arena, + &other->_impl_.gateway_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(RouteMessage, _impl_.prefix_) + + sizeof(RouteMessage::_impl_.prefix_) + - PROTOBUF_FIELD_OFFSET(RouteMessage, _impl_.meta_)>( + reinterpret_cast(&_impl_.meta_), + reinterpret_cast(&other->_impl_.meta_)); } -::PROTOBUF_NAMESPACE_ID::Metadata ReqMeta::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata RouteMessage::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, file_level_metadata_uxcontrol_2eproto[4]); @@ -1383,22 +1451,27 @@ void ReqMeta::InternalSwap(ReqMeta* other) { // =================================================================== -class ResMeta::_Internal { +class HelloMessage::_Internal { public: + static const ::uxcontrol::MetaHeader& meta(const HelloMessage* msg); }; -ResMeta::ResMeta(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::uxcontrol::MetaHeader& +HelloMessage::_Internal::meta(const HelloMessage* msg) { + return *msg->_impl_.meta_; +} +HelloMessage::HelloMessage(::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:uxcontrol.ResMeta) + // @@protoc_insertion_point(arena_constructor:uxcontrol.HelloMessage) } -ResMeta::ResMeta(const ResMeta& from) +HelloMessage::HelloMessage(const HelloMessage& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - ResMeta* const _this = this; (void)_this; + HelloMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.message_){} - , decltype(_impl_.error_){} + , decltype(_impl_.meta_){nullptr} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -1410,17 +1483,19 @@ ResMeta::ResMeta(const ResMeta& from) _this->_impl_.message_.Set(from._internal_message(), _this->GetArenaForAllocation()); } - _this->_impl_.error_ = from._impl_.error_; - // @@protoc_insertion_point(copy_constructor:uxcontrol.ResMeta) + if (from._internal_has_meta()) { + _this->_impl_.meta_ = new ::uxcontrol::MetaHeader(*from._impl_.meta_); + } + // @@protoc_insertion_point(copy_constructor:uxcontrol.HelloMessage) } -inline void ResMeta::SharedCtor( +inline void HelloMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_.message_){} - , decltype(_impl_.error_){false} + , decltype(_impl_.meta_){nullptr} , /*decltype(_impl_._cached_size_)*/{} }; _impl_.message_.InitDefault(); @@ -1429,8 +1504,8 @@ inline void ResMeta::SharedCtor( #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ResMeta::~ResMeta() { - // @@protoc_insertion_point(destructor:uxcontrol.ResMeta) +HelloMessage::~HelloMessage() { + // @@protoc_insertion_point(destructor:uxcontrol.HelloMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -1438,36 +1513,40 @@ ResMeta::~ResMeta() { SharedDtor(); } -inline void ResMeta::SharedDtor() { +inline void HelloMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.message_.Destroy(); + if (this != internal_default_instance()) delete _impl_.meta_; } -void ResMeta::SetCachedSize(int size) const { +void HelloMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ResMeta::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.ResMeta) +void HelloMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:uxcontrol.HelloMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; _impl_.message_.ClearToEmpty(); - _impl_.error_ = false; + if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { + delete _impl_.meta_; + } + _impl_.meta_ = nullptr; _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ResMeta::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* HelloMessage::_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) { - // bool error = 1; + // .uxcontrol.MetaHeader meta = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.error_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr); CHK_(ptr); } else goto handle_unusual; @@ -1478,7 +1557,7 @@ const char* ResMeta::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) auto str = _internal_mutable_message(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.ResMeta.message")); + CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.HelloMessage.message")); } else goto handle_unusual; continue; @@ -1505,16 +1584,17 @@ failure: #undef CHK_ } -uint8_t* ResMeta::_InternalSerialize( +uint8_t* HelloMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.ResMeta) + // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.HelloMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // bool error = 1; - if (this->_internal_error() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_error(), target); + // .uxcontrol.MetaHeader 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 message = 2; @@ -1522,7 +1602,7 @@ uint8_t* ResMeta::_InternalSerialize( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_message().data(), static_cast(this->_internal_message().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "uxcontrol.ResMeta.message"); + "uxcontrol.HelloMessage.message"); target = stream->WriteStringMaybeAliased( 2, this->_internal_message(), target); } @@ -1531,12 +1611,12 @@ uint8_t* ResMeta::_InternalSerialize( 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:uxcontrol.ResMeta) + // @@protoc_insertion_point(serialize_to_array_end:uxcontrol.HelloMessage) return target; } -size_t ResMeta::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.ResMeta) +size_t HelloMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:uxcontrol.HelloMessage) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -1550,25 +1630,27 @@ size_t ResMeta::ByteSizeLong() const { this->_internal_message()); } - // bool error = 1; - if (this->_internal_error() != 0) { - total_size += 1 + 1; + // .uxcontrol.MetaHeader 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 ResMeta::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData HelloMessage::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - ResMeta::MergeImpl + HelloMessage::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ResMeta::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HelloMessage::GetClassData() const { return &_class_data_; } -void ResMeta::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.ResMeta) +void HelloMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.HelloMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -1576,24 +1658,25 @@ void ResMeta::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOB if (!from._internal_message().empty()) { _this->_internal_set_message(from._internal_message()); } - if (from._internal_error() != 0) { - _this->_internal_set_error(from._internal_error()); + if (from._internal_has_meta()) { + _this->_internal_mutable_meta()->::uxcontrol::MetaHeader::MergeFrom( + from._internal_meta()); } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void ResMeta::CopyFrom(const ResMeta& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.ResMeta) +void HelloMessage::CopyFrom(const HelloMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.HelloMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ResMeta::IsInitialized() const { +bool HelloMessage::IsInitialized() const { return true; } -void ResMeta::InternalSwap(ResMeta* other) { +void HelloMessage::InternalSwap(HelloMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); @@ -1602,933 +1685,41 @@ void ResMeta::InternalSwap(ResMeta* other) { &_impl_.message_, lhs_arena, &other->_impl_.message_, rhs_arena ); - swap(_impl_.error_, other->_impl_.error_); + swap(_impl_.meta_, other->_impl_.meta_); } -::PROTOBUF_NAMESPACE_ID::Metadata ResMeta::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata HelloMessage::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, file_level_metadata_uxcontrol_2eproto[5]); } -// =================================================================== - -class Request::_Internal { - public: - static const ::uxcontrol::ReqMeta& meta(const Request* msg); -}; - -const ::uxcontrol::ReqMeta& -Request::_Internal::meta(const Request* msg) { - return *msg->_impl_.meta_; -} -Request::Request(::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:uxcontrol.Request) -} -Request::Request(const Request& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - Request* 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 ::uxcontrol::ReqMeta(*from._impl_.meta_); - } - // @@protoc_insertion_point(copy_constructor:uxcontrol.Request) -} - -inline void Request::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_)*/{} - }; -} - -Request::~Request() { - // @@protoc_insertion_point(destructor:uxcontrol.Request) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void Request::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.meta_; -} - -void Request::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void Request::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.Request) - 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* Request::_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) { - // .uxcontrol.ReqMeta meta = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(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* Request::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.Request) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // .uxcontrol.ReqMeta 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:uxcontrol.Request) - return target; -} - -size_t Request::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.Request) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .uxcontrol.ReqMeta 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 Request::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Request::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Request::GetClassData() const { return &_class_data_; } - - -void Request::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.Request) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_has_meta()) { - _this->_internal_mutable_meta()->::uxcontrol::ReqMeta::MergeFrom( - from._internal_meta()); - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Request::CopyFrom(const Request& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.Request) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Request::IsInitialized() const { - return true; -} - -void Request::InternalSwap(Request* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.meta_, other->_impl_.meta_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Request::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, - file_level_metadata_uxcontrol_2eproto[6]); -} - -// =================================================================== - -class Result::_Internal { - public: - static const ::uxcontrol::ResMeta& meta(const Result* msg); -}; - -const ::uxcontrol::ResMeta& -Result::_Internal::meta(const Result* msg) { - return *msg->_impl_.meta_; -} -Result::Result(::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:uxcontrol.Result) -} -Result::Result(const Result& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - Result* 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 ::uxcontrol::ResMeta(*from._impl_.meta_); - } - // @@protoc_insertion_point(copy_constructor:uxcontrol.Result) -} - -inline void Result::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_)*/{} - }; -} - -Result::~Result() { - // @@protoc_insertion_point(destructor:uxcontrol.Result) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void Result::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.meta_; -} - -void Result::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void Result::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.Result) - 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* Result::_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) { - // .uxcontrol.ResMeta meta = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(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* Result::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.Result) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // .uxcontrol.ResMeta 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:uxcontrol.Result) - return target; -} - -size_t Result::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.Result) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .uxcontrol.ResMeta 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 Result::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Result::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Result::GetClassData() const { return &_class_data_; } - - -void Result::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.Result) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_has_meta()) { - _this->_internal_mutable_meta()->::uxcontrol::ResMeta::MergeFrom( - from._internal_meta()); - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Result::CopyFrom(const Result& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.Result) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Result::IsInitialized() const { - return true; -} - -void Result::InternalSwap(Result* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.meta_, other->_impl_.meta_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Result::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, - file_level_metadata_uxcontrol_2eproto[7]); -} - -// =================================================================== - -class HelloRequest::_Internal { - public: - static const ::uxcontrol::ReqMeta& meta(const HelloRequest* msg); -}; - -const ::uxcontrol::ReqMeta& -HelloRequest::_Internal::meta(const HelloRequest* msg) { - return *msg->_impl_.meta_; -} -HelloRequest::HelloRequest(::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:uxcontrol.HelloRequest) -} -HelloRequest::HelloRequest(const HelloRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - HelloRequest* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.message_){} - , decltype(_impl_.meta_){nullptr} - , /*decltype(_impl_._cached_size_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.message_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.message_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_message().empty()) { - _this->_impl_.message_.Set(from._internal_message(), - _this->GetArenaForAllocation()); - } - if (from._internal_has_meta()) { - _this->_impl_.meta_ = new ::uxcontrol::ReqMeta(*from._impl_.meta_); - } - // @@protoc_insertion_point(copy_constructor:uxcontrol.HelloRequest) -} - -inline void HelloRequest::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.message_){} - , decltype(_impl_.meta_){nullptr} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.message_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.message_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -HelloRequest::~HelloRequest() { - // @@protoc_insertion_point(destructor:uxcontrol.HelloRequest) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void HelloRequest::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.message_.Destroy(); - if (this != internal_default_instance()) delete _impl_.meta_; -} - -void HelloRequest::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void HelloRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.HelloRequest) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.message_.ClearToEmpty(); - if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { - delete _impl_.meta_; - } - _impl_.meta_ = nullptr; - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* HelloRequest::_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) { - // .uxcontrol.ReqMeta meta = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // string message = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_message(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.HelloRequest.message")); - } 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* HelloRequest::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.HelloRequest) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // .uxcontrol.ReqMeta 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 message = 2; - if (!this->_internal_message().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_message().data(), static_cast(this->_internal_message().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "uxcontrol.HelloRequest.message"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_message(), 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:uxcontrol.HelloRequest) - return target; -} - -size_t HelloRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.HelloRequest) - 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 message = 2; - if (!this->_internal_message().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_message()); - } - - // .uxcontrol.ReqMeta 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 HelloRequest::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - HelloRequest::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HelloRequest::GetClassData() const { return &_class_data_; } - - -void HelloRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.HelloRequest) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_message().empty()) { - _this->_internal_set_message(from._internal_message()); - } - if (from._internal_has_meta()) { - _this->_internal_mutable_meta()->::uxcontrol::ReqMeta::MergeFrom( - from._internal_meta()); - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void HelloRequest::CopyFrom(const HelloRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.HelloRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool HelloRequest::IsInitialized() const { - return true; -} - -void HelloRequest::InternalSwap(HelloRequest* 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_.message_, lhs_arena, - &other->_impl_.message_, rhs_arena - ); - swap(_impl_.meta_, other->_impl_.meta_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata HelloRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, - file_level_metadata_uxcontrol_2eproto[8]); -} - -// =================================================================== - -class HelloResult::_Internal { - public: - static const ::uxcontrol::ResMeta& meta(const HelloResult* msg); -}; - -const ::uxcontrol::ResMeta& -HelloResult::_Internal::meta(const HelloResult* msg) { - return *msg->_impl_.meta_; -} -HelloResult::HelloResult(::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:uxcontrol.HelloResult) -} -HelloResult::HelloResult(const HelloResult& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - HelloResult* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.message_){} - , decltype(_impl_.meta_){nullptr} - , /*decltype(_impl_._cached_size_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.message_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.message_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_message().empty()) { - _this->_impl_.message_.Set(from._internal_message(), - _this->GetArenaForAllocation()); - } - if (from._internal_has_meta()) { - _this->_impl_.meta_ = new ::uxcontrol::ResMeta(*from._impl_.meta_); - } - // @@protoc_insertion_point(copy_constructor:uxcontrol.HelloResult) -} - -inline void HelloResult::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.message_){} - , decltype(_impl_.meta_){nullptr} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.message_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.message_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -HelloResult::~HelloResult() { - // @@protoc_insertion_point(destructor:uxcontrol.HelloResult) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void HelloResult::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.message_.Destroy(); - if (this != internal_default_instance()) delete _impl_.meta_; -} - -void HelloResult::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void HelloResult::Clear() { -// @@protoc_insertion_point(message_clear_start:uxcontrol.HelloResult) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.message_.ClearToEmpty(); - if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { - delete _impl_.meta_; - } - _impl_.meta_ = nullptr; - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* HelloResult::_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) { - // .uxcontrol.ResMeta meta = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_meta(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // string message = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_message(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "uxcontrol.HelloResult.message")); - } 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* HelloResult::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:uxcontrol.HelloResult) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // .uxcontrol.ResMeta 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 message = 2; - if (!this->_internal_message().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_message().data(), static_cast(this->_internal_message().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "uxcontrol.HelloResult.message"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_message(), 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:uxcontrol.HelloResult) - return target; -} - -size_t HelloResult::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:uxcontrol.HelloResult) - 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 message = 2; - if (!this->_internal_message().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_message()); - } - - // .uxcontrol.ResMeta 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 HelloResult::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - HelloResult::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HelloResult::GetClassData() const { return &_class_data_; } - - -void HelloResult::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:uxcontrol.HelloResult) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_message().empty()) { - _this->_internal_set_message(from._internal_message()); - } - if (from._internal_has_meta()) { - _this->_internal_mutable_meta()->::uxcontrol::ResMeta::MergeFrom( - from._internal_meta()); - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void HelloResult::CopyFrom(const HelloResult& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:uxcontrol.HelloResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool HelloResult::IsInitialized() const { - return true; -} - -void HelloResult::InternalSwap(HelloResult* 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_.message_, lhs_arena, - &other->_impl_.message_, rhs_arena - ); - swap(_impl_.meta_, other->_impl_.meta_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata HelloResult::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_uxcontrol_2eproto_getter, &descriptor_table_uxcontrol_2eproto_once, - file_level_metadata_uxcontrol_2eproto[9]); -} - // @@protoc_insertion_point(namespace_scope) } // namespace uxcontrol PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::uxcontrol::MsgMeta* -Arena::CreateMaybeMessage< ::uxcontrol::MsgMeta >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::MsgMeta >(arena); +template<> PROTOBUF_NOINLINE ::uxcontrol::MetaHeader* +Arena::CreateMaybeMessage< ::uxcontrol::MetaHeader >(Arena* arena) { + return Arena::CreateMessageInternal< ::uxcontrol::MetaHeader >(arena); } -template<> PROTOBUF_NOINLINE ::uxcontrol::Message* -Arena::CreateMaybeMessage< ::uxcontrol::Message >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::Message >(arena); +template<> PROTOBUF_NOINLINE ::uxcontrol::SimpleMessage* +Arena::CreateMaybeMessage< ::uxcontrol::SimpleMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::uxcontrol::SimpleMessage >(arena); } -template<> PROTOBUF_NOINLINE ::uxcontrol::InternetPacket* -Arena::CreateMaybeMessage< ::uxcontrol::InternetPacket >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::InternetPacket >(arena); +template<> PROTOBUF_NOINLINE ::uxcontrol::PacketMessage* +Arena::CreateMaybeMessage< ::uxcontrol::PacketMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::uxcontrol::PacketMessage >(arena); } -template<> PROTOBUF_NOINLINE ::uxcontrol::HelloMsg* -Arena::CreateMaybeMessage< ::uxcontrol::HelloMsg >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::HelloMsg >(arena); +template<> PROTOBUF_NOINLINE ::uxcontrol::AddressMessage* +Arena::CreateMaybeMessage< ::uxcontrol::AddressMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::uxcontrol::AddressMessage >(arena); } -template<> PROTOBUF_NOINLINE ::uxcontrol::ReqMeta* -Arena::CreateMaybeMessage< ::uxcontrol::ReqMeta >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::ReqMeta >(arena); +template<> PROTOBUF_NOINLINE ::uxcontrol::RouteMessage* +Arena::CreateMaybeMessage< ::uxcontrol::RouteMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::uxcontrol::RouteMessage >(arena); } -template<> PROTOBUF_NOINLINE ::uxcontrol::ResMeta* -Arena::CreateMaybeMessage< ::uxcontrol::ResMeta >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::ResMeta >(arena); -} -template<> PROTOBUF_NOINLINE ::uxcontrol::Request* -Arena::CreateMaybeMessage< ::uxcontrol::Request >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::Request >(arena); -} -template<> PROTOBUF_NOINLINE ::uxcontrol::Result* -Arena::CreateMaybeMessage< ::uxcontrol::Result >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::Result >(arena); -} -template<> PROTOBUF_NOINLINE ::uxcontrol::HelloRequest* -Arena::CreateMaybeMessage< ::uxcontrol::HelloRequest >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::HelloRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::uxcontrol::HelloResult* -Arena::CreateMaybeMessage< ::uxcontrol::HelloResult >(Arena* arena) { - return Arena::CreateMessageInternal< ::uxcontrol::HelloResult >(arena); +template<> PROTOBUF_NOINLINE ::uxcontrol::HelloMessage* +Arena::CreateMaybeMessage< ::uxcontrol::HelloMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::uxcontrol::HelloMessage >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/uxcontrol.pb.h b/uxcontrol.pb.h index 8a78980..527d513 100644 --- a/uxcontrol.pb.h +++ b/uxcontrol.pb.h @@ -45,71 +45,55 @@ struct TableStruct_uxcontrol_2eproto { }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_uxcontrol_2eproto; namespace uxcontrol { -class HelloMsg; -struct HelloMsgDefaultTypeInternal; -extern HelloMsgDefaultTypeInternal _HelloMsg_default_instance_; -class HelloRequest; -struct HelloRequestDefaultTypeInternal; -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_; -class Request; -struct RequestDefaultTypeInternal; -extern RequestDefaultTypeInternal _Request_default_instance_; -class ResMeta; -struct ResMetaDefaultTypeInternal; -extern ResMetaDefaultTypeInternal _ResMeta_default_instance_; -class Result; -struct ResultDefaultTypeInternal; -extern ResultDefaultTypeInternal _Result_default_instance_; +class AddressMessage; +struct AddressMessageDefaultTypeInternal; +extern AddressMessageDefaultTypeInternal _AddressMessage_default_instance_; +class HelloMessage; +struct HelloMessageDefaultTypeInternal; +extern HelloMessageDefaultTypeInternal _HelloMessage_default_instance_; +class MetaHeader; +struct MetaHeaderDefaultTypeInternal; +extern MetaHeaderDefaultTypeInternal _MetaHeader_default_instance_; +class PacketMessage; +struct PacketMessageDefaultTypeInternal; +extern PacketMessageDefaultTypeInternal _PacketMessage_default_instance_; +class RouteMessage; +struct RouteMessageDefaultTypeInternal; +extern RouteMessageDefaultTypeInternal _RouteMessage_default_instance_; +class SimpleMessage; +struct SimpleMessageDefaultTypeInternal; +extern SimpleMessageDefaultTypeInternal _SimpleMessage_default_instance_; } // namespace uxcontrol PROTOBUF_NAMESPACE_OPEN -template<> ::uxcontrol::HelloMsg* Arena::CreateMaybeMessage<::uxcontrol::HelloMsg>(Arena*); -template<> ::uxcontrol::HelloRequest* Arena::CreateMaybeMessage<::uxcontrol::HelloRequest>(Arena*); -template<> ::uxcontrol::HelloResult* Arena::CreateMaybeMessage<::uxcontrol::HelloResult>(Arena*); -template<> ::uxcontrol::InternetPacket* Arena::CreateMaybeMessage<::uxcontrol::InternetPacket>(Arena*); -template<> ::uxcontrol::Message* Arena::CreateMaybeMessage<::uxcontrol::Message>(Arena*); -template<> ::uxcontrol::MsgMeta* Arena::CreateMaybeMessage<::uxcontrol::MsgMeta>(Arena*); -template<> ::uxcontrol::ReqMeta* Arena::CreateMaybeMessage<::uxcontrol::ReqMeta>(Arena*); -template<> ::uxcontrol::Request* Arena::CreateMaybeMessage<::uxcontrol::Request>(Arena*); -template<> ::uxcontrol::ResMeta* Arena::CreateMaybeMessage<::uxcontrol::ResMeta>(Arena*); -template<> ::uxcontrol::Result* Arena::CreateMaybeMessage<::uxcontrol::Result>(Arena*); +template<> ::uxcontrol::AddressMessage* Arena::CreateMaybeMessage<::uxcontrol::AddressMessage>(Arena*); +template<> ::uxcontrol::HelloMessage* Arena::CreateMaybeMessage<::uxcontrol::HelloMessage>(Arena*); +template<> ::uxcontrol::MetaHeader* Arena::CreateMaybeMessage<::uxcontrol::MetaHeader>(Arena*); +template<> ::uxcontrol::PacketMessage* Arena::CreateMaybeMessage<::uxcontrol::PacketMessage>(Arena*); +template<> ::uxcontrol::RouteMessage* Arena::CreateMaybeMessage<::uxcontrol::RouteMessage>(Arena*); +template<> ::uxcontrol::SimpleMessage* Arena::CreateMaybeMessage<::uxcontrol::SimpleMessage>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace uxcontrol { // =================================================================== -class MsgMeta final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.MsgMeta) */ { +class MetaHeader final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.MetaHeader) */ { public: - inline MsgMeta() : MsgMeta(nullptr) {} - ~MsgMeta() override; - explicit PROTOBUF_CONSTEXPR MsgMeta(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline MetaHeader() : MetaHeader(nullptr) {} + ~MetaHeader() override; + explicit PROTOBUF_CONSTEXPR MetaHeader(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - MsgMeta(const MsgMeta& from); - MsgMeta(MsgMeta&& from) noexcept - : MsgMeta() { + MetaHeader(const MetaHeader& from); + MetaHeader(MetaHeader&& from) noexcept + : MetaHeader() { *this = ::std::move(from); } - inline MsgMeta& operator=(const MsgMeta& from) { + inline MetaHeader& operator=(const MetaHeader& from) { CopyFrom(from); return *this; } - inline MsgMeta& operator=(MsgMeta&& from) noexcept { + inline MetaHeader& operator=(MetaHeader&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -132,20 +116,20 @@ class MsgMeta final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const MsgMeta& default_instance() { + static const MetaHeader& default_instance() { return *internal_default_instance(); } - static inline const MsgMeta* internal_default_instance() { - return reinterpret_cast( - &_MsgMeta_default_instance_); + static inline const MetaHeader* internal_default_instance() { + return reinterpret_cast( + &_MetaHeader_default_instance_); } static constexpr int kIndexInFileMessages = 0; - friend void swap(MsgMeta& a, MsgMeta& b) { + friend void swap(MetaHeader& a, MetaHeader& b) { a.Swap(&b); } - inline void Swap(MsgMeta* other) { + inline void Swap(MetaHeader* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -158,7 +142,7 @@ class MsgMeta final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(MsgMeta* other) { + void UnsafeArenaSwap(MetaHeader* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -166,14 +150,14 @@ class MsgMeta final : // implements Message ---------------------------------------------- - MsgMeta* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + MetaHeader* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const MsgMeta& from); + void CopyFrom(const MetaHeader& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const MsgMeta& from) { - MsgMeta::MergeImpl(*this, from); + void MergeFrom( const MetaHeader& from) { + MetaHeader::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -191,15 +175,15 @@ class MsgMeta final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(MsgMeta* other); + void InternalSwap(MetaHeader* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.MsgMeta"; + return "uxcontrol.MetaHeader"; } protected: - explicit MsgMeta(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit MetaHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -229,7 +213,7 @@ class MsgMeta final : std::string* _internal_mutable_kind(); public: - // @@protoc_insertion_point(class_scope:uxcontrol.MsgMeta) + // @@protoc_insertion_point(class_scope:uxcontrol.MetaHeader) private: class _Internal; @@ -245,24 +229,24 @@ class MsgMeta final : }; // ------------------------------------------------------------------- -class Message final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.Message) */ { +class SimpleMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.SimpleMessage) */ { public: - inline Message() : Message(nullptr) {} - ~Message() override; - explicit PROTOBUF_CONSTEXPR Message(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline SimpleMessage() : SimpleMessage(nullptr) {} + ~SimpleMessage() override; + explicit PROTOBUF_CONSTEXPR SimpleMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - Message(const Message& from); - Message(Message&& from) noexcept - : Message() { + SimpleMessage(const SimpleMessage& from); + SimpleMessage(SimpleMessage&& from) noexcept + : SimpleMessage() { *this = ::std::move(from); } - inline Message& operator=(const Message& from) { + inline SimpleMessage& operator=(const SimpleMessage& from) { CopyFrom(from); return *this; } - inline Message& operator=(Message&& from) noexcept { + inline SimpleMessage& operator=(SimpleMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -285,20 +269,20 @@ class Message final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Message& default_instance() { + static const SimpleMessage& default_instance() { return *internal_default_instance(); } - static inline const Message* internal_default_instance() { - return reinterpret_cast( - &_Message_default_instance_); + static inline const SimpleMessage* internal_default_instance() { + return reinterpret_cast( + &_SimpleMessage_default_instance_); } static constexpr int kIndexInFileMessages = 1; - friend void swap(Message& a, Message& b) { + friend void swap(SimpleMessage& a, SimpleMessage& b) { a.Swap(&b); } - inline void Swap(Message* other) { + inline void Swap(SimpleMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -311,7 +295,7 @@ class Message final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Message* other) { + void UnsafeArenaSwap(SimpleMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -319,14 +303,14 @@ class Message final : // implements Message ---------------------------------------------- - Message* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + SimpleMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Message& from); + void CopyFrom(const SimpleMessage& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Message& from) { - Message::MergeImpl(*this, from); + void MergeFrom( const SimpleMessage& from) { + SimpleMessage::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -344,15 +328,15 @@ class Message final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Message* other); + void InternalSwap(SimpleMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.Message"; + return "uxcontrol.SimpleMessage"; } protected: - explicit Message(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit SimpleMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -368,25 +352,25 @@ class Message final : enum : int { kMetaFieldNumber = 1, }; - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; bool has_meta() const; private: bool _internal_has_meta() const; public: void clear_meta(); - const ::uxcontrol::MsgMeta& meta() const; - PROTOBUF_NODISCARD ::uxcontrol::MsgMeta* release_meta(); - ::uxcontrol::MsgMeta* mutable_meta(); - void set_allocated_meta(::uxcontrol::MsgMeta* meta); + const ::uxcontrol::MetaHeader& meta() const; + PROTOBUF_NODISCARD ::uxcontrol::MetaHeader* release_meta(); + ::uxcontrol::MetaHeader* mutable_meta(); + void set_allocated_meta(::uxcontrol::MetaHeader* meta); private: - const ::uxcontrol::MsgMeta& _internal_meta() const; - ::uxcontrol::MsgMeta* _internal_mutable_meta(); + const ::uxcontrol::MetaHeader& _internal_meta() const; + ::uxcontrol::MetaHeader* _internal_mutable_meta(); public: void unsafe_arena_set_allocated_meta( - ::uxcontrol::MsgMeta* meta); - ::uxcontrol::MsgMeta* unsafe_arena_release_meta(); + ::uxcontrol::MetaHeader* meta); + ::uxcontrol::MetaHeader* unsafe_arena_release_meta(); - // @@protoc_insertion_point(class_scope:uxcontrol.Message) + // @@protoc_insertion_point(class_scope:uxcontrol.SimpleMessage) private: class _Internal; @@ -394,7 +378,7 @@ class Message final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::uxcontrol::MsgMeta* meta_; + ::uxcontrol::MetaHeader* meta_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -402,24 +386,24 @@ class Message final : }; // ------------------------------------------------------------------- -class InternetPacket final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.InternetPacket) */ { +class PacketMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.PacketMessage) */ { public: - inline InternetPacket() : InternetPacket(nullptr) {} - ~InternetPacket() override; - explicit PROTOBUF_CONSTEXPR InternetPacket(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PacketMessage() : PacketMessage(nullptr) {} + ~PacketMessage() override; + explicit PROTOBUF_CONSTEXPR PacketMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - InternetPacket(const InternetPacket& from); - InternetPacket(InternetPacket&& from) noexcept - : InternetPacket() { + PacketMessage(const PacketMessage& from); + PacketMessage(PacketMessage&& from) noexcept + : PacketMessage() { *this = ::std::move(from); } - inline InternetPacket& operator=(const InternetPacket& from) { + inline PacketMessage& operator=(const PacketMessage& from) { CopyFrom(from); return *this; } - inline InternetPacket& operator=(InternetPacket&& from) noexcept { + inline PacketMessage& operator=(PacketMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -442,20 +426,20 @@ class InternetPacket final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const InternetPacket& default_instance() { + static const PacketMessage& default_instance() { return *internal_default_instance(); } - static inline const InternetPacket* internal_default_instance() { - return reinterpret_cast( - &_InternetPacket_default_instance_); + static inline const PacketMessage* internal_default_instance() { + return reinterpret_cast( + &_PacketMessage_default_instance_); } static constexpr int kIndexInFileMessages = 2; - friend void swap(InternetPacket& a, InternetPacket& b) { + friend void swap(PacketMessage& a, PacketMessage& b) { a.Swap(&b); } - inline void Swap(InternetPacket* other) { + inline void Swap(PacketMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -468,7 +452,7 @@ class InternetPacket final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(InternetPacket* other) { + void UnsafeArenaSwap(PacketMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -476,14 +460,14 @@ class InternetPacket final : // implements Message ---------------------------------------------- - InternetPacket* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + PacketMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const InternetPacket& from); + void CopyFrom(const PacketMessage& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const InternetPacket& from) { - InternetPacket::MergeImpl(*this, from); + void MergeFrom( const PacketMessage& from) { + PacketMessage::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -501,15 +485,15 @@ class InternetPacket final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(InternetPacket* other); + void InternalSwap(PacketMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.InternetPacket"; + return "uxcontrol.PacketMessage"; } protected: - explicit InternetPacket(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit PacketMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -540,25 +524,25 @@ class InternetPacket final : std::string* _internal_mutable_payload(); public: - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; bool has_meta() const; private: bool _internal_has_meta() const; public: void clear_meta(); - const ::uxcontrol::MsgMeta& meta() const; - PROTOBUF_NODISCARD ::uxcontrol::MsgMeta* release_meta(); - ::uxcontrol::MsgMeta* mutable_meta(); - void set_allocated_meta(::uxcontrol::MsgMeta* meta); + const ::uxcontrol::MetaHeader& meta() const; + PROTOBUF_NODISCARD ::uxcontrol::MetaHeader* release_meta(); + ::uxcontrol::MetaHeader* mutable_meta(); + void set_allocated_meta(::uxcontrol::MetaHeader* meta); private: - const ::uxcontrol::MsgMeta& _internal_meta() const; - ::uxcontrol::MsgMeta* _internal_mutable_meta(); + const ::uxcontrol::MetaHeader& _internal_meta() const; + ::uxcontrol::MetaHeader* _internal_mutable_meta(); public: void unsafe_arena_set_allocated_meta( - ::uxcontrol::MsgMeta* meta); - ::uxcontrol::MsgMeta* unsafe_arena_release_meta(); + ::uxcontrol::MetaHeader* meta); + ::uxcontrol::MetaHeader* unsafe_arena_release_meta(); - // @@protoc_insertion_point(class_scope:uxcontrol.InternetPacket) + // @@protoc_insertion_point(class_scope:uxcontrol.PacketMessage) private: class _Internal; @@ -567,7 +551,7 @@ class InternetPacket final : typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr payload_; - ::uxcontrol::MsgMeta* meta_; + ::uxcontrol::MetaHeader* meta_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -575,24 +559,24 @@ class InternetPacket final : }; // ------------------------------------------------------------------- -class HelloMsg final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.HelloMsg) */ { +class AddressMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.AddressMessage) */ { public: - inline HelloMsg() : HelloMsg(nullptr) {} - ~HelloMsg() override; - explicit PROTOBUF_CONSTEXPR HelloMsg(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline AddressMessage() : AddressMessage(nullptr) {} + ~AddressMessage() override; + explicit PROTOBUF_CONSTEXPR AddressMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - HelloMsg(const HelloMsg& from); - HelloMsg(HelloMsg&& from) noexcept - : HelloMsg() { + AddressMessage(const AddressMessage& from); + AddressMessage(AddressMessage&& from) noexcept + : AddressMessage() { *this = ::std::move(from); } - inline HelloMsg& operator=(const HelloMsg& from) { + inline AddressMessage& operator=(const AddressMessage& from) { CopyFrom(from); return *this; } - inline HelloMsg& operator=(HelloMsg&& from) noexcept { + inline AddressMessage& operator=(AddressMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -615,20 +599,20 @@ class HelloMsg final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const HelloMsg& default_instance() { + static const AddressMessage& default_instance() { return *internal_default_instance(); } - static inline const HelloMsg* internal_default_instance() { - return reinterpret_cast( - &_HelloMsg_default_instance_); + static inline const AddressMessage* internal_default_instance() { + return reinterpret_cast( + &_AddressMessage_default_instance_); } static constexpr int kIndexInFileMessages = 3; - friend void swap(HelloMsg& a, HelloMsg& b) { + friend void swap(AddressMessage& a, AddressMessage& b) { a.Swap(&b); } - inline void Swap(HelloMsg* other) { + inline void Swap(AddressMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -641,7 +625,7 @@ class HelloMsg final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(HelloMsg* other) { + void UnsafeArenaSwap(AddressMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -649,14 +633,14 @@ class HelloMsg final : // implements Message ---------------------------------------------- - HelloMsg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + AddressMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const HelloMsg& from); + void CopyFrom(const AddressMessage& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const HelloMsg& from) { - HelloMsg::MergeImpl(*this, from); + void MergeFrom( const AddressMessage& from) { + AddressMessage::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -674,15 +658,15 @@ class HelloMsg final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(HelloMsg* other); + void InternalSwap(AddressMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.HelloMsg"; + return "uxcontrol.AddressMessage"; } protected: - explicit HelloMsg(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit AddressMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -696,42 +680,52 @@ class HelloMsg final : // accessors ------------------------------------------------------- enum : int { - kMessageFieldNumber = 2, + kAddressFieldNumber = 2, kMetaFieldNumber = 1, + kPrefixFieldNumber = 3, }; - // string message = 2; - void clear_message(); - const std::string& message() const; + // string address = 2; + void clear_address(); + const std::string& address() const; template - void set_message(ArgT0&& arg0, ArgT... args); - std::string* mutable_message(); - PROTOBUF_NODISCARD std::string* release_message(); - void set_allocated_message(std::string* message); + void set_address(ArgT0&& arg0, ArgT... args); + std::string* mutable_address(); + PROTOBUF_NODISCARD std::string* release_address(); + void set_allocated_address(std::string* address); private: - const std::string& _internal_message() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_message(const std::string& value); - std::string* _internal_mutable_message(); + const std::string& _internal_address() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_address(const std::string& value); + std::string* _internal_mutable_address(); public: - // .uxcontrol.MsgMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; bool has_meta() const; private: bool _internal_has_meta() const; public: void clear_meta(); - const ::uxcontrol::MsgMeta& meta() const; - PROTOBUF_NODISCARD ::uxcontrol::MsgMeta* release_meta(); - ::uxcontrol::MsgMeta* mutable_meta(); - void set_allocated_meta(::uxcontrol::MsgMeta* meta); + const ::uxcontrol::MetaHeader& meta() const; + PROTOBUF_NODISCARD ::uxcontrol::MetaHeader* release_meta(); + ::uxcontrol::MetaHeader* mutable_meta(); + void set_allocated_meta(::uxcontrol::MetaHeader* meta); private: - const ::uxcontrol::MsgMeta& _internal_meta() const; - ::uxcontrol::MsgMeta* _internal_mutable_meta(); + const ::uxcontrol::MetaHeader& _internal_meta() const; + ::uxcontrol::MetaHeader* _internal_mutable_meta(); public: void unsafe_arena_set_allocated_meta( - ::uxcontrol::MsgMeta* meta); - ::uxcontrol::MsgMeta* unsafe_arena_release_meta(); + ::uxcontrol::MetaHeader* meta); + ::uxcontrol::MetaHeader* unsafe_arena_release_meta(); - // @@protoc_insertion_point(class_scope:uxcontrol.HelloMsg) + // uint64 prefix = 3; + void clear_prefix(); + uint64_t prefix() const; + void set_prefix(uint64_t value); + private: + uint64_t _internal_prefix() const; + void _internal_set_prefix(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:uxcontrol.AddressMessage) private: class _Internal; @@ -739,8 +733,9 @@ class HelloMsg final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_; - ::uxcontrol::MsgMeta* meta_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr address_; + ::uxcontrol::MetaHeader* meta_; + uint64_t prefix_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -748,24 +743,24 @@ class HelloMsg final : }; // ------------------------------------------------------------------- -class ReqMeta final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.ReqMeta) */ { +class RouteMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.RouteMessage) */ { public: - inline ReqMeta() : ReqMeta(nullptr) {} - ~ReqMeta() override; - explicit PROTOBUF_CONSTEXPR ReqMeta(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline RouteMessage() : RouteMessage(nullptr) {} + ~RouteMessage() override; + explicit PROTOBUF_CONSTEXPR RouteMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ReqMeta(const ReqMeta& from); - ReqMeta(ReqMeta&& from) noexcept - : ReqMeta() { + RouteMessage(const RouteMessage& from); + RouteMessage(RouteMessage&& from) noexcept + : RouteMessage() { *this = ::std::move(from); } - inline ReqMeta& operator=(const ReqMeta& from) { + inline RouteMessage& operator=(const RouteMessage& from) { CopyFrom(from); return *this; } - inline ReqMeta& operator=(ReqMeta&& from) noexcept { + inline RouteMessage& operator=(RouteMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -788,20 +783,20 @@ class ReqMeta final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const ReqMeta& default_instance() { + static const RouteMessage& default_instance() { return *internal_default_instance(); } - static inline const ReqMeta* internal_default_instance() { - return reinterpret_cast( - &_ReqMeta_default_instance_); + static inline const RouteMessage* internal_default_instance() { + return reinterpret_cast( + &_RouteMessage_default_instance_); } static constexpr int kIndexInFileMessages = 4; - friend void swap(ReqMeta& a, ReqMeta& b) { + friend void swap(RouteMessage& a, RouteMessage& b) { a.Swap(&b); } - inline void Swap(ReqMeta* other) { + inline void Swap(RouteMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -814,7 +809,7 @@ class ReqMeta final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ReqMeta* other) { + void UnsafeArenaSwap(RouteMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -822,14 +817,14 @@ class ReqMeta final : // implements Message ---------------------------------------------- - ReqMeta* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + RouteMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const ReqMeta& from); + void CopyFrom(const RouteMessage& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const ReqMeta& from) { - ReqMeta::MergeImpl(*this, from); + void MergeFrom( const RouteMessage& from) { + RouteMessage::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -847,15 +842,15 @@ class ReqMeta final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(ReqMeta* other); + void InternalSwap(RouteMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.ReqMeta"; + return "uxcontrol.RouteMessage"; } protected: - explicit ReqMeta(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit RouteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -869,23 +864,67 @@ class ReqMeta final : // accessors ------------------------------------------------------- enum : int { - kKindFieldNumber = 1, + kAddressFieldNumber = 2, + kGatewayFieldNumber = 4, + kMetaFieldNumber = 1, + kPrefixFieldNumber = 3, }; - // string kind = 1; - void clear_kind(); - const std::string& kind() const; + // string address = 2; + void clear_address(); + const std::string& address() const; template - void set_kind(ArgT0&& arg0, ArgT... args); - std::string* mutable_kind(); - PROTOBUF_NODISCARD std::string* release_kind(); - void set_allocated_kind(std::string* kind); + void set_address(ArgT0&& arg0, ArgT... args); + std::string* mutable_address(); + PROTOBUF_NODISCARD std::string* release_address(); + void set_allocated_address(std::string* address); private: - const std::string& _internal_kind() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_kind(const std::string& value); - std::string* _internal_mutable_kind(); + const std::string& _internal_address() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_address(const std::string& value); + std::string* _internal_mutable_address(); public: - // @@protoc_insertion_point(class_scope:uxcontrol.ReqMeta) + // string gateway = 4; + void clear_gateway(); + const std::string& gateway() const; + template + void set_gateway(ArgT0&& arg0, ArgT... args); + std::string* mutable_gateway(); + PROTOBUF_NODISCARD std::string* release_gateway(); + void set_allocated_gateway(std::string* gateway); + private: + const std::string& _internal_gateway() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_gateway(const std::string& value); + std::string* _internal_mutable_gateway(); + public: + + // .uxcontrol.MetaHeader meta = 1; + bool has_meta() const; + private: + bool _internal_has_meta() const; + public: + void clear_meta(); + const ::uxcontrol::MetaHeader& meta() const; + PROTOBUF_NODISCARD ::uxcontrol::MetaHeader* release_meta(); + ::uxcontrol::MetaHeader* mutable_meta(); + void set_allocated_meta(::uxcontrol::MetaHeader* meta); + private: + const ::uxcontrol::MetaHeader& _internal_meta() const; + ::uxcontrol::MetaHeader* _internal_mutable_meta(); + public: + void unsafe_arena_set_allocated_meta( + ::uxcontrol::MetaHeader* meta); + ::uxcontrol::MetaHeader* unsafe_arena_release_meta(); + + // uint64 prefix = 3; + void clear_prefix(); + uint64_t prefix() const; + void set_prefix(uint64_t value); + private: + uint64_t _internal_prefix() const; + void _internal_set_prefix(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:uxcontrol.RouteMessage) private: class _Internal; @@ -893,7 +932,10 @@ class ReqMeta final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr kind_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr address_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr gateway_; + ::uxcontrol::MetaHeader* meta_; + uint64_t prefix_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -901,24 +943,24 @@ class ReqMeta final : }; // ------------------------------------------------------------------- -class ResMeta final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.ResMeta) */ { +class HelloMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.HelloMessage) */ { public: - inline ResMeta() : ResMeta(nullptr) {} - ~ResMeta() override; - explicit PROTOBUF_CONSTEXPR ResMeta(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline HelloMessage() : HelloMessage(nullptr) {} + ~HelloMessage() override; + explicit PROTOBUF_CONSTEXPR HelloMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ResMeta(const ResMeta& from); - ResMeta(ResMeta&& from) noexcept - : ResMeta() { + HelloMessage(const HelloMessage& from); + HelloMessage(HelloMessage&& from) noexcept + : HelloMessage() { *this = ::std::move(from); } - inline ResMeta& operator=(const ResMeta& from) { + inline HelloMessage& operator=(const HelloMessage& from) { CopyFrom(from); return *this; } - inline ResMeta& operator=(ResMeta&& from) noexcept { + inline HelloMessage& operator=(HelloMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -941,20 +983,20 @@ class ResMeta final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const ResMeta& default_instance() { + static const HelloMessage& default_instance() { return *internal_default_instance(); } - static inline const ResMeta* internal_default_instance() { - return reinterpret_cast( - &_ResMeta_default_instance_); + static inline const HelloMessage* internal_default_instance() { + return reinterpret_cast( + &_HelloMessage_default_instance_); } static constexpr int kIndexInFileMessages = 5; - friend void swap(ResMeta& a, ResMeta& b) { + friend void swap(HelloMessage& a, HelloMessage& b) { a.Swap(&b); } - inline void Swap(ResMeta* other) { + inline void Swap(HelloMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -967,7 +1009,7 @@ class ResMeta final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ResMeta* other) { + void UnsafeArenaSwap(HelloMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -975,14 +1017,14 @@ class ResMeta final : // implements Message ---------------------------------------------- - ResMeta* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + HelloMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const ResMeta& from); + void CopyFrom(const HelloMessage& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const ResMeta& from) { - ResMeta::MergeImpl(*this, from); + void MergeFrom( const HelloMessage& from) { + HelloMessage::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -1000,493 +1042,15 @@ class ResMeta final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(ResMeta* other); + void InternalSwap(HelloMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.ResMeta"; + return "uxcontrol.HelloMessage"; } protected: - explicit ResMeta(::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 { - kMessageFieldNumber = 2, - kErrorFieldNumber = 1, - }; - // string message = 2; - void clear_message(); - const std::string& message() const; - template - void set_message(ArgT0&& arg0, ArgT... args); - std::string* mutable_message(); - PROTOBUF_NODISCARD std::string* release_message(); - void set_allocated_message(std::string* message); - private: - const std::string& _internal_message() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_message(const std::string& value); - std::string* _internal_mutable_message(); - public: - - // bool error = 1; - void clear_error(); - bool error() const; - void set_error(bool value); - private: - bool _internal_error() const; - void _internal_set_error(bool value); - public: - - // @@protoc_insertion_point(class_scope:uxcontrol.ResMeta) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_; - bool error_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_uxcontrol_2eproto; -}; -// ------------------------------------------------------------------- - -class Request final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.Request) */ { - public: - inline Request() : Request(nullptr) {} - ~Request() override; - explicit PROTOBUF_CONSTEXPR Request(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Request(const Request& from); - Request(Request&& from) noexcept - : Request() { - *this = ::std::move(from); - } - - inline Request& operator=(const Request& from) { - CopyFrom(from); - return *this; - } - inline Request& operator=(Request&& 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 Request& default_instance() { - return *internal_default_instance(); - } - static inline const Request* internal_default_instance() { - return reinterpret_cast( - &_Request_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(Request& a, Request& b) { - a.Swap(&b); - } - inline void Swap(Request* 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(Request* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Request* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Request& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Request& from) { - Request::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(Request* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.Request"; - } - protected: - explicit Request(::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, - }; - // .uxcontrol.ReqMeta meta = 1; - bool has_meta() const; - private: - bool _internal_has_meta() const; - public: - void clear_meta(); - const ::uxcontrol::ReqMeta& meta() const; - PROTOBUF_NODISCARD ::uxcontrol::ReqMeta* release_meta(); - ::uxcontrol::ReqMeta* mutable_meta(); - void set_allocated_meta(::uxcontrol::ReqMeta* meta); - private: - const ::uxcontrol::ReqMeta& _internal_meta() const; - ::uxcontrol::ReqMeta* _internal_mutable_meta(); - public: - void unsafe_arena_set_allocated_meta( - ::uxcontrol::ReqMeta* meta); - ::uxcontrol::ReqMeta* unsafe_arena_release_meta(); - - // @@protoc_insertion_point(class_scope:uxcontrol.Request) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::uxcontrol::ReqMeta* meta_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_uxcontrol_2eproto; -}; -// ------------------------------------------------------------------- - -class Result final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.Result) */ { - public: - inline Result() : Result(nullptr) {} - ~Result() override; - explicit PROTOBUF_CONSTEXPR Result(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Result(const Result& from); - Result(Result&& from) noexcept - : Result() { - *this = ::std::move(from); - } - - inline Result& operator=(const Result& from) { - CopyFrom(from); - return *this; - } - inline Result& operator=(Result&& 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 Result& default_instance() { - return *internal_default_instance(); - } - static inline const Result* internal_default_instance() { - return reinterpret_cast( - &_Result_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(Result& a, Result& b) { - a.Swap(&b); - } - inline void Swap(Result* 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(Result* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Result* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Result& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Result& from) { - Result::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(Result* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.Result"; - } - protected: - explicit Result(::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, - }; - // .uxcontrol.ResMeta meta = 1; - bool has_meta() const; - private: - bool _internal_has_meta() const; - public: - void clear_meta(); - const ::uxcontrol::ResMeta& meta() const; - PROTOBUF_NODISCARD ::uxcontrol::ResMeta* release_meta(); - ::uxcontrol::ResMeta* mutable_meta(); - void set_allocated_meta(::uxcontrol::ResMeta* meta); - private: - const ::uxcontrol::ResMeta& _internal_meta() const; - ::uxcontrol::ResMeta* _internal_mutable_meta(); - public: - void unsafe_arena_set_allocated_meta( - ::uxcontrol::ResMeta* meta); - ::uxcontrol::ResMeta* unsafe_arena_release_meta(); - - // @@protoc_insertion_point(class_scope:uxcontrol.Result) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::uxcontrol::ResMeta* meta_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_uxcontrol_2eproto; -}; -// ------------------------------------------------------------------- - -class HelloRequest final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.HelloRequest) */ { - public: - inline HelloRequest() : HelloRequest(nullptr) {} - ~HelloRequest() override; - explicit PROTOBUF_CONSTEXPR HelloRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - HelloRequest(const HelloRequest& from); - HelloRequest(HelloRequest&& from) noexcept - : HelloRequest() { - *this = ::std::move(from); - } - - inline HelloRequest& operator=(const HelloRequest& from) { - CopyFrom(from); - return *this; - } - inline HelloRequest& operator=(HelloRequest&& 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 HelloRequest& default_instance() { - return *internal_default_instance(); - } - static inline const HelloRequest* internal_default_instance() { - return reinterpret_cast( - &_HelloRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(HelloRequest& a, HelloRequest& b) { - a.Swap(&b); - } - inline void Swap(HelloRequest* 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(HelloRequest* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - HelloRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const HelloRequest& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const HelloRequest& from) { - HelloRequest::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(HelloRequest* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.HelloRequest"; - } - protected: - explicit HelloRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit HelloMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1517,25 +1081,25 @@ class HelloRequest final : std::string* _internal_mutable_message(); public: - // .uxcontrol.ReqMeta meta = 1; + // .uxcontrol.MetaHeader meta = 1; bool has_meta() const; private: bool _internal_has_meta() const; public: void clear_meta(); - const ::uxcontrol::ReqMeta& meta() const; - PROTOBUF_NODISCARD ::uxcontrol::ReqMeta* release_meta(); - ::uxcontrol::ReqMeta* mutable_meta(); - void set_allocated_meta(::uxcontrol::ReqMeta* meta); + const ::uxcontrol::MetaHeader& meta() const; + PROTOBUF_NODISCARD ::uxcontrol::MetaHeader* release_meta(); + ::uxcontrol::MetaHeader* mutable_meta(); + void set_allocated_meta(::uxcontrol::MetaHeader* meta); private: - const ::uxcontrol::ReqMeta& _internal_meta() const; - ::uxcontrol::ReqMeta* _internal_mutable_meta(); + const ::uxcontrol::MetaHeader& _internal_meta() const; + ::uxcontrol::MetaHeader* _internal_mutable_meta(); public: void unsafe_arena_set_allocated_meta( - ::uxcontrol::ReqMeta* meta); - ::uxcontrol::ReqMeta* unsafe_arena_release_meta(); + ::uxcontrol::MetaHeader* meta); + ::uxcontrol::MetaHeader* unsafe_arena_release_meta(); - // @@protoc_insertion_point(class_scope:uxcontrol.HelloRequest) + // @@protoc_insertion_point(class_scope:uxcontrol.HelloMessage) private: class _Internal; @@ -1544,180 +1108,7 @@ class HelloRequest final : typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_; - ::uxcontrol::ReqMeta* meta_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_uxcontrol_2eproto; -}; -// ------------------------------------------------------------------- - -class HelloResult final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:uxcontrol.HelloResult) */ { - public: - inline HelloResult() : HelloResult(nullptr) {} - ~HelloResult() override; - explicit PROTOBUF_CONSTEXPR HelloResult(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - HelloResult(const HelloResult& from); - HelloResult(HelloResult&& from) noexcept - : HelloResult() { - *this = ::std::move(from); - } - - inline HelloResult& operator=(const HelloResult& from) { - CopyFrom(from); - return *this; - } - inline HelloResult& operator=(HelloResult&& 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 HelloResult& default_instance() { - return *internal_default_instance(); - } - static inline const HelloResult* internal_default_instance() { - return reinterpret_cast( - &_HelloResult_default_instance_); - } - static constexpr int kIndexInFileMessages = - 9; - - friend void swap(HelloResult& a, HelloResult& b) { - a.Swap(&b); - } - inline void Swap(HelloResult* 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(HelloResult* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - HelloResult* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const HelloResult& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const HelloResult& from) { - HelloResult::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(HelloResult* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "uxcontrol.HelloResult"; - } - protected: - explicit HelloResult(::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 { - kMessageFieldNumber = 2, - kMetaFieldNumber = 1, - }; - // string message = 2; - void clear_message(); - const std::string& message() const; - template - void set_message(ArgT0&& arg0, ArgT... args); - std::string* mutable_message(); - PROTOBUF_NODISCARD std::string* release_message(); - void set_allocated_message(std::string* message); - private: - const std::string& _internal_message() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_message(const std::string& value); - std::string* _internal_mutable_message(); - public: - - // .uxcontrol.ResMeta meta = 1; - bool has_meta() const; - private: - bool _internal_has_meta() const; - public: - void clear_meta(); - const ::uxcontrol::ResMeta& meta() const; - PROTOBUF_NODISCARD ::uxcontrol::ResMeta* release_meta(); - ::uxcontrol::ResMeta* mutable_meta(); - void set_allocated_meta(::uxcontrol::ResMeta* meta); - private: - const ::uxcontrol::ResMeta& _internal_meta() const; - ::uxcontrol::ResMeta* _internal_mutable_meta(); - public: - void unsafe_arena_set_allocated_meta( - ::uxcontrol::ResMeta* meta); - ::uxcontrol::ResMeta* unsafe_arena_release_meta(); - - // @@protoc_insertion_point(class_scope:uxcontrol.HelloResult) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_; - ::uxcontrol::ResMeta* meta_; + ::uxcontrol::MetaHeader* meta_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -1732,44 +1123,44 @@ class HelloResult final : #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ -// MsgMeta +// MetaHeader // string kind = 1; -inline void MsgMeta::clear_kind() { +inline void MetaHeader::clear_kind() { _impl_.kind_.ClearToEmpty(); } -inline const std::string& MsgMeta::kind() const { - // @@protoc_insertion_point(field_get:uxcontrol.MsgMeta.kind) +inline const std::string& MetaHeader::kind() const { + // @@protoc_insertion_point(field_get:uxcontrol.MetaHeader.kind) return _internal_kind(); } template inline PROTOBUF_ALWAYS_INLINE -void MsgMeta::set_kind(ArgT0&& arg0, ArgT... args) { +void MetaHeader::set_kind(ArgT0&& arg0, ArgT... args) { _impl_.kind_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:uxcontrol.MsgMeta.kind) + // @@protoc_insertion_point(field_set:uxcontrol.MetaHeader.kind) } -inline std::string* MsgMeta::mutable_kind() { +inline std::string* MetaHeader::mutable_kind() { std::string* _s = _internal_mutable_kind(); - // @@protoc_insertion_point(field_mutable:uxcontrol.MsgMeta.kind) + // @@protoc_insertion_point(field_mutable:uxcontrol.MetaHeader.kind) return _s; } -inline const std::string& MsgMeta::_internal_kind() const { +inline const std::string& MetaHeader::_internal_kind() const { return _impl_.kind_.Get(); } -inline void MsgMeta::_internal_set_kind(const std::string& value) { +inline void MetaHeader::_internal_set_kind(const std::string& value) { _impl_.kind_.Set(value, GetArenaForAllocation()); } -inline std::string* MsgMeta::_internal_mutable_kind() { +inline std::string* MetaHeader::_internal_mutable_kind() { return _impl_.kind_.Mutable(GetArenaForAllocation()); } -inline std::string* MsgMeta::release_kind() { - // @@protoc_insertion_point(field_release:uxcontrol.MsgMeta.kind) +inline std::string* MetaHeader::release_kind() { + // @@protoc_insertion_point(field_release:uxcontrol.MetaHeader.kind) return _impl_.kind_.Release(); } -inline void MsgMeta::set_allocated_kind(std::string* kind) { +inline void MetaHeader::set_allocated_kind(std::string* kind) { if (kind != nullptr) { } else { @@ -1781,37 +1172,37 @@ inline void MsgMeta::set_allocated_kind(std::string* kind) { _impl_.kind_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:uxcontrol.MsgMeta.kind) + // @@protoc_insertion_point(field_set_allocated:uxcontrol.MetaHeader.kind) } // ------------------------------------------------------------------- -// Message +// SimpleMessage -// .uxcontrol.MsgMeta meta = 1; -inline bool Message::_internal_has_meta() const { +// .uxcontrol.MetaHeader meta = 1; +inline bool SimpleMessage::_internal_has_meta() const { return this != internal_default_instance() && _impl_.meta_ != nullptr; } -inline bool Message::has_meta() const { +inline bool SimpleMessage::has_meta() const { return _internal_has_meta(); } -inline void Message::clear_meta() { +inline void SimpleMessage::clear_meta() { if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { delete _impl_.meta_; } _impl_.meta_ = nullptr; } -inline const ::uxcontrol::MsgMeta& Message::_internal_meta() const { - const ::uxcontrol::MsgMeta* p = _impl_.meta_; - return p != nullptr ? *p : reinterpret_cast( - ::uxcontrol::_MsgMeta_default_instance_); +inline const ::uxcontrol::MetaHeader& SimpleMessage::_internal_meta() const { + const ::uxcontrol::MetaHeader* p = _impl_.meta_; + return p != nullptr ? *p : reinterpret_cast( + ::uxcontrol::_MetaHeader_default_instance_); } -inline const ::uxcontrol::MsgMeta& Message::meta() const { - // @@protoc_insertion_point(field_get:uxcontrol.Message.meta) +inline const ::uxcontrol::MetaHeader& SimpleMessage::meta() const { + // @@protoc_insertion_point(field_get:uxcontrol.SimpleMessage.meta) return _internal_meta(); } -inline void Message::unsafe_arena_set_allocated_meta( - ::uxcontrol::MsgMeta* meta) { +inline void SimpleMessage::unsafe_arena_set_allocated_meta( + ::uxcontrol::MetaHeader* meta) { if (GetArenaForAllocation() == nullptr) { delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.meta_); } @@ -1821,11 +1212,11 @@ inline void Message::unsafe_arena_set_allocated_meta( } else { } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:uxcontrol.Message.meta) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:uxcontrol.SimpleMessage.meta) } -inline ::uxcontrol::MsgMeta* Message::release_meta() { +inline ::uxcontrol::MetaHeader* SimpleMessage::release_meta() { - ::uxcontrol::MsgMeta* temp = _impl_.meta_; + ::uxcontrol::MetaHeader* temp = _impl_.meta_; _impl_.meta_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); @@ -1838,27 +1229,27 @@ inline ::uxcontrol::MsgMeta* Message::release_meta() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::uxcontrol::MsgMeta* Message::unsafe_arena_release_meta() { - // @@protoc_insertion_point(field_release:uxcontrol.Message.meta) +inline ::uxcontrol::MetaHeader* SimpleMessage::unsafe_arena_release_meta() { + // @@protoc_insertion_point(field_release:uxcontrol.SimpleMessage.meta) - ::uxcontrol::MsgMeta* temp = _impl_.meta_; + ::uxcontrol::MetaHeader* temp = _impl_.meta_; _impl_.meta_ = nullptr; return temp; } -inline ::uxcontrol::MsgMeta* Message::_internal_mutable_meta() { +inline ::uxcontrol::MetaHeader* SimpleMessage::_internal_mutable_meta() { if (_impl_.meta_ == nullptr) { - auto* p = CreateMaybeMessage<::uxcontrol::MsgMeta>(GetArenaForAllocation()); + auto* p = CreateMaybeMessage<::uxcontrol::MetaHeader>(GetArenaForAllocation()); _impl_.meta_ = p; } return _impl_.meta_; } -inline ::uxcontrol::MsgMeta* Message::mutable_meta() { - ::uxcontrol::MsgMeta* _msg = _internal_mutable_meta(); - // @@protoc_insertion_point(field_mutable:uxcontrol.Message.meta) +inline ::uxcontrol::MetaHeader* SimpleMessage::mutable_meta() { + ::uxcontrol::MetaHeader* _msg = _internal_mutable_meta(); + // @@protoc_insertion_point(field_mutable:uxcontrol.SimpleMessage.meta) return _msg; } -inline void Message::set_allocated_meta(::uxcontrol::MsgMeta* meta) { +inline void SimpleMessage::set_allocated_meta(::uxcontrol::MetaHeader* meta) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { delete _impl_.meta_; @@ -1875,37 +1266,37 @@ inline void Message::set_allocated_meta(::uxcontrol::MsgMeta* meta) { } _impl_.meta_ = meta; - // @@protoc_insertion_point(field_set_allocated:uxcontrol.Message.meta) + // @@protoc_insertion_point(field_set_allocated:uxcontrol.SimpleMessage.meta) } // ------------------------------------------------------------------- -// InternetPacket +// PacketMessage -// .uxcontrol.MsgMeta meta = 1; -inline bool InternetPacket::_internal_has_meta() const { +// .uxcontrol.MetaHeader meta = 1; +inline bool PacketMessage::_internal_has_meta() const { return this != internal_default_instance() && _impl_.meta_ != nullptr; } -inline bool InternetPacket::has_meta() const { +inline bool PacketMessage::has_meta() const { return _internal_has_meta(); } -inline void InternetPacket::clear_meta() { +inline void PacketMessage::clear_meta() { if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { delete _impl_.meta_; } _impl_.meta_ = nullptr; } -inline const ::uxcontrol::MsgMeta& InternetPacket::_internal_meta() const { - const ::uxcontrol::MsgMeta* p = _impl_.meta_; - return p != nullptr ? *p : reinterpret_cast( - ::uxcontrol::_MsgMeta_default_instance_); +inline const ::uxcontrol::MetaHeader& PacketMessage::_internal_meta() const { + const ::uxcontrol::MetaHeader* p = _impl_.meta_; + return p != nullptr ? *p : reinterpret_cast( + ::uxcontrol::_MetaHeader_default_instance_); } -inline const ::uxcontrol::MsgMeta& InternetPacket::meta() const { - // @@protoc_insertion_point(field_get:uxcontrol.InternetPacket.meta) +inline const ::uxcontrol::MetaHeader& PacketMessage::meta() const { + // @@protoc_insertion_point(field_get:uxcontrol.PacketMessage.meta) return _internal_meta(); } -inline void InternetPacket::unsafe_arena_set_allocated_meta( - ::uxcontrol::MsgMeta* meta) { +inline void PacketMessage::unsafe_arena_set_allocated_meta( + ::uxcontrol::MetaHeader* meta) { if (GetArenaForAllocation() == nullptr) { delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.meta_); } @@ -1915,11 +1306,11 @@ inline void InternetPacket::unsafe_arena_set_allocated_meta( } else { } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:uxcontrol.InternetPacket.meta) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:uxcontrol.PacketMessage.meta) } -inline ::uxcontrol::MsgMeta* InternetPacket::release_meta() { +inline ::uxcontrol::MetaHeader* PacketMessage::release_meta() { - ::uxcontrol::MsgMeta* temp = _impl_.meta_; + ::uxcontrol::MetaHeader* temp = _impl_.meta_; _impl_.meta_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); @@ -1932,27 +1323,27 @@ inline ::uxcontrol::MsgMeta* InternetPacket::release_meta() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::uxcontrol::MsgMeta* InternetPacket::unsafe_arena_release_meta() { - // @@protoc_insertion_point(field_release:uxcontrol.InternetPacket.meta) +inline ::uxcontrol::MetaHeader* PacketMessage::unsafe_arena_release_meta() { + // @@protoc_insertion_point(field_release:uxcontrol.PacketMessage.meta) - ::uxcontrol::MsgMeta* temp = _impl_.meta_; + ::uxcontrol::MetaHeader* temp = _impl_.meta_; _impl_.meta_ = nullptr; return temp; } -inline ::uxcontrol::MsgMeta* InternetPacket::_internal_mutable_meta() { +inline ::uxcontrol::MetaHeader* PacketMessage::_internal_mutable_meta() { if (_impl_.meta_ == nullptr) { - auto* p = CreateMaybeMessage<::uxcontrol::MsgMeta>(GetArenaForAllocation()); + auto* p = CreateMaybeMessage<::uxcontrol::MetaHeader>(GetArenaForAllocation()); _impl_.meta_ = p; } return _impl_.meta_; } -inline ::uxcontrol::MsgMeta* InternetPacket::mutable_meta() { - ::uxcontrol::MsgMeta* _msg = _internal_mutable_meta(); - // @@protoc_insertion_point(field_mutable:uxcontrol.InternetPacket.meta) +inline ::uxcontrol::MetaHeader* PacketMessage::mutable_meta() { + ::uxcontrol::MetaHeader* _msg = _internal_mutable_meta(); + // @@protoc_insertion_point(field_mutable:uxcontrol.PacketMessage.meta) return _msg; } -inline void InternetPacket::set_allocated_meta(::uxcontrol::MsgMeta* meta) { +inline void PacketMessage::set_allocated_meta(::uxcontrol::MetaHeader* meta) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { delete _impl_.meta_; @@ -1969,45 +1360,45 @@ inline void InternetPacket::set_allocated_meta(::uxcontrol::MsgMeta* meta) { } _impl_.meta_ = meta; - // @@protoc_insertion_point(field_set_allocated:uxcontrol.InternetPacket.meta) + // @@protoc_insertion_point(field_set_allocated:uxcontrol.PacketMessage.meta) } // bytes payload = 2; -inline void InternetPacket::clear_payload() { +inline void PacketMessage::clear_payload() { _impl_.payload_.ClearToEmpty(); } -inline const std::string& InternetPacket::payload() const { - // @@protoc_insertion_point(field_get:uxcontrol.InternetPacket.payload) +inline const std::string& PacketMessage::payload() const { + // @@protoc_insertion_point(field_get:uxcontrol.PacketMessage.payload) return _internal_payload(); } template inline PROTOBUF_ALWAYS_INLINE -void InternetPacket::set_payload(ArgT0&& arg0, ArgT... args) { +void PacketMessage::set_payload(ArgT0&& arg0, ArgT... args) { _impl_.payload_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:uxcontrol.InternetPacket.payload) + // @@protoc_insertion_point(field_set:uxcontrol.PacketMessage.payload) } -inline std::string* InternetPacket::mutable_payload() { +inline std::string* PacketMessage::mutable_payload() { std::string* _s = _internal_mutable_payload(); - // @@protoc_insertion_point(field_mutable:uxcontrol.InternetPacket.payload) + // @@protoc_insertion_point(field_mutable:uxcontrol.PacketMessage.payload) return _s; } -inline const std::string& InternetPacket::_internal_payload() const { +inline const std::string& PacketMessage::_internal_payload() const { return _impl_.payload_.Get(); } -inline void InternetPacket::_internal_set_payload(const std::string& value) { +inline void PacketMessage::_internal_set_payload(const std::string& value) { _impl_.payload_.Set(value, GetArenaForAllocation()); } -inline std::string* InternetPacket::_internal_mutable_payload() { +inline std::string* PacketMessage::_internal_mutable_payload() { return _impl_.payload_.Mutable(GetArenaForAllocation()); } -inline std::string* InternetPacket::release_payload() { - // @@protoc_insertion_point(field_release:uxcontrol.InternetPacket.payload) +inline std::string* PacketMessage::release_payload() { + // @@protoc_insertion_point(field_release:uxcontrol.PacketMessage.payload) return _impl_.payload_.Release(); } -inline void InternetPacket::set_allocated_payload(std::string* payload) { +inline void PacketMessage::set_allocated_payload(std::string* payload) { if (payload != nullptr) { } else { @@ -2019,37 +1410,37 @@ inline void InternetPacket::set_allocated_payload(std::string* payload) { _impl_.payload_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:uxcontrol.InternetPacket.payload) + // @@protoc_insertion_point(field_set_allocated:uxcontrol.PacketMessage.payload) } // ------------------------------------------------------------------- -// HelloMsg +// AddressMessage -// .uxcontrol.MsgMeta meta = 1; -inline bool HelloMsg::_internal_has_meta() const { +// .uxcontrol.MetaHeader meta = 1; +inline bool AddressMessage::_internal_has_meta() const { return this != internal_default_instance() && _impl_.meta_ != nullptr; } -inline bool HelloMsg::has_meta() const { +inline bool AddressMessage::has_meta() const { return _internal_has_meta(); } -inline void HelloMsg::clear_meta() { +inline void AddressMessage::clear_meta() { if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { delete _impl_.meta_; } _impl_.meta_ = nullptr; } -inline const ::uxcontrol::MsgMeta& HelloMsg::_internal_meta() const { - const ::uxcontrol::MsgMeta* p = _impl_.meta_; - return p != nullptr ? *p : reinterpret_cast( - ::uxcontrol::_MsgMeta_default_instance_); +inline const ::uxcontrol::MetaHeader& AddressMessage::_internal_meta() const { + const ::uxcontrol::MetaHeader* p = _impl_.meta_; + return p != nullptr ? *p : reinterpret_cast( + ::uxcontrol::_MetaHeader_default_instance_); } -inline const ::uxcontrol::MsgMeta& HelloMsg::meta() const { - // @@protoc_insertion_point(field_get:uxcontrol.HelloMsg.meta) +inline const ::uxcontrol::MetaHeader& AddressMessage::meta() const { + // @@protoc_insertion_point(field_get:uxcontrol.AddressMessage.meta) return _internal_meta(); } -inline void HelloMsg::unsafe_arena_set_allocated_meta( - ::uxcontrol::MsgMeta* meta) { +inline void AddressMessage::unsafe_arena_set_allocated_meta( + ::uxcontrol::MetaHeader* meta) { if (GetArenaForAllocation() == nullptr) { delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.meta_); } @@ -2059,11 +1450,11 @@ inline void HelloMsg::unsafe_arena_set_allocated_meta( } else { } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:uxcontrol.HelloMsg.meta) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:uxcontrol.AddressMessage.meta) } -inline ::uxcontrol::MsgMeta* HelloMsg::release_meta() { +inline ::uxcontrol::MetaHeader* AddressMessage::release_meta() { - ::uxcontrol::MsgMeta* temp = _impl_.meta_; + ::uxcontrol::MetaHeader* temp = _impl_.meta_; _impl_.meta_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); @@ -2076,27 +1467,27 @@ inline ::uxcontrol::MsgMeta* HelloMsg::release_meta() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::uxcontrol::MsgMeta* HelloMsg::unsafe_arena_release_meta() { - // @@protoc_insertion_point(field_release:uxcontrol.HelloMsg.meta) +inline ::uxcontrol::MetaHeader* AddressMessage::unsafe_arena_release_meta() { + // @@protoc_insertion_point(field_release:uxcontrol.AddressMessage.meta) - ::uxcontrol::MsgMeta* temp = _impl_.meta_; + ::uxcontrol::MetaHeader* temp = _impl_.meta_; _impl_.meta_ = nullptr; return temp; } -inline ::uxcontrol::MsgMeta* HelloMsg::_internal_mutable_meta() { +inline ::uxcontrol::MetaHeader* AddressMessage::_internal_mutable_meta() { if (_impl_.meta_ == nullptr) { - auto* p = CreateMaybeMessage<::uxcontrol::MsgMeta>(GetArenaForAllocation()); + auto* p = CreateMaybeMessage<::uxcontrol::MetaHeader>(GetArenaForAllocation()); _impl_.meta_ = p; } return _impl_.meta_; } -inline ::uxcontrol::MsgMeta* HelloMsg::mutable_meta() { - ::uxcontrol::MsgMeta* _msg = _internal_mutable_meta(); - // @@protoc_insertion_point(field_mutable:uxcontrol.HelloMsg.meta) +inline ::uxcontrol::MetaHeader* AddressMessage::mutable_meta() { + ::uxcontrol::MetaHeader* _msg = _internal_mutable_meta(); + // @@protoc_insertion_point(field_mutable:uxcontrol.AddressMessage.meta) return _msg; } -inline void HelloMsg::set_allocated_meta(::uxcontrol::MsgMeta* meta) { +inline void AddressMessage::set_allocated_meta(::uxcontrol::MetaHeader* meta) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { delete _impl_.meta_; @@ -2113,45 +1504,423 @@ inline void HelloMsg::set_allocated_meta(::uxcontrol::MsgMeta* meta) { } _impl_.meta_ = meta; - // @@protoc_insertion_point(field_set_allocated:uxcontrol.HelloMsg.meta) + // @@protoc_insertion_point(field_set_allocated:uxcontrol.AddressMessage.meta) +} + +// string address = 2; +inline void AddressMessage::clear_address() { + _impl_.address_.ClearToEmpty(); +} +inline const std::string& AddressMessage::address() const { + // @@protoc_insertion_point(field_get:uxcontrol.AddressMessage.address) + return _internal_address(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void AddressMessage::set_address(ArgT0&& arg0, ArgT... args) { + + _impl_.address_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:uxcontrol.AddressMessage.address) +} +inline std::string* AddressMessage::mutable_address() { + std::string* _s = _internal_mutable_address(); + // @@protoc_insertion_point(field_mutable:uxcontrol.AddressMessage.address) + return _s; +} +inline const std::string& AddressMessage::_internal_address() const { + return _impl_.address_.Get(); +} +inline void AddressMessage::_internal_set_address(const std::string& value) { + + _impl_.address_.Set(value, GetArenaForAllocation()); +} +inline std::string* AddressMessage::_internal_mutable_address() { + + return _impl_.address_.Mutable(GetArenaForAllocation()); +} +inline std::string* AddressMessage::release_address() { + // @@protoc_insertion_point(field_release:uxcontrol.AddressMessage.address) + return _impl_.address_.Release(); +} +inline void AddressMessage::set_allocated_address(std::string* address) { + if (address != nullptr) { + + } else { + + } + _impl_.address_.SetAllocated(address, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.address_.IsDefault()) { + _impl_.address_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:uxcontrol.AddressMessage.address) +} + +// uint64 prefix = 3; +inline void AddressMessage::clear_prefix() { + _impl_.prefix_ = uint64_t{0u}; +} +inline uint64_t AddressMessage::_internal_prefix() const { + return _impl_.prefix_; +} +inline uint64_t AddressMessage::prefix() const { + // @@protoc_insertion_point(field_get:uxcontrol.AddressMessage.prefix) + return _internal_prefix(); +} +inline void AddressMessage::_internal_set_prefix(uint64_t value) { + + _impl_.prefix_ = value; +} +inline void AddressMessage::set_prefix(uint64_t value) { + _internal_set_prefix(value); + // @@protoc_insertion_point(field_set:uxcontrol.AddressMessage.prefix) +} + +// ------------------------------------------------------------------- + +// RouteMessage + +// .uxcontrol.MetaHeader meta = 1; +inline bool RouteMessage::_internal_has_meta() const { + return this != internal_default_instance() && _impl_.meta_ != nullptr; +} +inline bool RouteMessage::has_meta() const { + return _internal_has_meta(); +} +inline void RouteMessage::clear_meta() { + if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { + delete _impl_.meta_; + } + _impl_.meta_ = nullptr; +} +inline const ::uxcontrol::MetaHeader& RouteMessage::_internal_meta() const { + const ::uxcontrol::MetaHeader* p = _impl_.meta_; + return p != nullptr ? *p : reinterpret_cast( + ::uxcontrol::_MetaHeader_default_instance_); +} +inline const ::uxcontrol::MetaHeader& RouteMessage::meta() const { + // @@protoc_insertion_point(field_get:uxcontrol.RouteMessage.meta) + return _internal_meta(); +} +inline void RouteMessage::unsafe_arena_set_allocated_meta( + ::uxcontrol::MetaHeader* 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:uxcontrol.RouteMessage.meta) +} +inline ::uxcontrol::MetaHeader* RouteMessage::release_meta() { + + ::uxcontrol::MetaHeader* 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 ::uxcontrol::MetaHeader* RouteMessage::unsafe_arena_release_meta() { + // @@protoc_insertion_point(field_release:uxcontrol.RouteMessage.meta) + + ::uxcontrol::MetaHeader* temp = _impl_.meta_; + _impl_.meta_ = nullptr; + return temp; +} +inline ::uxcontrol::MetaHeader* RouteMessage::_internal_mutable_meta() { + + if (_impl_.meta_ == nullptr) { + auto* p = CreateMaybeMessage<::uxcontrol::MetaHeader>(GetArenaForAllocation()); + _impl_.meta_ = p; + } + return _impl_.meta_; +} +inline ::uxcontrol::MetaHeader* RouteMessage::mutable_meta() { + ::uxcontrol::MetaHeader* _msg = _internal_mutable_meta(); + // @@protoc_insertion_point(field_mutable:uxcontrol.RouteMessage.meta) + return _msg; +} +inline void RouteMessage::set_allocated_meta(::uxcontrol::MetaHeader* 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:uxcontrol.RouteMessage.meta) +} + +// string address = 2; +inline void RouteMessage::clear_address() { + _impl_.address_.ClearToEmpty(); +} +inline const std::string& RouteMessage::address() const { + // @@protoc_insertion_point(field_get:uxcontrol.RouteMessage.address) + return _internal_address(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void RouteMessage::set_address(ArgT0&& arg0, ArgT... args) { + + _impl_.address_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:uxcontrol.RouteMessage.address) +} +inline std::string* RouteMessage::mutable_address() { + std::string* _s = _internal_mutable_address(); + // @@protoc_insertion_point(field_mutable:uxcontrol.RouteMessage.address) + return _s; +} +inline const std::string& RouteMessage::_internal_address() const { + return _impl_.address_.Get(); +} +inline void RouteMessage::_internal_set_address(const std::string& value) { + + _impl_.address_.Set(value, GetArenaForAllocation()); +} +inline std::string* RouteMessage::_internal_mutable_address() { + + return _impl_.address_.Mutable(GetArenaForAllocation()); +} +inline std::string* RouteMessage::release_address() { + // @@protoc_insertion_point(field_release:uxcontrol.RouteMessage.address) + return _impl_.address_.Release(); +} +inline void RouteMessage::set_allocated_address(std::string* address) { + if (address != nullptr) { + + } else { + + } + _impl_.address_.SetAllocated(address, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.address_.IsDefault()) { + _impl_.address_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:uxcontrol.RouteMessage.address) +} + +// uint64 prefix = 3; +inline void RouteMessage::clear_prefix() { + _impl_.prefix_ = uint64_t{0u}; +} +inline uint64_t RouteMessage::_internal_prefix() const { + return _impl_.prefix_; +} +inline uint64_t RouteMessage::prefix() const { + // @@protoc_insertion_point(field_get:uxcontrol.RouteMessage.prefix) + return _internal_prefix(); +} +inline void RouteMessage::_internal_set_prefix(uint64_t value) { + + _impl_.prefix_ = value; +} +inline void RouteMessage::set_prefix(uint64_t value) { + _internal_set_prefix(value); + // @@protoc_insertion_point(field_set:uxcontrol.RouteMessage.prefix) +} + +// string gateway = 4; +inline void RouteMessage::clear_gateway() { + _impl_.gateway_.ClearToEmpty(); +} +inline const std::string& RouteMessage::gateway() const { + // @@protoc_insertion_point(field_get:uxcontrol.RouteMessage.gateway) + return _internal_gateway(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void RouteMessage::set_gateway(ArgT0&& arg0, ArgT... args) { + + _impl_.gateway_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:uxcontrol.RouteMessage.gateway) +} +inline std::string* RouteMessage::mutable_gateway() { + std::string* _s = _internal_mutable_gateway(); + // @@protoc_insertion_point(field_mutable:uxcontrol.RouteMessage.gateway) + return _s; +} +inline const std::string& RouteMessage::_internal_gateway() const { + return _impl_.gateway_.Get(); +} +inline void RouteMessage::_internal_set_gateway(const std::string& value) { + + _impl_.gateway_.Set(value, GetArenaForAllocation()); +} +inline std::string* RouteMessage::_internal_mutable_gateway() { + + return _impl_.gateway_.Mutable(GetArenaForAllocation()); +} +inline std::string* RouteMessage::release_gateway() { + // @@protoc_insertion_point(field_release:uxcontrol.RouteMessage.gateway) + return _impl_.gateway_.Release(); +} +inline void RouteMessage::set_allocated_gateway(std::string* gateway) { + if (gateway != nullptr) { + + } else { + + } + _impl_.gateway_.SetAllocated(gateway, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.gateway_.IsDefault()) { + _impl_.gateway_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:uxcontrol.RouteMessage.gateway) +} + +// ------------------------------------------------------------------- + +// HelloMessage + +// .uxcontrol.MetaHeader meta = 1; +inline bool HelloMessage::_internal_has_meta() const { + return this != internal_default_instance() && _impl_.meta_ != nullptr; +} +inline bool HelloMessage::has_meta() const { + return _internal_has_meta(); +} +inline void HelloMessage::clear_meta() { + if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { + delete _impl_.meta_; + } + _impl_.meta_ = nullptr; +} +inline const ::uxcontrol::MetaHeader& HelloMessage::_internal_meta() const { + const ::uxcontrol::MetaHeader* p = _impl_.meta_; + return p != nullptr ? *p : reinterpret_cast( + ::uxcontrol::_MetaHeader_default_instance_); +} +inline const ::uxcontrol::MetaHeader& HelloMessage::meta() const { + // @@protoc_insertion_point(field_get:uxcontrol.HelloMessage.meta) + return _internal_meta(); +} +inline void HelloMessage::unsafe_arena_set_allocated_meta( + ::uxcontrol::MetaHeader* 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:uxcontrol.HelloMessage.meta) +} +inline ::uxcontrol::MetaHeader* HelloMessage::release_meta() { + + ::uxcontrol::MetaHeader* 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 ::uxcontrol::MetaHeader* HelloMessage::unsafe_arena_release_meta() { + // @@protoc_insertion_point(field_release:uxcontrol.HelloMessage.meta) + + ::uxcontrol::MetaHeader* temp = _impl_.meta_; + _impl_.meta_ = nullptr; + return temp; +} +inline ::uxcontrol::MetaHeader* HelloMessage::_internal_mutable_meta() { + + if (_impl_.meta_ == nullptr) { + auto* p = CreateMaybeMessage<::uxcontrol::MetaHeader>(GetArenaForAllocation()); + _impl_.meta_ = p; + } + return _impl_.meta_; +} +inline ::uxcontrol::MetaHeader* HelloMessage::mutable_meta() { + ::uxcontrol::MetaHeader* _msg = _internal_mutable_meta(); + // @@protoc_insertion_point(field_mutable:uxcontrol.HelloMessage.meta) + return _msg; +} +inline void HelloMessage::set_allocated_meta(::uxcontrol::MetaHeader* 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:uxcontrol.HelloMessage.meta) } // string message = 2; -inline void HelloMsg::clear_message() { +inline void HelloMessage::clear_message() { _impl_.message_.ClearToEmpty(); } -inline const std::string& HelloMsg::message() const { - // @@protoc_insertion_point(field_get:uxcontrol.HelloMsg.message) +inline const std::string& HelloMessage::message() const { + // @@protoc_insertion_point(field_get:uxcontrol.HelloMessage.message) return _internal_message(); } template inline PROTOBUF_ALWAYS_INLINE -void HelloMsg::set_message(ArgT0&& arg0, ArgT... args) { +void HelloMessage::set_message(ArgT0&& arg0, ArgT... args) { _impl_.message_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:uxcontrol.HelloMsg.message) + // @@protoc_insertion_point(field_set:uxcontrol.HelloMessage.message) } -inline std::string* HelloMsg::mutable_message() { +inline std::string* HelloMessage::mutable_message() { std::string* _s = _internal_mutable_message(); - // @@protoc_insertion_point(field_mutable:uxcontrol.HelloMsg.message) + // @@protoc_insertion_point(field_mutable:uxcontrol.HelloMessage.message) return _s; } -inline const std::string& HelloMsg::_internal_message() const { +inline const std::string& HelloMessage::_internal_message() const { return _impl_.message_.Get(); } -inline void HelloMsg::_internal_set_message(const std::string& value) { +inline void HelloMessage::_internal_set_message(const std::string& value) { _impl_.message_.Set(value, GetArenaForAllocation()); } -inline std::string* HelloMsg::_internal_mutable_message() { +inline std::string* HelloMessage::_internal_mutable_message() { return _impl_.message_.Mutable(GetArenaForAllocation()); } -inline std::string* HelloMsg::release_message() { - // @@protoc_insertion_point(field_release:uxcontrol.HelloMsg.message) +inline std::string* HelloMessage::release_message() { + // @@protoc_insertion_point(field_release:uxcontrol.HelloMessage.message) return _impl_.message_.Release(); } -inline void HelloMsg::set_allocated_message(std::string* message) { +inline void HelloMessage::set_allocated_message(std::string* message) { if (message != nullptr) { } else { @@ -2163,611 +1932,7 @@ inline void HelloMsg::set_allocated_message(std::string* message) { _impl_.message_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:uxcontrol.HelloMsg.message) -} - -// ------------------------------------------------------------------- - -// ReqMeta - -// string kind = 1; -inline void ReqMeta::clear_kind() { - _impl_.kind_.ClearToEmpty(); -} -inline const std::string& ReqMeta::kind() const { - // @@protoc_insertion_point(field_get:uxcontrol.ReqMeta.kind) - return _internal_kind(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ReqMeta::set_kind(ArgT0&& arg0, ArgT... args) { - - _impl_.kind_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:uxcontrol.ReqMeta.kind) -} -inline std::string* ReqMeta::mutable_kind() { - std::string* _s = _internal_mutable_kind(); - // @@protoc_insertion_point(field_mutable:uxcontrol.ReqMeta.kind) - return _s; -} -inline const std::string& ReqMeta::_internal_kind() const { - return _impl_.kind_.Get(); -} -inline void ReqMeta::_internal_set_kind(const std::string& value) { - - _impl_.kind_.Set(value, GetArenaForAllocation()); -} -inline std::string* ReqMeta::_internal_mutable_kind() { - - return _impl_.kind_.Mutable(GetArenaForAllocation()); -} -inline std::string* ReqMeta::release_kind() { - // @@protoc_insertion_point(field_release:uxcontrol.ReqMeta.kind) - return _impl_.kind_.Release(); -} -inline void ReqMeta::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:uxcontrol.ReqMeta.kind) -} - -// ------------------------------------------------------------------- - -// ResMeta - -// bool error = 1; -inline void ResMeta::clear_error() { - _impl_.error_ = false; -} -inline bool ResMeta::_internal_error() const { - return _impl_.error_; -} -inline bool ResMeta::error() const { - // @@protoc_insertion_point(field_get:uxcontrol.ResMeta.error) - return _internal_error(); -} -inline void ResMeta::_internal_set_error(bool value) { - - _impl_.error_ = value; -} -inline void ResMeta::set_error(bool value) { - _internal_set_error(value); - // @@protoc_insertion_point(field_set:uxcontrol.ResMeta.error) -} - -// string message = 2; -inline void ResMeta::clear_message() { - _impl_.message_.ClearToEmpty(); -} -inline const std::string& ResMeta::message() const { - // @@protoc_insertion_point(field_get:uxcontrol.ResMeta.message) - return _internal_message(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ResMeta::set_message(ArgT0&& arg0, ArgT... args) { - - _impl_.message_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:uxcontrol.ResMeta.message) -} -inline std::string* ResMeta::mutable_message() { - std::string* _s = _internal_mutable_message(); - // @@protoc_insertion_point(field_mutable:uxcontrol.ResMeta.message) - return _s; -} -inline const std::string& ResMeta::_internal_message() const { - return _impl_.message_.Get(); -} -inline void ResMeta::_internal_set_message(const std::string& value) { - - _impl_.message_.Set(value, GetArenaForAllocation()); -} -inline std::string* ResMeta::_internal_mutable_message() { - - return _impl_.message_.Mutable(GetArenaForAllocation()); -} -inline std::string* ResMeta::release_message() { - // @@protoc_insertion_point(field_release:uxcontrol.ResMeta.message) - return _impl_.message_.Release(); -} -inline void ResMeta::set_allocated_message(std::string* message) { - if (message != nullptr) { - - } else { - - } - _impl_.message_.SetAllocated(message, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.message_.IsDefault()) { - _impl_.message_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:uxcontrol.ResMeta.message) -} - -// ------------------------------------------------------------------- - -// Request - -// .uxcontrol.ReqMeta meta = 1; -inline bool Request::_internal_has_meta() const { - return this != internal_default_instance() && _impl_.meta_ != nullptr; -} -inline bool Request::has_meta() const { - return _internal_has_meta(); -} -inline void Request::clear_meta() { - if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { - delete _impl_.meta_; - } - _impl_.meta_ = nullptr; -} -inline const ::uxcontrol::ReqMeta& Request::_internal_meta() const { - const ::uxcontrol::ReqMeta* p = _impl_.meta_; - return p != nullptr ? *p : reinterpret_cast( - ::uxcontrol::_ReqMeta_default_instance_); -} -inline const ::uxcontrol::ReqMeta& Request::meta() const { - // @@protoc_insertion_point(field_get:uxcontrol.Request.meta) - return _internal_meta(); -} -inline void Request::unsafe_arena_set_allocated_meta( - ::uxcontrol::ReqMeta* 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:uxcontrol.Request.meta) -} -inline ::uxcontrol::ReqMeta* Request::release_meta() { - - ::uxcontrol::ReqMeta* 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 ::uxcontrol::ReqMeta* Request::unsafe_arena_release_meta() { - // @@protoc_insertion_point(field_release:uxcontrol.Request.meta) - - ::uxcontrol::ReqMeta* temp = _impl_.meta_; - _impl_.meta_ = nullptr; - return temp; -} -inline ::uxcontrol::ReqMeta* Request::_internal_mutable_meta() { - - if (_impl_.meta_ == nullptr) { - auto* p = CreateMaybeMessage<::uxcontrol::ReqMeta>(GetArenaForAllocation()); - _impl_.meta_ = p; - } - return _impl_.meta_; -} -inline ::uxcontrol::ReqMeta* Request::mutable_meta() { - ::uxcontrol::ReqMeta* _msg = _internal_mutable_meta(); - // @@protoc_insertion_point(field_mutable:uxcontrol.Request.meta) - return _msg; -} -inline void Request::set_allocated_meta(::uxcontrol::ReqMeta* 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:uxcontrol.Request.meta) -} - -// ------------------------------------------------------------------- - -// Result - -// .uxcontrol.ResMeta meta = 1; -inline bool Result::_internal_has_meta() const { - return this != internal_default_instance() && _impl_.meta_ != nullptr; -} -inline bool Result::has_meta() const { - return _internal_has_meta(); -} -inline void Result::clear_meta() { - if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { - delete _impl_.meta_; - } - _impl_.meta_ = nullptr; -} -inline const ::uxcontrol::ResMeta& Result::_internal_meta() const { - const ::uxcontrol::ResMeta* p = _impl_.meta_; - return p != nullptr ? *p : reinterpret_cast( - ::uxcontrol::_ResMeta_default_instance_); -} -inline const ::uxcontrol::ResMeta& Result::meta() const { - // @@protoc_insertion_point(field_get:uxcontrol.Result.meta) - return _internal_meta(); -} -inline void Result::unsafe_arena_set_allocated_meta( - ::uxcontrol::ResMeta* 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:uxcontrol.Result.meta) -} -inline ::uxcontrol::ResMeta* Result::release_meta() { - - ::uxcontrol::ResMeta* 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 ::uxcontrol::ResMeta* Result::unsafe_arena_release_meta() { - // @@protoc_insertion_point(field_release:uxcontrol.Result.meta) - - ::uxcontrol::ResMeta* temp = _impl_.meta_; - _impl_.meta_ = nullptr; - return temp; -} -inline ::uxcontrol::ResMeta* Result::_internal_mutable_meta() { - - if (_impl_.meta_ == nullptr) { - auto* p = CreateMaybeMessage<::uxcontrol::ResMeta>(GetArenaForAllocation()); - _impl_.meta_ = p; - } - return _impl_.meta_; -} -inline ::uxcontrol::ResMeta* Result::mutable_meta() { - ::uxcontrol::ResMeta* _msg = _internal_mutable_meta(); - // @@protoc_insertion_point(field_mutable:uxcontrol.Result.meta) - return _msg; -} -inline void Result::set_allocated_meta(::uxcontrol::ResMeta* 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:uxcontrol.Result.meta) -} - -// ------------------------------------------------------------------- - -// HelloRequest - -// .uxcontrol.ReqMeta meta = 1; -inline bool HelloRequest::_internal_has_meta() const { - return this != internal_default_instance() && _impl_.meta_ != nullptr; -} -inline bool HelloRequest::has_meta() const { - return _internal_has_meta(); -} -inline void HelloRequest::clear_meta() { - if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { - delete _impl_.meta_; - } - _impl_.meta_ = nullptr; -} -inline const ::uxcontrol::ReqMeta& HelloRequest::_internal_meta() const { - const ::uxcontrol::ReqMeta* p = _impl_.meta_; - return p != nullptr ? *p : reinterpret_cast( - ::uxcontrol::_ReqMeta_default_instance_); -} -inline const ::uxcontrol::ReqMeta& HelloRequest::meta() const { - // @@protoc_insertion_point(field_get:uxcontrol.HelloRequest.meta) - return _internal_meta(); -} -inline void HelloRequest::unsafe_arena_set_allocated_meta( - ::uxcontrol::ReqMeta* 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:uxcontrol.HelloRequest.meta) -} -inline ::uxcontrol::ReqMeta* HelloRequest::release_meta() { - - ::uxcontrol::ReqMeta* 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 ::uxcontrol::ReqMeta* HelloRequest::unsafe_arena_release_meta() { - // @@protoc_insertion_point(field_release:uxcontrol.HelloRequest.meta) - - ::uxcontrol::ReqMeta* temp = _impl_.meta_; - _impl_.meta_ = nullptr; - return temp; -} -inline ::uxcontrol::ReqMeta* HelloRequest::_internal_mutable_meta() { - - if (_impl_.meta_ == nullptr) { - auto* p = CreateMaybeMessage<::uxcontrol::ReqMeta>(GetArenaForAllocation()); - _impl_.meta_ = p; - } - return _impl_.meta_; -} -inline ::uxcontrol::ReqMeta* HelloRequest::mutable_meta() { - ::uxcontrol::ReqMeta* _msg = _internal_mutable_meta(); - // @@protoc_insertion_point(field_mutable:uxcontrol.HelloRequest.meta) - return _msg; -} -inline void HelloRequest::set_allocated_meta(::uxcontrol::ReqMeta* 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:uxcontrol.HelloRequest.meta) -} - -// string message = 2; -inline void HelloRequest::clear_message() { - _impl_.message_.ClearToEmpty(); -} -inline const std::string& HelloRequest::message() const { - // @@protoc_insertion_point(field_get:uxcontrol.HelloRequest.message) - return _internal_message(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void HelloRequest::set_message(ArgT0&& arg0, ArgT... args) { - - _impl_.message_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:uxcontrol.HelloRequest.message) -} -inline std::string* HelloRequest::mutable_message() { - std::string* _s = _internal_mutable_message(); - // @@protoc_insertion_point(field_mutable:uxcontrol.HelloRequest.message) - return _s; -} -inline const std::string& HelloRequest::_internal_message() const { - return _impl_.message_.Get(); -} -inline void HelloRequest::_internal_set_message(const std::string& value) { - - _impl_.message_.Set(value, GetArenaForAllocation()); -} -inline std::string* HelloRequest::_internal_mutable_message() { - - return _impl_.message_.Mutable(GetArenaForAllocation()); -} -inline std::string* HelloRequest::release_message() { - // @@protoc_insertion_point(field_release:uxcontrol.HelloRequest.message) - return _impl_.message_.Release(); -} -inline void HelloRequest::set_allocated_message(std::string* message) { - if (message != nullptr) { - - } else { - - } - _impl_.message_.SetAllocated(message, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.message_.IsDefault()) { - _impl_.message_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:uxcontrol.HelloRequest.message) -} - -// ------------------------------------------------------------------- - -// HelloResult - -// .uxcontrol.ResMeta meta = 1; -inline bool HelloResult::_internal_has_meta() const { - return this != internal_default_instance() && _impl_.meta_ != nullptr; -} -inline bool HelloResult::has_meta() const { - return _internal_has_meta(); -} -inline void HelloResult::clear_meta() { - if (GetArenaForAllocation() == nullptr && _impl_.meta_ != nullptr) { - delete _impl_.meta_; - } - _impl_.meta_ = nullptr; -} -inline const ::uxcontrol::ResMeta& HelloResult::_internal_meta() const { - const ::uxcontrol::ResMeta* p = _impl_.meta_; - return p != nullptr ? *p : reinterpret_cast( - ::uxcontrol::_ResMeta_default_instance_); -} -inline const ::uxcontrol::ResMeta& HelloResult::meta() const { - // @@protoc_insertion_point(field_get:uxcontrol.HelloResult.meta) - return _internal_meta(); -} -inline void HelloResult::unsafe_arena_set_allocated_meta( - ::uxcontrol::ResMeta* 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:uxcontrol.HelloResult.meta) -} -inline ::uxcontrol::ResMeta* HelloResult::release_meta() { - - ::uxcontrol::ResMeta* 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 ::uxcontrol::ResMeta* HelloResult::unsafe_arena_release_meta() { - // @@protoc_insertion_point(field_release:uxcontrol.HelloResult.meta) - - ::uxcontrol::ResMeta* temp = _impl_.meta_; - _impl_.meta_ = nullptr; - return temp; -} -inline ::uxcontrol::ResMeta* HelloResult::_internal_mutable_meta() { - - if (_impl_.meta_ == nullptr) { - auto* p = CreateMaybeMessage<::uxcontrol::ResMeta>(GetArenaForAllocation()); - _impl_.meta_ = p; - } - return _impl_.meta_; -} -inline ::uxcontrol::ResMeta* HelloResult::mutable_meta() { - ::uxcontrol::ResMeta* _msg = _internal_mutable_meta(); - // @@protoc_insertion_point(field_mutable:uxcontrol.HelloResult.meta) - return _msg; -} -inline void HelloResult::set_allocated_meta(::uxcontrol::ResMeta* 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:uxcontrol.HelloResult.meta) -} - -// string message = 2; -inline void HelloResult::clear_message() { - _impl_.message_.ClearToEmpty(); -} -inline const std::string& HelloResult::message() const { - // @@protoc_insertion_point(field_get:uxcontrol.HelloResult.message) - return _internal_message(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void HelloResult::set_message(ArgT0&& arg0, ArgT... args) { - - _impl_.message_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:uxcontrol.HelloResult.message) -} -inline std::string* HelloResult::mutable_message() { - std::string* _s = _internal_mutable_message(); - // @@protoc_insertion_point(field_mutable:uxcontrol.HelloResult.message) - return _s; -} -inline const std::string& HelloResult::_internal_message() const { - return _impl_.message_.Get(); -} -inline void HelloResult::_internal_set_message(const std::string& value) { - - _impl_.message_.Set(value, GetArenaForAllocation()); -} -inline std::string* HelloResult::_internal_mutable_message() { - - return _impl_.message_.Mutable(GetArenaForAllocation()); -} -inline std::string* HelloResult::release_message() { - // @@protoc_insertion_point(field_release:uxcontrol.HelloResult.message) - return _impl_.message_.Release(); -} -inline void HelloResult::set_allocated_message(std::string* message) { - if (message != nullptr) { - - } else { - - } - _impl_.message_.SetAllocated(message, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.message_.IsDefault()) { - _impl_.message_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:uxcontrol.HelloResult.message) + // @@protoc_insertion_point(field_set_allocated:uxcontrol.HelloMessage.message) } #ifdef __GNUC__ @@ -2783,14 +1948,6 @@ inline void HelloResult::set_allocated_message(std::string* message) { // ------------------------------------------------------------------- -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - // @@protoc_insertion_point(namespace_scope) diff --git a/uxcontrol.proto b/uxcontrol.proto index 6abb9d4..75d2c7a 100644 --- a/uxcontrol.proto +++ b/uxcontrol.proto @@ -5,50 +5,36 @@ package uxcontrol; //option cc_generic_services = false; -message MsgMeta { - string kind = 1; +message MetaHeader { + string kind = 1; } -message Message { - MsgMeta meta = 1; +message SimpleMessage { + MetaHeader meta = 1; } -message InternetPacket { - MsgMeta meta = 1; - bytes payload = 2; +message PacketMessage { + MetaHeader meta = 1; + bytes payload = 2; } -message HelloMsg { - MsgMeta meta = 1; - string message = 2; +message AddressMessage { + MetaHeader meta = 1; + string address = 2; + uint64 prefix = 3; +} + +message RouteMessage { + MetaHeader meta = 1; + string address = 2; + uint64 prefix = 3; + string gateway = 4; } -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; +message HelloMessage { + MetaHeader meta = 1; + string message = 2; } diff --git a/works/interface_w_netlink.cpp b/works/interface_w_netlink.cpp new file mode 100644 index 0000000..4e4acb5 --- /dev/null +++ b/works/interface_w_netlink.cpp @@ -0,0 +1,391 @@ + +extern "C" { +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +} + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +std::expected Interface::Create(const std::string name) { + if ((tunfd = open("/dev/net/tun", O_RDWR | O_CLOEXEC)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Create interface error: " + error); + } + struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_flags = IFF_TUN | IFF_NO_PI; + strncpy(ifr.ifr_name, name.c_str(), IFNAMSIZ - 1); + if (ioctl(tunfd, TUNSETIFF, (void*)(&ifr)) < 0) { + close(tunfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Create interface error: " + error); + } + ifname = ifr.ifr_name; +#if 0 + if (ioctl(tunfd, TUNSETPERSIST, 0) < 0) { + close(tunfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Create interface error: " + error); + } +#endif + + //struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + close(tunfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Get MTU error: " + error); + } + strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + if (ioctl(sockfd, SIOCGIFMTU, &ifr) < 0) { + close(tunfd); + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Get MTU error: " + error); + } + close(sockfd); + mtu = ifr.ifr_mtu; + return {}; +} + +std::expected Interface::SetMTU(int ifmtu) { + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set MTU error: " + error); + } + struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + ifr.ifr_mtu = ifmtu; + if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set MTU error: " + error); + } + close(sockfd); + return {}; +} + +std::expected Interface::GetMTU(void) { + struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Get MTU error: " + error); + } + strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + if (ioctl(sockfd, SIOCGIFMTU, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Get MTU error: " + error); + } + close(sockfd); + return ifr.ifr_mtu; +} + +std::expected Interface::GetIP4Address(void) { + struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Get MTU error: " + error); + } + ifr.ifr_addr.sa_family = AF_INET; + strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + + if (ioctl(sockfd, SIOCGIFADDR, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Get MTU error: " + error); + } + close(sockfd); + + auto sinaddr = ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr; + std::string addr = inet_ntoa(sinaddr); + return addr; +} + +std::expected Interface::SetIP4Address(std::string ipaddr) { + struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set address error: " + error); + } + ifr.ifr_addr.sa_family = AF_INET; + strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + + struct sockaddr_in* addr = (struct sockaddr_in *)&ifr.ifr_addr; + addr->sin_family = AF_INET; + if (inet_pton(AF_INET, ipaddr.c_str(), &addr->sin_addr) <= 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set address error: " + error); + } + if (ioctl(sockfd, SIOCSIFADDR, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set address error: " + error); + } + close(sockfd); + return {}; +} + +std::expected Interface::SetIP4Netmask(int prefix) { + if (prefix < 0 || prefix > 32) { + return std::unexpected("Invalid prefix"); + } + uint32_t mask = (prefix == 0) ? 0 : (~0U << (32 - prefix)); + + //htonl(~((1U << (32 - prefix)) - 1)); + //struct in_addr addr; + //addr.s_addr = mask; + + struct in_addr maskaddr; + maskaddr.s_addr = htonl(mask); + char buffer[INET_ADDRSTRLEN]; + if (inet_ntop(AF_INET, &maskaddr, buffer, sizeof(buffer)) == NULL) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set1 netmask error: " + error); + } + auto netmask = std::string(buffer); + + struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set2 netmask error: " + error); + } + ifr.ifr_addr.sa_family = AF_INET; + strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + + struct sockaddr_in* addr = (struct sockaddr_in *)&ifr.ifr_addr; + addr->sin_family = AF_INET; + if (inet_pton(AF_INET, netmask.c_str(), &addr->sin_addr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set3 netmask error: " + error); + } + if (ioctl(sockfd, SIOCSIFNETMASK, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set4 netmask error: " + error); + } + close(sockfd); + return {}; +} + +std::expected Interface::Up(void) { + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Up interface error: " + error); + } + + struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Up interface error: " + error); + } + ifr.ifr_flags |= (IFF_UP | IFF_RUNNING); + if (ioctl(sockfd, SIOCSIFFLAGS, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Up interface error: " + error); + } + close(sockfd); + return {}; +} + +std::expected Interface::Down(void) { + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Up interface error: " + error); + } + struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1); + if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Up interface error: " + error); + } + ifr.ifr_flags &= ~IFF_UP; + if (ioctl(sockfd, SIOCSIFFLAGS, &ifr) < 0) { + close(sockfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Up interface error: " + error); + } + close(sockfd); + return {}; +} + +std::expected Interface::Read() { + char buffer[mtu]; + int rsize = 0; + if ((rsize = read(tunfd, buffer, sizeof(buffer))) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Read interface error: " + error); + } + std::string rdata; + rdata.append(buffer, rsize); + return rdata; +} + +std::string Interface::Name() { + return ifname; +} + +int Interface::MTU() { + return mtu; +} + +Interface::~Interface() { + close(tunfd); +} + + +std::expected Interface::UpN(void) { + int netlinkfd = 0; + if ((netlinkfd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Create interface error: " + error); + } + + struct { + struct nlmsghdr header; + struct ifinfomsg content; + } request; + + memset(&request, 0, sizeof request); + request.header.nlmsg_len = NLMSG_LENGTH(sizeof request.content); + request.header.nlmsg_flags = NLM_F_REQUEST; + request.header.nlmsg_type = RTM_NEWLINK; + request.content.ifi_index = if_nametoindex(ifname.c_str()); + request.content.ifi_flags = IFF_UP; + request.content.ifi_change = 1; + + if (send(netlinkfd, &request, request.header.nlmsg_len, 0) < 0) { + close(netlinkfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Up interface error: " + error); + } + close(netlinkfd); + return {}; +} + +std::expected Interface::SetIP4AddrMask(const std::string address, const int prefix) { + int netlinkfd = 0; + if ((netlinkfd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE)) < 0) { + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Create interface error: " + error); + } + + int rc = 0; + struct sockaddr_nl sockaddr; + memset(&sockaddr, 0, sizeof sockaddr); + sockaddr.nl_family = AF_NETLINK; + if ((rc = bind(netlinkfd, (struct sockaddr*) &sockaddr, sizeof sockaddr))< 0) { + close(netlinkfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set interface address error: " + error); + } + struct { + struct nlmsghdr header; + struct ifaddrmsg content; + char attributes_buf[64]; + } request; + + struct rtattr *request_attr; + size_t attributes_buf_avail = sizeof request.attributes_buf; + + memset(&request, 0, sizeof request); + request.header.nlmsg_len = NLMSG_LENGTH(sizeof request.content); + request.header.nlmsg_flags = NLM_F_REQUEST | NLM_F_EXCL | NLM_F_CREATE; + request.header.nlmsg_type = RTM_NEWADDR; + request.content.ifa_index = if_nametoindex(ifname.c_str()); + request.content.ifa_family = AF_INET; + request.content.ifa_prefixlen = prefix; + + /* request.attributes[IFA_LOCAL] = address */ + request_attr = IFA_RTA(&request.content); + request_attr->rta_type = IFA_LOCAL; + request_attr->rta_len = RTA_LENGTH(sizeof (struct in_addr)); + request.header.nlmsg_len += request_attr->rta_len; + inet_pton(AF_INET, address.c_str(), RTA_DATA(request_attr)); + + /* request.attributes[IFA_ADDRESS] = address */ + request_attr = RTA_NEXT(request_attr, attributes_buf_avail); + request_attr->rta_type = IFA_ADDRESS; + request_attr->rta_len = RTA_LENGTH(sizeof (struct in_addr)); + request.header.nlmsg_len += request_attr->rta_len; + inet_pton(AF_INET, address.c_str(), RTA_DATA(request_attr)); + + if (send(netlinkfd, &request, request.header.nlmsg_len, 0) < 0) { + close(netlinkfd); + int errnocopy = errno; + std::string error = std::strerror(errnocopy); + return std::unexpected("Set interface address error: " + error); + } + close(netlinkfd); + return {}; +} diff --git a/works/iprouter_w_list.cpp b/works/iprouter_w_list.cpp new file mode 100644 index 0000000..7c510de --- /dev/null +++ b/works/iprouter_w_list.cpp @@ -0,0 +1,151 @@ + +extern "C" { +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +} + +#define BUFSIZE 8192 + +#include +#include +#include +#include + +#include + +std::expected Router::AddRoute(std::string address, uint64_t prefix, std::string gateway) { + struct sockaddr_in sa; + if (inet_pton(AF_INET, address.data(), &(sa.sin_addr)) == 1) { + } else { + return std::unexpected(std::format("Incorrect address {}", address)); + } + + struct rtentry rt; + memset(&rt, 0, sizeof(rt)); + + struct sockaddr_in *sin; + sin = (struct sockaddr_in*)&rt.rt_dst; + sin->sin_family = AF_INET; + if (inet_pton(AF_INET, address.data(), &sin->sin_addr) != 1){ + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Incorrect address {}, error: {}", address, error)); + }; + + sin = (struct sockaddr_in*) &rt.rt_gateway; + sin->sin_family = AF_INET; + if (inet_pton(AF_INET, gateway.data(), &sin->sin_addr) != 1) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Incorrect address {}, error: {}", gateway, error)); + }; + + char buffer[INET_ADDRSTRLEN]; + uint32_t mask = (prefix == 0) ? 0 : htonl(~((1U << (32 - prefix)) - 1)); + //uint32_t mask = (prefix == 0) ? 0 : (~0U << (32 - prefix)); + + struct in_addr addr; + addr.s_addr = mask; + + const char *dottedmask; + if ((dottedmask = inet_ntop(AF_INET, &addr, buffer, INET_ADDRSTRLEN)) == NULL) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Incorrect prefix {}, error: {}", prefix, error)); + }; + + sin = (struct sockaddr_in*) &rt.rt_genmask; + sin->sin_family = AF_INET; + if (inet_pton(AF_INET, dottedmask, &sin->sin_addr) != 1) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Incorrect address {}, error: {}", gateway, error)); + }; + + rt.rt_flags = RTF_UP | RTF_GATEWAY; + //rt.rt_dev = std::string("eth0").data(); + + int sockfd = 0; + if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Error: {}", error)); + } + + if (ioctl(sockfd, SIOCADDRT, &rt) < 0) { + close(sockfd); + int errnoCopy = errno; + std::string error = std::strerror(errnoCopy); + return std::unexpected(std::format("Cannot set route, error: {}", error)); + } + close(sockfd); + return {}; +} + + + +std::expected Router::List(void) { + std::vector routes; + + struct { + struct nlmsghdr n; + struct rtmsg r; + } req; + std::string buffer(1024 * 10, 0); + struct nlmsghdr *nlh; + int sock, len; + + if ((sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) < 0) { + return std::unexpected("Create netlink socket error"); + } + + memset(&req, 0, sizeof(req)); + req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); + req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + req.n.nlmsg_type = RTM_GETROUTE; + req.r.rtm_family = AF_INET; + + send(sock, &req, req.n.nlmsg_len, 0); + + while ((len = recv(sock, buffer.data(), buffer.size(), 0)) > 0) { + nlh = (struct nlmsghdr *)buffer.data(); + while (NLMSG_OK(nlh, len)) { + if (nlh->nlmsg_type == NLMSG_DONE) { + return {}; + }; + struct rtmsg *route = (struct rtmsg *)NLMSG_DATA(nlh); + struct rtattr *rta = (struct rtattr *)RTM_RTA(route); + int len = RTM_PAYLOAD(nlh); + + char dest_ip[INET_ADDRSTRLEN] = "0.0.0.0"; + char gw_ip[INET_ADDRSTRLEN] = "0.0.0.0"; + + for (; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) { + switch (rta->rta_type) { + case RTA_DST: + inet_ntop(AF_INET, RTA_DATA(rta), dest_ip, sizeof(dest_ip)); + break; + case RTA_GATEWAY: + inet_ntop(AF_INET, RTA_DATA(rta), gw_ip, sizeof(gw_ip)); + break; + case RTA_OIF: + int if_idx = *(int *)RTA_DATA(rta); + printf("Interface Index: %d ", if_idx); + break; + } + } + printf("Found route: dest %s / %d, gw %s\n", dest_ip, route->rtm_dst_len, gw_ip); + nlh = NLMSG_NEXT(nlh, len); + } + } + close(sock); + return routes; +} diff --git a/works/rpcvar/iprouter.cpp b/works/rpcvar/iprouter.cpp deleted file mode 100644 index 256bdbe..0000000 --- a/works/rpcvar/iprouter.cpp +++ /dev/null @@ -1,11 +0,0 @@ - - -#include -#include - -#include - -std::expected Router::List() { - std::vector routes; - return routes; -}