comparison ie-docker.h @ 13:8e1f57c91210

add port manager to ie-docker.
author taira
date Tue, 03 Feb 2015 16:49:48 +0900
parents
children 855a5e399f6e
comparison
equal deleted inserted replaced
12:1730494d9ecc 13:8e1f57c91210
1 /* Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License */
2 #ifndef IE_DOCKER
3
4 #define command "/usr/bin/docker"
5 #define ps_command "/usr/bin/docker ps -a"
6 #define run_command "run"
7 #define build_command "build"
8 #define attach_command "attach"
9 #define dettach_command "dettach"
10 // #define pull_command "pull" /* download docker image command */
11 #define images_command "images" /* list images command */
12 #define commit_command "commit" /* make image command */
13 #define rm_command "rm" /* remove container command */
14 #define rmi_command "rmi" /* remove image command */
15 #define start_command "start"
16 #define stop_command "stop"
17 #define exec_command "exec"
18
19 #define create_command "create"
20
21 /* Define global variables */
22
23 static char bad_name[] = "Bad process name. Try students_e11_e115711_01 or teachers_kono_02\n";
24
25 const char *guests[] = {"mata"};
26 const char *managers[] = {"taira"};
27 const char students_sym[] = "students";
28 const char managers_sym[] = "managers";
29 const char guests_sym[] = "guests";
30 const char delimiter[] = "_";
31 const char portlist_file[] = "/crhome/taira/hg/docker-wrapper/iedockerport.list";
32
33 enum {
34 NAME_LENGTH = 50,
35 PS_NAME_LENGTH = 50,
36 RUN_COMMAND_LENGTH = 1024,
37 PORT_LENGTH = 16,
38 BUFF_SIZE = 50
39 };
40
41 enum {
42 STUDENTS,
43 GUESTS,
44 MANAGERS
45 };
46
47 #define PSNAME_MAX (512)
48
49 typedef struct pslist {
50 char name[PSNAME_MAX];
51 struct pslist *next;
52 } PSLIST, *PSLISTPTR;
53
54 #define NEW(type) ((type*)malloc(sizeof(type)))
55
56 /* docker run option
57 * -t tty
58 * --name [process name]
59 * -v volume
60 * -m memory
61 * image name
62 * -i skeep open tdin
63 */
64
65 enum {
66 FALSE = 0,
67 TRUE = 1
68 };
69
70 typedef struct run_command_opt_t {
71 char memory[16];
72 char innerport[PORT_LENGTH];
73 char outerport[PORT_LENGTH]; // system decide port number
74 int tty; // true = 1; false = 0
75 int dettach; // true = 1; false = 0
76 int interactive; // true = 1; false = 0
77 char ps_name[64]; // user decide name
78 char exec_ps_command[64]; //
79 char volume[128];
80 char image_name[16];
81 } run_command_opt;
82
83 #endif /* IE_DOCKER */