Merge pull request #152 from laijs/api-version

add version API
This commit is contained in:
Gao feng
2016-09-01 14:37:59 +08:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+3 -1
View File
@@ -14,8 +14,10 @@
#include "container.h"
#include "portmapping.h"
#define APIVERSION 4242
enum {
RESERVED,
GETVERSION,
STARTPOD,
GETPOD,
STOPPOD,
+5
View File
@@ -1064,6 +1064,11 @@ static int hyper_channel_handle(struct hyper_event *de, uint32_t len)
pod->type = type;
switch (type) {
case GETVERSION:
data = malloc(4);
datalen = 4;
hyper_set_be32(data, APIVERSION);
break;
case STARTPOD:
ret = hyper_start_pod((char *)buf->data + 8, len - 8);
hyper_print_uptime();