add version API

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-08-31 13:37:00 +08:00
parent 2ccac3fa9c
commit 62ef95ba93
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
@@ -1059,6 +1059,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();