Commit 9dec26df authored by Vít Kabele's avatar Vít Kabele

Unified protocol

parent efce5bcf
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="output/build/disl" path="src-disl"/>
<classpathentry kind="src" output="output/build/util" path="src-util"/>
<classpathentry kind="src" output="output/build/test" path="src-test"/>
<classpathentry kind="src" output="output/build/shvm-dispatch" path="src-shvm-dispatch"/>
<classpathentry kind="src" path="disl/src/src-classparser"/>
<classpathentry kind="src" path="disl/src/src-exception"/>
<classpathentry kind="src" path="disl/src/src-main"/>
<classpathentry kind="src" path="disl/src/src-resolver"/>
<classpathentry kind="src" path="disl/src/src-coderep"/>
<classpathentry kind="src" path="disl/src/src-util"/>
<classpathentry kind="src" path="disl/src/src-snippet"/>
<classpathentry kind="src" path="disl/src/src-processor"/>
<classpathentry kind="src" path="disl/src/src-guard"/>
<classpathentry kind="src" path="disl/src/src-localvar"/>
<classpathentry kind="src" path="disl/src/src-scope"/>
<classpathentry kind="src" path="disl-server/src"/>
<classpathentry kind="src" path="disl/src/src-staticcontext"/>
<classpathentry kind="src" path="disl/src/src-staticcontext-uid"/>
<classpathentry kind="src" path="disl/src/src-marker"/>
<classpathentry kind="src" path="disl/src/src-weaver"/>
<classpathentry kind="src" path="disl/src/src-weaver-pe"/>
<classpathentry kind="src" path="disl/src/src-annotation"/>
<classpathentry kind="src" path="disl/src/src-context"/>
<classpathentry kind="src" path="disl/src-test"/>
<classpathentry kind="src" path="shvm/src/src-msg-analyze"/>
<classpathentry kind="src" path="shvm/src/src-msg-instr"/>
<classpathentry kind="src" path="shvm/src/src-msg-analyze-mtdispatch"/>
<classpathentry kind="src" path="shvm/src/src-remoteanalysis"/>
<classpathentry kind="src" path="shvm/src/src-reqdispatch"/>
<classpathentry kind="src" path="shvm/src/src-shadow"/>
<classpathentry kind="src" path="shvm/src/src-util"/>
<classpathentry kind="src" path="shvm/src/src-server-api"/>
<classpathentry kind="src" path="shvm/src-test"/>
<classpathentry kind="src" path="shvm-server/src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="output/lib/disl-bypass.jar"/>
<classpathentry kind="lib" path="lib/disl/log4j.jar" sourcepath="lib/devel/log4j-source.jar"/>
<classpathentry kind="lib" path="lib/test/junit.jar" sourcepath="lib/devel/junit-source.jar"/>
<classpathentry kind="lib" path="lib/test/hamcrest-core.jar"/>
<classpathentry kind="lib" path="lib/disl/asm-tree.jar" sourcepath="lib/devel/asm-tree-source.jar"/>
<classpathentry kind="lib" path="lib/disl/asm.jar" sourcepath="lib/devel/asm-source.jar"/>
<classpathentry kind="lib" path="lib/disl/asm-analysis.jar" sourcepath="lib/devel/asm-analysis-source.jar"/>
<classpathentry kind="lib" path="lib/disl/asm-commons.jar" sourcepath="lib/devel/asm-commons-source.jar"/>
<classpathentry kind="lib" path="lib/disl/asm-util.jar" sourcepath="lib/devel/asm-util-source.jar"/>
<classpathentry kind="lib" path="lib/disl/protobuf-lite.jar"/>
<classpathentry kind="output" path="output/build/disl"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DiSL</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -7,7 +7,8 @@
package ch.usi.dag.dislserver;
import ch.usi.dag.dislserver.Protocol.*;
import ch.usi.dag.dislre.protocol.Main.*;
import ch.usi.dag.dislre.protocol.DiSL.*;
import ch.usi.dag.util.logging.Logger;
import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
......@@ -141,7 +142,7 @@ final class ConnectionHandler implements Runnable {
timer.mark (DiSLServer.ElapsedTime.PROCESS);
sendMessage (response, timer);
if (response.getInstrumentClassResponse ().getResult () == Protocol.InstrumentClassResponse.InstrumentClassResult.ERROR) {
if (response.getInstrumentClassResponse ().getResult () == InstrumentClassResponse.InstrumentClassResult.ERROR) {
//
// Error during instrumentation. Report it to the client
// and stop receiving requests from this connection.
......
......@@ -4,9 +4,9 @@ import ch.usi.dag.disl.DiSL;
import ch.usi.dag.disl.DiSL.CodeOption;
import ch.usi.dag.disl.DiSLException;
import ch.usi.dag.disl.JavaNames;
import ch.usi.dag.dislserver.Protocol.ClassInfo;
import ch.usi.dag.dislserver.Protocol.InstrumentClassRequest;
import ch.usi.dag.dislserver.Protocol.InstrumentClassResponse;
import ch.usi.dag.dislre.protocol.DiSL.InstrClassInfo;
import ch.usi.dag.dislre.protocol.DiSL.InstrumentClassRequest;
import ch.usi.dag.dislre.protocol.DiSL.InstrumentClassResponse;
import ch.usi.dag.util.Strings;
import ch.usi.dag.util.logging.Logger;
import com.google.protobuf.ByteString;
......@@ -47,7 +47,7 @@ final class RequestProcessor {
public InstrumentClassResponse process (final InstrumentClassRequest request) {
final byte [] classBytes = request.getClassBytes ().toByteArray ();
final ClassInfo classInfo = request.getClassInfo ();
final InstrClassInfo classInfo = request.getClassInfo ();
final String className = __getClassName (classInfo.getClassName (), classBytes);
final Set <CodeOption> options = CodeOption.setOf (request.getFlags ());
......@@ -82,13 +82,13 @@ final class RequestProcessor {
}
return InstrumentClassResponse.newBuilder ()
.setResult (Protocol.InstrumentClassResponse.InstrumentClassResult.CLASS_MODIFIED)
.setResult (InstrumentClassResponse.InstrumentClassResult.CLASS_MODIFIED)
.setClassBytes (ByteString.copyFrom (newClassBytes))
.build ();
} else {
return InstrumentClassResponse.newBuilder ()
.setResult (Protocol.InstrumentClassResponse.InstrumentClassResult.CLASS_UNMODIFIED)
.setResult (InstrumentClassResponse.InstrumentClassResult.CLASS_UNMODIFIED)
.build ();
}
......@@ -100,7 +100,7 @@ final class RequestProcessor {
__log.error (message);
return InstrumentClassResponse.newBuilder ()
.setResult (Protocol.InstrumentClassResponse.InstrumentClassResult.ERROR)
.setResult (InstrumentClassResponse.InstrumentClassResult.ERROR)
.setErrorMessage (message)
.build ();
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,6 +9,8 @@ import java.nio.channels.ClosedByInterruptException;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import ch.usi.dag.dislre.protocol.Main;
import ch.usi.dag.util.logging.Logger;
......@@ -92,7 +94,7 @@ public abstract class DiSLREServer {
final DataInputStream is = new DataInputStream (
new BufferedInputStream (sock.getInputStream ()));
Protocol.AgentMessage agentMessage;
Main.ClientMessage clientMessage;
int messageSize;
byte[] byteArray;
while (true) {
......@@ -107,9 +109,9 @@ public abstract class DiSLREServer {
is.readFully (byteArray,0, messageSize);
agentMessage = Protocol.AgentMessage.parseFrom (byteArray);
clientMessage = Main.ClientMessage.parseFrom (byteArray);
RequestDispatcher.ProcessMessage (server, agentMessage, __log);
RequestDispatcher.ProcessMessage (server, clientMessage, __log);
}
} catch (final Exception e) {
......
package ch.usi.dag.dislreserver;
import ch.usi.dag.dislreserver.Protocol.*;
import ch.usi.dag.dislre.protocol.Main.*;
import ch.usi.dag.dislre.protocol.Analysis.*;
import ch.usi.dag.util.logging.Logger;
......@@ -15,30 +16,30 @@ final class RequestDispatcher {
* Process the agent message, and pass the unpacked data to {@link SHVM} instance.
*
* @param shadowVM ShadowVM instance to process the requests.
* @param agentMessage The agent message.
* @param clientMessage The agent message.
* @param logger Logger
* @throws DiSLREServerException
*/
static void ProcessMessage(
final SHVM shadowVM, final AgentMessage agentMessage, final Logger logger
final SHVM shadowVM, final ClientMessage clientMessage, final Logger logger
) throws DiSLREServerException
{
switch (agentMessage.getRequestCase ())
switch (clientMessage.getRequestCase ())
{
case ANALYZE:
Analyze analyze = agentMessage.getAnalyze ();
Analyze analyze = clientMessage.getAnalyze ();
shadowVM.HandleAnalyze (
analyze.getOrderingID (),
analyze.getInvocationCount (),
analyze.getRawData ().toByteArray ()
);
break;
case CLOSE:
case CLOSE_CONNECTION:
shadowVM.HandleClose ();
break;
case CLASS_INFO:
ClassInfo classInfo = agentMessage.getClassInfo ();
ClassInfo classInfo = clientMessage.getClassInfo ();
shadowVM.HandleClassInfo (
classInfo.getClassTag (),
classInfo.getClassSignature (),
......@@ -48,7 +49,7 @@ final class RequestDispatcher {
);
break;
case NEW_CLASS:
NewClass newClass = agentMessage.getNewClass ();
NewClass newClass = clientMessage.getNewClass ();
shadowVM.HandleNewClass (
newClass.getClassName (),
newClass.getClassLoaderTag (),
......@@ -56,24 +57,24 @@ final class RequestDispatcher {
);
break;
case THREAD_END:
shadowVM.HandleThreadEnd (agentMessage.getThreadEnd ().getThreadId ());
shadowVM.HandleThreadEnd (clientMessage.getThreadEnd ().getThreadId ());
break;
case REGISTER_ANALYSIS:
RegisterAnalysis registerAnalysis = agentMessage.getRegisterAnalysis ();
RegisterAnalysis registerAnalysis = clientMessage.getRegisterAnalysis ();
shadowVM.HandleRegisterAnalysis (
registerAnalysis.getAnalysisId (),
registerAnalysis.getDescriptor ()
);
break;
case STRING_INFO:
StringInfo stringInfo = agentMessage.getStringInfo ();
StringInfo stringInfo = clientMessage.getStringInfo ();
shadowVM.HandleStringInfo (
stringInfo.getStringTag (),
stringInfo.getStringData ()
);
break;
case THREAD_INFO:
ThreadInfo threadInfo = agentMessage.getThreadInfo ();
ThreadInfo threadInfo = clientMessage.getThreadInfo ();
shadowVM.HandleThreadInfo (
threadInfo.getThreadTag (),
threadInfo.getName (),
......@@ -81,9 +82,9 @@ final class RequestDispatcher {
);
break;
case OBJECT_FREE:
int count = agentMessage.getObjectFree().getCount ();
int count = clientMessage.getObjectFree().getCount ();
long[] ids = new long[count];
byte[] byteArray = agentMessage.getObjectFree ().getRawData ().toByteArray ();
byte[] byteArray = clientMessage.getObjectFree ().getRawData ().toByteArray ();
logger.error (
"Serious error in data transfer: Indicated length (%d) does not match real length (%d)",
......@@ -99,8 +100,8 @@ final class RequestDispatcher {
break;
case REQUEST_NOT_SET:
default:
logger.error (
"Serious problem in data transfer: Unknown type of message from agent"
logger.info (
"Not implemented request case %s", clientMessage.getRequestCase ().name ()
);
}
......
cmake_minimum_required(VERSION 3.13)
project(src_disl_agent C)
set(CMAKE_C_STANDARD 11)
include_directories(.)
include_directories(protocol)
include_directories(../src-jdk-include)
include_directories(../src-jdk-include/macosx)
add_executable(src_disl_agent
protocol/disl.pb-c.c
protocol/disl.pb-c.h
protocol/main.pb-c.c
protocol/main.pb-c.h
protocol/shvm.pb-c.c
protocol/shvm.pb-c.h
bytecode.c
bytecode.h
classparser.c
classparser.h
codeflags.h
common.c
common.h
config.c
config.h
connection.c
connection.h
connpool.c
connpool.h
debug.h
dislagent.c
jvmtiutil.c
jvmtiutil.h
list.h
msgchannel.c
msgchannel.h
network.c
network.h
sessions.c
sessions.h
threads.h)
......@@ -108,12 +108,11 @@ LIBRARY := $(TARGET_DIR)/$(LIBRARY_NAME)
# Source and object files needed to create the library
SOURCES = bytecode.c common.c jvmtiutil.c connection.c \
connpool.c msgchannel.c network.c classparser.c \
dislserver.pb-c.c protobuf-c.c dislagent.c \
sessions.c
dislagent.c sessions.c \
protocol/protobuf-c.c protocol/main.pb-c.c protocol/disl.pb-c.c protocol/shvm.pb-c.c
HEADERS = $(wildcard *.h) codeflags.h dislserver.pb-c.h
GENSRCS = bytecode.c codeflags.h \
dislserver.pb-c.c dislserver.pb-c.h
HEADERS = $(wildcard *.h) codeflags.h $(wildcard protocol/*.h)
GENSRCS = bytecode.c codeflags.h
OBJECTS = $(addprefix $(BUILD_DIR)/,$(SOURCES:%.c=%.o))
SRCDEPS = $(SOURCES:%.c=%.d)
......@@ -182,6 +181,7 @@ bytecode.c codeflags.h:
$(BUILD_DIR):
mkdir $@
mkdir $@/protocol
# Compilation and linking targets
......
......@@ -5,7 +5,7 @@
#include "connection.h"
#include "network.h"
#include "msgchannel.h"
#include "dislserver.pb-c.h"
#include "protocol/main.pb-c.h"
#include "sessions.h"
#include "bytecode.h"
......@@ -188,7 +188,7 @@ __instrument_class (
ClientMessage message = CLIENT_MESSAGE__INIT;
message.session_id = agent_config.session_id;
ClassInfo class_info = CLASS_INFO__INIT;
InstrClassInfo class_info = INSTR_CLASS_INFO__INIT;
class_info.classname = (char *) class_name;
class_info.classloadertag = classloader_tag;
......
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: dislserver.proto */
/* Generated from: disl.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "dislserver.pb-c.h"
#include "disl.pb-c.h"
void error__init
(Error *message)
{
......@@ -52,96 +52,6 @@ void error__free_unpacked
assert(message->base.descriptor == &error__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void session_init_request__init
(SessionInitRequest *message)
{
static const SessionInitRequest init_value = SESSION_INIT_REQUEST__INIT;
*message = init_value;
}
size_t session_init_request__get_packed_size
(const SessionInitRequest *message)
{
assert(message->base.descriptor == &session_init_request__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t session_init_request__pack
(const SessionInitRequest *message,
uint8_t *out)
{
assert(message->base.descriptor == &session_init_request__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t session_init_request__pack_to_buffer
(const SessionInitRequest *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &session_init_request__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
SessionInitRequest *
session_init_request__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (SessionInitRequest *)
protobuf_c_message_unpack (&session_init_request__descriptor,
allocator, len, data);
}
void session_init_request__free_unpacked
(SessionInitRequest *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &session_init_request__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void session_init_response__init
(SessionInitResponse *message)
{
static const SessionInitResponse init_value = SESSION_INIT_RESPONSE__INIT;
*message = init_value;
}
size_t session_init_response__get_packed_size
(const SessionInitResponse *message)
{
assert(message->base.descriptor == &session_init_response__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t session_init_response__pack
(const SessionInitResponse *message,
uint8_t *out)
{
assert(message->base.descriptor == &session_init_response__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t session_init_response__pack_to_buffer
(const SessionInitResponse *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &session_init_response__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
SessionInitResponse *
session_init_response__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (SessionInitResponse *)
protobuf_c_message_unpack (&session_init_response__descriptor,
allocator, len, data);
}
void session_init_response__free_unpacked
(SessionInitResponse *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &session_init_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void instrumentation_delivery__init
(InstrumentationDelivery *message)
{
......@@ -232,49 +142,49 @@ void instrumentation_accept_confirmation__free_unpacked
assert(message->base.descriptor == &instrumentation_accept_confirmation__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void class_info__init
(ClassInfo *message)
void instr_class_info__init
(InstrClassInfo *message)
{
static const ClassInfo init_value = CLASS_INFO__INIT;
static const InstrClassInfo init_value = INSTR_CLASS_INFO__INIT;
*message = init_value;
}
size_t class_info__get_packed_size
(const ClassInfo *message)
size_t instr_class_info__get_packed_size
(const InstrClassInfo *message)
{
assert(message->base.descriptor == &class_info__descriptor);
assert(message->base.descriptor == &instr_class_info__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t class_info__pack
(const ClassInfo *message,
size_t instr_class_info__pack
(const InstrClassInfo *message,
uint8_t *out)
{
assert(message->base.descriptor == &class_info__descriptor);
assert(message->base.descriptor == &instr_class_info__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t class_info__pack_to_buffer
(const ClassInfo *message,
size_t instr_class_info__pack_to_buffer
(const InstrClassInfo *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &class_info__descriptor);
assert(message->base.descriptor == &instr_class_info__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
ClassInfo *
class_info__unpack
InstrClassInfo *
instr_class_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (ClassInfo *)
protobuf_c_message_unpack (&class_info__descriptor,
return (InstrClassInfo *)
protobuf_c_message_unpack (&instr_class_info__descriptor,
allocator, len, data);
}
void class_info__free_unpacked
(ClassInfo *message,
void instr_class_info__free_unpacked
(InstrClassInfo *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &class_info__descriptor);
assert(message->base.descriptor == &instr_class_info__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void instrument_class_request__init
......@@ -367,141 +277,6 @@ void instrument_class_response__free_unpacked
assert(message->base.descriptor == &instrument_class_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void close_connection__init
(CloseConnection *message)
{
static const CloseConnection init_value = CLOSE_CONNECTION__INIT;
*message = init_value;
}
size_t close_connection__get_packed_size
(const CloseConnection *message)
{
assert(message->base.descriptor == &close_connection__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t close_connection__pack
(const CloseConnection *message,
uint8_t *out)
{
assert(message->base.descriptor == &close_connection__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t close_connection__pack_to_buffer
(const CloseConnection *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &close_connection__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
CloseConnection *
close_connection__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (CloseConnection *)
protobuf_c_message_unpack (&close_connection__descriptor,
allocator, len, data);
}
void close_connection__free_unpacked
(CloseConnection *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &close_connection__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void client_message__init
(ClientMessage *message)
{
static const ClientMessage init_value = CLIENT_MESSAGE__INIT;
*message = init_value;
}
size_t client_message__get_packed_size
(const ClientMessage *message)
{
assert(message->base.descriptor == &client_message__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t client_message__pack
(const ClientMessage *message,
uint8_t *out)
{
assert(message->base.descriptor == &client_message__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t client_message__pack_to_buffer
(const ClientMessage *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &client_message__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
ClientMessage *
client_message__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (ClientMessage *)
protobuf_c_message_unpack (&client_message__descriptor,
allocator, len, data);
}
void client_message__free_unpacked
(ClientMessage *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &client_message__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void server_message__init
(ServerMessage *message)
{
static const ServerMessage init_value = SERVER_MESSAGE__INIT;
*message = init_value;
}
size_t server_message__get_packed_size
(const ServerMessage *message)
{
assert(message->base.descriptor == &server_message__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t server_message__pack
(const ServerMessage *message,
uint8_t *out)
{
assert(message->base.descriptor == &server_message__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t server_message__pack_to_buffer
(const ServerMessage *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &server_message__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
ServerMessage *
server_message__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (ServerMessage *)
protobuf_c_message_unpack (&server_message__descriptor,
allocator, len, data);
}
void server_message__free_unpacked
(ServerMessage *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &server_message__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor error__field_descriptors[2] =
{
{
......@@ -553,88 +328,6 @@ const ProtobufCMessageDescriptor error__descriptor =
(ProtobufCMessageInit) error__init,
NULL,NULL,NULL /* reserved[123] */
};
#define session_init_request__field_descriptors NULL