...
 
Commits (4)
<?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;
......@@ -45,9 +45,9 @@ final class RequestProcessor {
//
public InstrumentClassResponse process (final InstrumentClassRequest request) {
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 ();
}
......
# ShadowVM server
The original lightweight implementation of analysis server. It doesn't do
instrumentation, only the analysis is performed.
Its only functionality is to receive the analysis requests and pass them to the
shvm object model library.
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 ()
);
}
......
# Shadow VM server
# Shadow VM object model
This is the ShadowVM object model. The core of the analysis. It only exposes
the public API defined in `src/src-server-api`
## TODO
* Move the whole implementation into new package. Current is `ch.usi.dag.dislreserver`,
which does not makes a sense, since the object model is separated from the server.
......@@ -4,7 +4,7 @@ import java.util.List;
// Each thread has dedicated queue where new tasks are submitted.
public class AnalysisDispatcher {
class AnalysisDispatcher {
// Epoch is used during object free event sending. Each task is assigned
// with current epoch number. When free event arrives it increments the
......@@ -70,7 +70,7 @@ public class AnalysisDispatcher {
ateManager.executorIsEnding(threadId);
}
public void exit() {
void exit() {
// create end of processing analysis task
AnalysisTask at = new AnalysisTask();
......
......@@ -2,8 +2,6 @@ package ch.usi.dag.dislreserver;
import java.util.List;
import ch.usi.dag.dislreserver.AnalysisInvocation;
/**
* Holds unprocessed task data for some thread
*/
......@@ -17,7 +15,7 @@ class AnalysisTask {
/**
* List of invocations in this task
*/
protected List<AnalysisInvocation> invocations;
List<AnalysisInvocation> invocations;
/**
* The epoch determined by objectFree events
......@@ -48,7 +46,7 @@ class AnalysisTask {
return signalsEnd;
}
public List<AnalysisInvocation> getInvocations() {
List<AnalysisInvocation> getInvocations() {
return invocations;
}
......
......@@ -65,7 +65,7 @@ class AnalysisTaskExecutor {
}
}
public synchronized AnalysisTask getTask() throws InterruptedException {
synchronized AnalysisTask getTask() throws InterruptedException {
// executor thread is driving whole executor from this method
// - the state of the executor epoch is updated here
......@@ -114,7 +114,7 @@ class AnalysisTaskExecutor {
}
// works with executorEpoch -> synchronized
public synchronized void globalEpochChanged(long newEpoch) {
synchronized void globalEpochChanged(long newEpoch) {
globalEpoch = newEpoch;
......@@ -123,7 +123,7 @@ class AnalysisTaskExecutor {
}
// works with executorEpoch -> synchronized
public synchronized void waitForEpochProcessing(long epochToProcess)
synchronized void waitForEpochProcessing(long epochToProcess)
throws InterruptedException {
while (true) {
......@@ -141,7 +141,7 @@ class AnalysisTaskExecutor {
}
// await for executor to finish all jobs
public void awaitTermination() throws InterruptedException {
void awaitTermination() throws InterruptedException {
executingThread.join();
}
}
......@@ -5,9 +5,9 @@ package ch.usi.dag.dislreserver;
*/
class AnalysisThread extends Thread {
final protected AnalysisTaskExecutor taskExecutor;
private final AnalysisTaskExecutor taskExecutor;
public AnalysisThread(AnalysisTaskExecutor taskHolder) {
AnalysisThread(AnalysisTaskExecutor taskHolder) {
this.taskExecutor = taskHolder;
}
......
......@@ -2,32 +2,32 @@ package ch.usi.dag.dislreserver;
class ObjectFreeTask {
protected boolean signalsEnd = false;
protected long[] objFreeIDs;
protected long closingEpoch;
private boolean signalsEnd = false;
private long[] objFreeIDs;
private long closingEpoch;
/**
* Constructed task signals end of the processing
*/
public ObjectFreeTask() {
ObjectFreeTask() {
signalsEnd = true;
}
public ObjectFreeTask(long[] objFreeIDs, long closingEpoch) {
ObjectFreeTask(long[] objFreeIDs, long closingEpoch) {
super();
this.objFreeIDs = objFreeIDs;
this.closingEpoch = closingEpoch;
}
public boolean isSignalingEnd() {
boolean isSignalingEnd() {
return signalsEnd;
}
public long[] getObjFreeIDs() {
long[] getObjFreeIDs() {
return objFreeIDs;
}
public long getClosingEpoch() {
long getClosingEpoch() {
return closingEpoch;
}
}
......@@ -14,15 +14,14 @@ import java.util.concurrent.LinkedBlockingQueue;
*/
class ObjectFreeTaskExecutor extends Thread {
final ATEManager ateManager;
private final ATEManager ateManager;
final BlockingQueue<ObjectFreeTask> taskQueue =
new LinkedBlockingQueue<ObjectFreeTask>();
private final BlockingQueue<ObjectFreeTask> taskQueue = new LinkedBlockingQueue<ObjectFreeTask>();
/**
* Current shadow VM context.
*/
final SHVMContext __shvmContext;
private final SHVMContext __shvmContext;
/**
......
......@@ -16,11 +16,11 @@ import ch.usi.dag.util.logging.Logger;
*
* Takes care of handling the requests to analysis invocations.
*/
public final class AnalysisHandler {
final class AnalysisHandler {
private AnalysisDispatcher dispatcher;
public AnalysisDispatcher getDispatcher() {
AnalysisDispatcher getDispatcher() {
return dispatcher;
}
......@@ -46,7 +46,7 @@ public final class AnalysisHandler {
* @param is Input stream with the rest of the data.
* @throws DiSLREServerException
*/
public void handle (final long orderingID, final int invocationCount, final DataInputStream is)
void handle (final long orderingID, final int invocationCount, final DataInputStream is)
throws DiSLREServerException
{
......@@ -216,7 +216,7 @@ public final class AnalysisHandler {
dispatcher.objectsFreedEvent(objFreeIDs);
}
public void exit() {
void exit() {
dispatcher.exit();
}
}
......@@ -3,7 +3,7 @@ package ch.usi.dag.dislreserver;
import java.lang.reflect.Method;
public final class AnalysisInvocation {
final class AnalysisInvocation {
private final Method __method;
private final Object __target;
......@@ -11,7 +11,7 @@ public final class AnalysisInvocation {
//
public AnalysisInvocation (
AnalysisInvocation (
final Method method, final Object target, final Object [] args
) {
__method = method;
......@@ -19,7 +19,7 @@ public final class AnalysisInvocation {
__args = args;
}
public void invoke () {
void invoke () {
try {
__method.invoke (__target, __args);
......
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.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
......
# DiSL instrumentation agent
## Usage
### Options
* `disl.instrumentation` - As an argument takes list of paths to instrumentation
jars, separated by `:`
* `disl.bypass` - Sets the bypass. Options are `dynamic`, `never` and `bootstrap`
more of them -> here
* `disl.splitmethods` - default is true
* `disl.excepthandler` - default is false
* `disl.forceinterface` - default false
* `disl.forcesuperclass` - default false
* `debug`
\ No newline at end of file
/**
* This file is part of src_disl_agent
*
* Created by Vít Kabele on 25/11/2018.
*/
#include "config.h"
......@@ -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
#define session_init_request__field_indices_by_name NULL
#define session_init_request__number_ranges NULL
const ProtobufCMessageDescriptor session_init_request__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"SessionInitRequest",
"SessionInitRequest",
"SessionInitRequest",
"",
sizeof(SessionInitRequest),
0,
session_init_request__field_descriptors,
session_init_request__field_indices_by_name,
0, session_init_request__number_ranges,
(ProtobufCMessageInit) session_init_request__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor session_init_response__field_descriptors[3] =
{
{
"accepted",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BOOL,
0, /* quantifier_offset */
offsetof(SessionInitResponse, accepted),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"session_id",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
offsetof(SessionInitResponse, session_id),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"errors",
3,
PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(SessionInitResponse, n_errors),
offsetof(SessionInitResponse, errors),
&error__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned session_init_response__field_indices_by_name[] = {
0, /* field[0] = accepted */
2, /* field[2] = errors */
1, /* field[1] = session_id */
};
static const ProtobufCIntRange session_init_response__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor session_init_response__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"SessionInitResponse",
"SessionInitResponse",
"SessionInitResponse",
"",
sizeof(SessionInitResponse),
3,
session_init_response__field_descriptors,
session_init_response__field_indices_by_name,
1, session_init_response__number_ranges,
(ProtobufCMessageInit) session_init_response__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor instrumentation_delivery__field_descriptors[2] =
{
{
......@@ -737,7 +430,7 @@ const ProtobufCMessageDescriptor instrumentation_accept_confirmation__descriptor
(ProtobufCMessageInit) instrumentation_accept_confirmation__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor class_info__field_descriptors[2] =
static const ProtobufCFieldDescriptor instr_class_info__field_descriptors[2] =
{
{
"className",
......@@ -745,7 +438,7 @@ static const ProtobufCFieldDescriptor class_info__field_descriptors[2] =
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(ClassInfo, classname),
offsetof(InstrClassInfo, classname),
NULL,
&protobuf_c_empty_string,
0, /* flags */
......@@ -757,35 +450,35 @@ static const ProtobufCFieldDescriptor class_info__field_descriptors[2] =
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_INT64,
0, /* quantifier_offset */
offsetof(ClassInfo, classloadertag),
offsetof(InstrClassInfo, classloadertag),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned class_info__field_indices_by_name[] = {
static const unsigned instr_class_info__field_indices_by_name[] = {
1, /* field[1] = classLoaderTag */
0, /* field[0] = className */
};
static const ProtobufCIntRange class_info__number_ranges[1 + 1] =
static const ProtobufCIntRange instr_class_info__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor class_info__descriptor =
const ProtobufCMessageDescriptor instr_class_info__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"ClassInfo",
"ClassInfo",
"ClassInfo",
"InstrClassInfo",
"InstrClassInfo",
"InstrClassInfo",
"",
sizeof(ClassInfo),
sizeof(InstrClassInfo),
2,
class_info__field_descriptors,
class_info__field_indices_by_name,
1, class_info__number_ranges,
(ProtobufCMessageInit) class_info__init,
instr_class_info__field_descriptors,
instr_class_info__field_indices_by_name,
1, instr_class_info__number_ranges,
(ProtobufCMessageInit) instr_class_info__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor instrument_class_request__field_descriptors[4] =
......@@ -821,7 +514,7 @@ static const ProtobufCFieldDescriptor instrument_class_request__field_descriptor
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(InstrumentClassRequest, classinfo),
&class_info__descriptor,
&instr_class_info__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
......@@ -833,7 +526,7 @@ static const ProtobufCFieldDescriptor instrument_class_request__field_descriptor
PROTOBUF_C_TYPE_MESSAGE,
offsetof(InstrumentClassRequest, n_supertypes),
offsetof(InstrumentClassRequest, supertypes),
&class_info__descriptor,
&instr_class_info__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
......@@ -960,221 +653,3 @@ const ProtobufCMessageDescriptor instrument_class_response__descriptor =
(ProtobufCMessageInit) instrument_class_response__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCEnumValue close_connection__close_reason__enum_values_by_number[1] =
{
{ "FINISHED", "CLOSE_CONNECTION__CLOSE_REASON__FINISHED", 0 },
};
static const ProtobufCIntRange close_connection__close_reason__value_ranges[] = {
{0, 0},{0, 1}
};
static const ProtobufCEnumValueIndex close_connection__close_reason__enum_values_by_name[1] =
{
{ "FINISHED", 0 },
};
const ProtobufCEnumDescriptor close_connection__close_reason__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"CloseConnection.CloseReason",
"CloseReason",
"CloseConnection__CloseReason",
"",
1,
close_connection__close_reason__enum_values_by_number,
1,
close_connection__close_reason__enum_values_by_name,
1,
close_connection__close_reason__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};
static const ProtobufCFieldDescriptor close_connection__field_descriptors[1] =
{
{
"reason",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(CloseConnection, reason),
&close_connection__close_reason__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned close_connection__field_indices_by_name[] = {
0, /* field[0] = reason */
};
static const ProtobufCIntRange close_connection__number_ranges[1 + 1] =
{
{ 2, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor close_connection__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"CloseConnection",
"CloseConnection",
"CloseConnection",
"",
sizeof(CloseConnection),
1,
close_connection__field_descriptors,
close_connection__field_indices_by_name,
1, close_connection__number_ranges,
(ProtobufCMessageInit) close_connection__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor client_message__field_descriptors[5] =
{
{
"session_id",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
offsetof(ClientMessage, session_id),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"session_init_request",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(ClientMessage, request_case),
offsetof(ClientMessage, session_init_request),
&session_init_request__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"instrumentation_delivery",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(ClientMessage, request_case),
offsetof(ClientMessage, instrumentation_delivery),
&instrumentation_delivery__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"instrument_class_request",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(ClientMessage, request_case),
offsetof(ClientMessage, instrument_class_request),
&instrument_class_request__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"close_connection",
5,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(ClientMessage, request_case),
offsetof(ClientMessage, close_connection),
&close_connection__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned client_message__field_indices_by_name[] = {
4, /* field[4] = close_connection */
3, /* field[3] = instrument_class_request */
2, /* field[2] = instrumentation_delivery */
0, /* field[0] = session_id */
1, /* field[1] = session_init_request */
};
static const ProtobufCIntRange client_message__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 5 }
};
const ProtobufCMessageDescriptor client_message__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"ClientMessage",
"ClientMessage",
"ClientMessage",
"",
sizeof(ClientMessage),
5,
client_message__field_descriptors,
client_message__field_indices_by_name,
1, client_message__number_ranges,
(ProtobufCMessageInit) client_message__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor server_message__field_descriptors[3] =
{
{
"session_init_response",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(ServerMessage, response_case),
offsetof(ServerMessage, session_init_response),
&session_init_response__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"instrumentation_accept_confirmation",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(ServerMessage, response_case),
offsetof(ServerMessage, instrumentation_accept_confirmation),
&instrumentation_accept_confirmation__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"instrument_class_response",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(ServerMessage, response_case),
offsetof(ServerMessage, instrument_class_response),
&instrument_class_response__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned server_message__field_indices_by_name[] = {
2, /* field[2] = instrument_class_response */
1, /* field[1] = instrumentation_accept_confirmation */
0, /* field[0] = session_init_response */
};
static const ProtobufCIntRange server_message__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor server_message__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"ServerMessage",
"ServerMessage",
"ServerMessage",
"",
sizeof(ServerMessage),
3,
server_message__field_descriptors,
server_message__field_indices_by_name,
1, server_message__number_ranges,
(ProtobufCMessageInit) server_message__init,
NULL,NULL,NULL /* reserved[123] */
};
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: dislserver.proto */
/* Generated from: disl.proto */
#ifndef PROTOBUF_C_dislserver_2eproto__INCLUDED
#define PROTOBUF_C_dislserver_2eproto__INCLUDED
#ifndef PROTOBUF_C_disl_2eproto__INCLUDED
#define PROTOBUF_C_disl_2eproto__INCLUDED
#include "protobuf-c.h"
......@@ -16,16 +16,11 @@ PROTOBUF_C__BEGIN_DECLS
typedef struct _Error Error;
typedef struct _SessionInitRequest SessionInitRequest;
typedef struct _SessionInitResponse SessionInitResponse;
typedef struct _InstrumentationDelivery InstrumentationDelivery;
typedef struct _InstrumentationAcceptConfirmation InstrumentationAcceptConfirmation;
typedef struct _ClassInfo ClassInfo;
typedef struct _InstrClassInfo InstrClassInfo;
typedef struct _InstrumentClassRequest InstrumentClassRequest;
typedef struct _InstrumentClassResponse InstrumentClassResponse;
typedef struct _CloseConnection CloseConnection;
typedef struct _ClientMessage ClientMessage;
typedef struct _ServerMessage ServerMessage;
/* --- enums --- */
......@@ -36,10 +31,6 @@ typedef enum _InstrumentClassResponse__InstrumentClassResult {
INSTRUMENT_CLASS_RESPONSE__INSTRUMENT_CLASS_RESULT__ERROR = 3
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(INSTRUMENT_CLASS_RESPONSE__INSTRUMENT_CLASS_RESULT)
} InstrumentClassResponse__InstrumentClassResult;
typedef enum _CloseConnection__CloseReason {
CLOSE_CONNECTION__CLOSE_REASON__FINISHED = 0
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(CLOSE_CONNECTION__CLOSE_REASON)
} CloseConnection__CloseReason;
/* --- messages --- */
......@@ -57,38 +48,6 @@ struct _Error
, 0, (char *)protobuf_c_empty_string }
/*
* Request server to initialize session
* This is sent as the clients first message
* May contain some additional data to describe the client (JVM version etc.)
*/
struct _SessionInitRequest
{
ProtobufCMessage base;
};
#define SESSION_INIT_REQUEST__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&session_init_request__descriptor) \
}
/*
* This is the response to SessionInitRequest message
* The request could either be ACCEPTed or DENYed
* In the case of positive answer, there is also a session_id present
*/
struct _SessionInitResponse
{
ProtobufCMessage base;
protobuf_c_boolean accepted;
int32_t session_id;
size_t n_errors;
Error **errors;
};
#define SESSION_INIT_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&session_init_response__descriptor) \
, 0, 0, 0,NULL }
/*
* When the client obtains the session_id, next step should be sending
* the instrumentation jar (or more of them) to the instrumentation server.
......@@ -120,14 +79,14 @@ struct _InstrumentationAcceptConfirmation
, 0, 0,NULL }
struct _ClassInfo
struct _InstrClassInfo
{
ProtobufCMessage base;
char *classname;
int64_t classloadertag;
};
#define CLASS_INFO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&class_info__descriptor) \
#define INSTR_CLASS_INFO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&instr_class_info__descriptor) \
, (char *)protobuf_c_empty_string, 0 }
......@@ -138,10 +97,10 @@ struct _InstrumentClassRequest
{
ProtobufCMessage base;
int32_t flags;
ClassInfo *classinfo;
InstrClassInfo *classinfo;
ProtobufCBinaryData classbytes;
size_t n_supertypes;
ClassInfo **supertypes;
InstrClassInfo **supertypes;
};
#define INSTRUMENT_CLASS_REQUEST__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&instrument_class_request__descriptor) \
......@@ -163,74 +122,6 @@ struct _InstrumentClassResponse
, INSTRUMENT_CLASS_RESPONSE__INSTRUMENT_CLASS_RESULT__CLASS_UNMODIFIED, (char *)protobuf_c_empty_string, {0,NULL} }
/*
* Notify server about closing connection
*/
struct _CloseConnection
{
ProtobufCMessage base;
CloseConnection__CloseReason reason;
};
#define CLOSE_CONNECTION__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&close_connection__descriptor) \
, CLOSE_CONNECTION__CLOSE_REASON__FINISHED }
typedef enum {
CLIENT_MESSAGE__REQUEST__NOT_SET = 0,
CLIENT_MESSAGE__REQUEST_SESSION_INIT_REQUEST = 2,
CLIENT_MESSAGE__REQUEST_INSTRUMENTATION_DELIVERY = 3,
CLIENT_MESSAGE__REQUEST_INSTRUMENT_CLASS_REQUEST = 4,
CLIENT_MESSAGE__REQUEST_CLOSE_CONNECTION = 5
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(CLIENT_MESSAGE__REQUEST)
} ClientMessage__RequestCase;
/*
* Pack together messages from client to simply distinguish them at the server side.
*/
struct _ClientMessage
{
ProtobufCMessage base;
int32_t session_id;
ClientMessage__RequestCase request_case;
union {
SessionInitRequest *session_init_request;
InstrumentationDelivery *instrumentation_delivery;
InstrumentClassRequest *instrument_class_request;
CloseConnection *close_connection; </