shim_ipc.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. /* Copyright (C) 2014 Stony Brook University
  2. This file is part of Graphene Library OS.
  3. Graphene Library OS is free software: you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public License
  5. as published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. Graphene Library OS is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. /*
  14. * shim_ipc.h
  15. *
  16. * Definitions of types and functions for IPC bookkeeping.
  17. */
  18. #ifndef _SHIM_IPC_H_
  19. #define _SHIM_IPC_H_
  20. #include <shim_types.h>
  21. #include <shim_defs.h>
  22. #include <shim_handle.h>
  23. #include <shim_thread.h>
  24. #include <shim_sysv.h>
  25. #include <pal.h>
  26. #include <list.h>
  27. DEFINE_LIST(shim_ipc_info);
  28. struct shim_ipc_info {
  29. IDTYPE vmid;
  30. struct shim_ipc_port * port;
  31. PAL_HANDLE pal_handle;
  32. struct shim_qstr uri;
  33. LIST_TYPE(shim_ipc_info) hlist;
  34. REFTYPE ref_count;
  35. };
  36. enum { PID_NS, SYSV_NS, TOTAL_NS };
  37. struct shim_process {
  38. IDTYPE vmid;
  39. struct shim_lock lock;
  40. int exit_code;
  41. struct shim_ipc_info * self, * parent;
  42. struct shim_ipc_info * ns[TOTAL_NS];
  43. };
  44. extern struct shim_process cur_process;
  45. #define IPC_MSG_MINIMAL_SIZE 48
  46. struct shim_ipc_msg {
  47. unsigned char code;
  48. unsigned int size;
  49. IDTYPE src, dst;
  50. unsigned long seq;
  51. #ifdef PROFILE
  52. unsigned long time;
  53. #endif
  54. char msg[];
  55. } __attribute__((packed));
  56. struct shim_ipc_port;
  57. struct shim_thread;
  58. DEFINE_LIST(shim_ipc_msg_obj);
  59. struct shim_ipc_msg_obj {
  60. struct shim_thread * thread;
  61. LIST_TYPE(shim_ipc_msg_obj) list;
  62. int retval;
  63. void * private;
  64. struct shim_ipc_msg msg;
  65. };
  66. typedef void (*port_fini) (struct shim_ipc_port *, IDTYPE vmid,
  67. unsigned int exitcode);
  68. #define MAX_IPC_PORT_FINI_CB 3
  69. DEFINE_LIST(shim_ipc_port);
  70. DEFINE_LISTP(shim_ipc_msg_obj);
  71. struct shim_ipc_port {
  72. PAL_HANDLE pal_handle;
  73. REFTYPE ref_count;
  74. LIST_TYPE(shim_ipc_port) list;
  75. LISTP_TYPE(shim_ipc_msg_obj) msgs;
  76. struct shim_lock msgs_lock;
  77. port_fini fini[MAX_IPC_PORT_FINI_CB];
  78. IDTYPE type;
  79. IDTYPE vmid;
  80. };
  81. #define IPC_CALLBACK_ARGS \
  82. struct shim_ipc_msg * msg, struct shim_ipc_port * port
  83. /* if callback return RESPONSE_CALLBACK, send a response even if the callback
  84. succeed. */
  85. #define RESPONSE_CALLBACK 1
  86. typedef int (*ipc_callback) (IPC_CALLBACK_ARGS);
  87. /* Messagge code to response the connection */
  88. enum {
  89. IPC_RESP = 0,
  90. IPC_FINDURI,
  91. IPC_TELLURI,
  92. IPC_CHECKPOINT,
  93. IPC_BASE_BOUND,
  94. };
  95. /* IPC_RESP: response for incoming messages */
  96. struct shim_ipc_resp {
  97. int retval;
  98. } __attribute__((packed));
  99. /* IPC_FINDURI: request a URI from a connect process */
  100. int ipc_finduri_send (struct shim_ipc_port * port, IDTYPE dest,
  101. struct shim_ipc_info ** info);
  102. int ipc_finduri_callback (IPC_CALLBACK_ARGS);
  103. /* IPC_TELLURI: replying with a connectable URI */
  104. struct shim_ipc_telluri {
  105. char uri[1];
  106. } __attribute__((packed));
  107. int ipc_telluri_send (struct shim_ipc_port * port, IDTYPE dest,
  108. struct shim_ipc_info * info);
  109. int ipc_telluri_callback (IPC_CALLBACK_ARGS);
  110. /* PID_CHECKPOINT: broadcast checkpointing */
  111. struct shim_ipc_checkpoint {
  112. IDTYPE cpsession;
  113. char cpdir[1];
  114. } __attribute__((packed));
  115. int ipc_checkpoint_send (const char * cpdir, IDTYPE cpsession);
  116. int ipc_checkpoint_callback (IPC_CALLBACK_ARGS);
  117. /* Message code from child to parent */
  118. #define IPC_CLD_BASE IPC_BASE_BOUND
  119. enum {
  120. IPC_CLD_EXIT = IPC_CLD_BASE,
  121. IPC_CLD_JOIN,
  122. #ifdef PROFILE
  123. IPC_CLD_PROFILE,
  124. #endif
  125. IPC_CLD_BOUND,
  126. };
  127. /* CLD_EXIT: thread exit */
  128. struct shim_ipc_cld_exit {
  129. IDTYPE ppid, tid;
  130. unsigned int exitcode;
  131. unsigned int term_signal;
  132. #ifdef PROFILE
  133. unsigned long time;
  134. #endif
  135. } __attribute__((packed));
  136. int ipc_cld_exit_send (IDTYPE ppid, IDTYPE tid, unsigned int exitcode, unsigned int term_signal);
  137. int ipc_cld_exit_callback (IPC_CALLBACK_ARGS);
  138. /* CLD_JOIN: child join the parent group */
  139. int ipc_cld_join_send (IDTYPE dest);
  140. int ipc_cld_join_callback (IPC_CALLBACK_ARGS);
  141. #ifdef PROFILE
  142. # include <shim_profile.h>
  143. struct shim_ipc_cld_profile {
  144. unsigned long time;
  145. int nprofile;
  146. struct profile_val profile[];
  147. } __attribute__((packed));
  148. int ipc_cld_profile_send (void);
  149. int ipc_cld_profile_callback (IPC_CALLBACK_ARGS);
  150. #endif
  151. /* Message code to namespace manager */
  152. #define IPC_PID_BASE IPC_CLD_BOUND
  153. #define NS pid
  154. #define NS_CAP PID
  155. #include "shim_ipc_ns.h"
  156. enum {
  157. IPC_PID_KILL = IPC_PID_TEMPLATE_BOUND,
  158. IPC_PID_GETSTATUS,
  159. IPC_PID_RETSTATUS,
  160. IPC_PID_GETMETA,
  161. IPC_PID_RETMETA,
  162. IPC_PID_NOP,
  163. IPC_PID_SENDRPC,
  164. IPC_PID_BOUND,
  165. };
  166. enum kill_type { KILL_THREAD, KILL_PROCESS, KILL_PGROUP, KILL_ALL };
  167. /* PID_KILL: send signal to certain pid */
  168. struct shim_ipc_pid_kill {
  169. IDTYPE sender;
  170. enum kill_type type;
  171. IDTYPE id;
  172. int signum;
  173. } __attribute__((packed));
  174. int ipc_pid_kill_send (IDTYPE sender, IDTYPE id, enum kill_type type,
  175. int signum);
  176. int ipc_pid_kill_callback (IPC_CALLBACK_ARGS);
  177. struct pid_status {
  178. IDTYPE pid, tgid, pgid;
  179. } __attribute__((packed));
  180. /* PID_GETSTATUS: check if certain pid(s) exists */
  181. struct shim_ipc_pid_getstatus {
  182. int npids;
  183. IDTYPE pids[];
  184. } __attribute__((packed));
  185. int ipc_pid_getstatus_send (struct shim_ipc_port * port, IDTYPE dest,
  186. int npids, IDTYPE * pids,
  187. struct pid_status ** status);
  188. int ipc_pid_getstatus_callback (IPC_CALLBACK_ARGS);
  189. /* PID_RETSTATUS: return status of pid(s) */
  190. struct shim_ipc_pid_retstatus {
  191. int nstatus;
  192. struct pid_status status[];
  193. } __attribute__((packed));
  194. int ipc_pid_retstatus_send (struct shim_ipc_port * port, IDTYPE dest,
  195. int nstatus, struct pid_status * status,
  196. unsigned long seq);
  197. int ipc_pid_retstatus_callback (IPC_CALLBACK_ARGS);
  198. /* PID_GETMETA: get metadata of certain pid */
  199. enum pid_meta_code {
  200. PID_META_CRED,
  201. PID_META_EXEC,
  202. PID_META_CWD,
  203. PID_META_ROOT,
  204. };
  205. struct shim_ipc_pid_getmeta {
  206. IDTYPE pid;
  207. enum pid_meta_code code;
  208. } __attribute__((packed));
  209. int ipc_pid_getmeta_send (IDTYPE pid, enum pid_meta_code code,
  210. void ** data);
  211. int ipc_pid_getmeta_callback (IPC_CALLBACK_ARGS);
  212. /* PID_RETMETA: return metadata of certain pid */
  213. struct shim_ipc_pid_retmeta {
  214. IDTYPE pid;
  215. enum pid_meta_code code;
  216. int datasize;
  217. char data[];
  218. } __attribute__((packed));
  219. int ipc_pid_retmeta_send (struct shim_ipc_port * port, IDTYPE dest,
  220. IDTYPE pid, enum pid_meta_code code,
  221. const void * data, int datasize,
  222. unsigned long seq);
  223. int ipc_pid_retmeta_callback (IPC_CALLBACK_ARGS);
  224. /* PID_NOP: send junk message (for benchmarking) */
  225. struct shim_ipc_pid_nop {
  226. int count;
  227. char payload[];
  228. } __attribute__((packed));
  229. int ipc_pid_nop_send (struct shim_ipc_port * port, IDTYPE dest, int count,
  230. const void * buf, int len);
  231. int ipc_pid_nop_callback(IPC_CALLBACK_ARGS);
  232. /* PID_SENDRPC: send arbitary message (for benchmarking) */
  233. struct shim_ipc_pid_sendrpc {
  234. IDTYPE sender;
  235. int len;
  236. char payload[];
  237. } __attribute__((packed));
  238. int ipc_pid_sendrpc_send (IDTYPE pid, IDTYPE sender, const void * buf,
  239. int len);
  240. int ipc_pid_sendrpc_callback (IPC_CALLBACK_ARGS);
  241. #define IPC_SYSV_BASE IPC_PID_BOUND
  242. struct sysv_key {
  243. unsigned long key;
  244. enum sysv_type type;
  245. };
  246. #define NS sysv
  247. #define NS_CAP SYSV
  248. #define NS_KEY struct sysv_key
  249. #include "shim_ipc_ns.h"
  250. enum {
  251. IPC_SYSV_DELRES = IPC_SYSV_TEMPLATE_BOUND,
  252. IPC_SYSV_MOVRES,
  253. IPC_SYSV_MSGSND,
  254. IPC_SYSV_MSGRCV,
  255. IPC_SYSV_MSGMOV,
  256. IPC_SYSV_SEMOP,
  257. IPC_SYSV_SEMCTL,
  258. IPC_SYSV_SEMRET,
  259. IPC_SYSV_SEMMOV,
  260. #ifdef USE_SHARED_SEMAPHORE
  261. IPC_SYSV_SEMQUERY,
  262. IPC_SYSV_SEMREPLY,
  263. #endif
  264. IPC_SYSV_BOUND,
  265. };
  266. /* SYSV_DELRES */
  267. struct shim_ipc_sysv_delres {
  268. IDTYPE resid;
  269. enum sysv_type type;
  270. } __attribute__((packed));
  271. int ipc_sysv_delres_send (struct shim_ipc_port * port, IDTYPE dest,
  272. IDTYPE resid, enum sysv_type type);
  273. int ipc_sysv_delres_callback (IPC_CALLBACK_ARGS);
  274. /* SYSV_MOVRES */
  275. struct shim_ipc_sysv_movres {
  276. IDTYPE resid;
  277. enum sysv_type type;
  278. IDTYPE owner;
  279. LEASETYPE lease;
  280. char uri[1];
  281. } __attribute__((packed));
  282. int ipc_sysv_movres_send (struct sysv_client * client, IDTYPE owner,
  283. const char * uri, LEASETYPE lease, IDTYPE resid,
  284. enum sysv_type type);
  285. int ipc_sysv_movres_callback (IPC_CALLBACK_ARGS);
  286. /* SYSV_MSGSND */
  287. struct shim_ipc_sysv_msgsnd {
  288. IDTYPE msgid;
  289. long msgtype;
  290. char msg[];
  291. } __attribute__((packed));
  292. int ipc_sysv_msgsnd_send (struct shim_ipc_port * port, IDTYPE dest,
  293. IDTYPE msgid, long msgtype,
  294. const void * buf, size_t size, unsigned long seq);
  295. int ipc_sysv_msgsnd_callback (IPC_CALLBACK_ARGS);
  296. /* SYSV_MSGRCV */
  297. struct shim_ipc_sysv_msgrcv {
  298. IDTYPE msgid;
  299. long msgtype;
  300. size_t size;
  301. int flags;
  302. } __attribute__((packed));
  303. int ipc_sysv_msgrcv_send (IDTYPE msgid, long msgtype, int flags, void * buf,
  304. size_t size);
  305. int ipc_sysv_msgrcv_callback (IPC_CALLBACK_ARGS);
  306. /* SYSV_MSGMOV */
  307. struct shim_ipc_sysv_msgmov {
  308. IDTYPE msgid;
  309. LEASETYPE lease;
  310. unsigned short nscores;
  311. struct sysv_score scores[];
  312. } __attribute__((packed));
  313. int ipc_sysv_msgmov_send (struct shim_ipc_port * port, IDTYPE dest,
  314. IDTYPE msgid, LEASETYPE lease,
  315. struct sysv_score * scores, int nscores);
  316. int ipc_sysv_msgmov_callback (IPC_CALLBACK_ARGS);
  317. /* SYSV_SEMOP */
  318. struct shim_ipc_sysv_semop {
  319. IDTYPE semid;
  320. unsigned long timeout;
  321. int nsops;
  322. struct sembuf sops[];
  323. } __attribute__((packed));
  324. #define IPC_SEM_NOTIMEOUT ((unsigned long)-1)
  325. int ipc_sysv_semop_send (IDTYPE semid, struct sembuf * sops, int nsops,
  326. unsigned long timeout, unsigned long * seq);
  327. int ipc_sysv_semop_callback (IPC_CALLBACK_ARGS);
  328. /* SYSV_SEMCTL */
  329. struct shim_ipc_sysv_semctl {
  330. IDTYPE semid;
  331. int semnum;
  332. int cmd;
  333. size_t valsize;
  334. unsigned char vals[];
  335. } __attribute__((packed));
  336. int ipc_sysv_semctl_send (IDTYPE semid, int semnum, int cmd, void * vals,
  337. size_t valsize);
  338. int ipc_sysv_semctl_callback (IPC_CALLBACK_ARGS);
  339. /* SYSV_SEMRET */
  340. struct shim_ipc_sysv_semret {
  341. size_t valsize;
  342. unsigned char vals[];
  343. } __attribute__((packed));
  344. int ipc_sysv_semret_send (struct shim_ipc_port * port, IDTYPE dest,
  345. void * vals, size_t valsize, unsigned long seq);
  346. int ipc_sysv_semret_callback (IPC_CALLBACK_ARGS);
  347. /* SYSV_SEMMOV */
  348. struct shim_ipc_sysv_semmov {
  349. IDTYPE semid;
  350. LEASETYPE lease;
  351. unsigned short nsems, nsrcs, nscores;
  352. struct sem_backup sems[];
  353. } __attribute__((packed));
  354. int ipc_sysv_semmov_send (struct shim_ipc_port * port, IDTYPE dest,
  355. IDTYPE semid, LEASETYPE lease,
  356. struct sem_backup * sems, int nsems,
  357. struct sem_client_backup * srcs, int nsrcs,
  358. struct sysv_score * scores, int nscores);
  359. int ipc_sysv_semmov_callback (IPC_CALLBACK_ARGS);
  360. #ifdef USE_SHARED_SEMAPHORE
  361. /* SYSV_SEMQUERY */
  362. struct shim_ipc_sysv_semquery {
  363. IDTYPE semid;
  364. } __attribute__((packed));
  365. int ipc_sysv_semquery_send (IDTYPE semid, int * nsems, PAL_NUM ** host_sem_ids);
  366. int ipc_sysv_semquery_callback (IPC_CALLBACK_ARGS);
  367. /* SYSV_SEMREPLY */
  368. struct shim_ipc_sysv_semreply {
  369. IDTYPE semid;
  370. int nsems;
  371. PAL_NUM host_sem_ids[];
  372. } __attribute__((packed));
  373. int ipc_sysv_semreply_send (struct shim_ipc_port * port, IDTYPE dest,
  374. IDTYPE semid, int nsems, PAL_NUM * host_sem_ids,
  375. unsigned long seq);
  376. int ipc_sysv_semreply_callback (IPC_CALLBACK_ARGS);
  377. #endif
  378. #define IPC_CODE_NUM IPC_SYSV_BOUND
  379. /* functions and routines */
  380. int init_ipc (void);
  381. int init_ipc_helper (void);
  382. struct shim_process * create_new_process (bool inherit_parent);
  383. void destroy_process (struct shim_process * proc);
  384. struct shim_ipc_info * create_ipc_port (IDTYPE vmid, bool listen);
  385. int create_ipc_location (struct shim_ipc_info ** pinfo);
  386. enum {
  387. LISTEN=0, /* listening */
  388. SERVER, /* connect as a server */
  389. KEEPALIVE, /* keep the connetion alive */
  390. DIRCLD, /* direct child */
  391. DIRPRT, /* direct parent */
  392. NS_PORT_CONSTS(PID)
  393. NS_PORT_CONSTS(SYSV)
  394. };
  395. enum {
  396. IPC_PORT_LISTEN = 1<<LISTEN,
  397. IPC_PORT_SERVER = 1<<SERVER,
  398. IPC_PORT_KEEPALIVE = 1<<KEEPALIVE,
  399. IPC_PORT_DIRCLD = 1<<DIRCLD,
  400. IPC_PORT_DIRPRT = 1<<DIRPRT,
  401. NS_PORT_TYPES(PID)
  402. NS_PORT_TYPES(SYSV)
  403. };
  404. /* general-purpose routines */
  405. void add_ipc_port_by_id (IDTYPE vmid, PAL_HANDLE hdl, IDTYPE type,
  406. port_fini fini,
  407. struct shim_ipc_port ** portptr);
  408. void add_ipc_port (struct shim_ipc_port * port, IDTYPE vmid, IDTYPE type,
  409. port_fini fini);
  410. void del_ipc_port_fini (struct shim_ipc_port * port, unsigned int exitcode);
  411. struct shim_ipc_port * lookup_ipc_port (IDTYPE vmid, IDTYPE type);
  412. void get_ipc_port (struct shim_ipc_port * port);
  413. void put_ipc_port (struct shim_ipc_port * port);
  414. void del_all_ipc_ports (void);
  415. struct shim_ipc_info * get_new_ipc_info (IDTYPE vmid, const char * uri,
  416. size_t len);
  417. void get_ipc_info(struct shim_ipc_info * port);
  418. void put_ipc_info(struct shim_ipc_info * port);
  419. struct shim_ipc_info * lookup_and_alloc_client (IDTYPE vmid, const char * uri);
  420. void put_client (struct shim_ipc_info * info);
  421. struct shim_ipc_info * discover_client (struct shim_ipc_port * port,
  422. IDTYPE vmid);
  423. #define IPC_MSG_SIZE(extra) \
  424. ({ int _size = (extra) + sizeof(struct shim_ipc_msg); \
  425. _size > IPC_MSG_MINIMAL_SIZE ? _size : IPC_MSG_MINIMAL_SIZE; })
  426. #define IPC_MSGOBJ_SIZE(extra) \
  427. ({ int _size = (extra) + sizeof(struct shim_ipc_msg); \
  428. (_size > IPC_MSG_MINIMAL_SIZE ? _size : IPC_MSG_MINIMAL_SIZE) + \
  429. (sizeof(struct shim_ipc_msg_obj) - sizeof(struct shim_ipc_msg)); })
  430. int __init_ipc_msg (struct shim_ipc_msg * msg, int code, int size, IDTYPE dest);
  431. struct shim_ipc_msg * create_ipc_msg (int code, int size, IDTYPE dest);
  432. static_always_inline
  433. struct shim_ipc_msg * create_ipc_msg_on_stack (int code, int size, IDTYPE dest)
  434. {
  435. struct shim_ipc_msg * msg = __alloca(IPC_MSG_SIZE(size));
  436. return (!__init_ipc_msg(msg, code, size, dest)) ? msg : NULL;
  437. }
  438. int __init_ipc_msg_duplex (struct shim_ipc_msg_obj * msg, int code, int size,
  439. IDTYPE dest);
  440. struct shim_ipc_msg_obj *
  441. create_ipc_msg_duplex (int code, int size, IDTYPE dest);
  442. static_always_inline
  443. struct shim_ipc_msg_obj *
  444. create_ipc_msg_duplex_on_stack (int code, int size, IDTYPE dest)
  445. {
  446. struct shim_ipc_msg_obj * msg = __alloca(IPC_MSGOBJ_SIZE(size));
  447. return (!__init_ipc_msg_duplex(msg, code, size, dest)) ?
  448. msg : NULL;
  449. }
  450. int __init_ipc_resp_msg (struct shim_ipc_msg * resp, int ret,
  451. unsigned long seq);
  452. struct shim_ipc_msg *
  453. create_ipc_resp_msg (int ret, IDTYPE dest, unsigned long seq);
  454. static_always_inline
  455. struct shim_ipc_msg *
  456. create_ipc_resp_msg_on_stack (int ret, IDTYPE dest, unsigned long seq)
  457. {
  458. struct shim_ipc_msg * resp = create_ipc_msg_on_stack(IPC_RESP,
  459. sizeof(struct shim_ipc_resp), dest);
  460. return (resp && !__init_ipc_resp_msg(resp, ret, seq)) ? resp : NULL;
  461. }
  462. int send_ipc_message (struct shim_ipc_msg * msg, struct shim_ipc_port * port);
  463. int send_ipc_message_duplex (struct shim_ipc_msg_obj * msg,
  464. struct shim_ipc_port * port, bool save,
  465. void * private_data);
  466. int close_ipc_message_duplex (struct shim_ipc_msg_obj * msg,
  467. struct shim_ipc_port * port);
  468. int broadcast_ipc (struct shim_ipc_msg * msg, int target_type,
  469. struct shim_ipc_port * exclude_port);
  470. struct shim_ipc_msg_obj * find_ipc_msg_duplex (struct shim_ipc_port * port,
  471. unsigned long seq);
  472. int send_response_ipc_message (struct shim_ipc_port * port, IDTYPE dest,
  473. int ret, unsigned long seq);
  474. int do_ipc_duplex (struct shim_ipc_msg_obj * msg,
  475. struct shim_ipc_port * port, unsigned long * seq,
  476. void * private_data);
  477. void ipc_child_exit (struct shim_ipc_port * port, IDTYPE vmid,
  478. unsigned int exitcode);
  479. struct shim_thread* terminate_ipc_helper(void);
  480. #define IPC_FORCE_RECONNECT ((void*)-1)
  481. int prepare_ns_leaders (void);
  482. #endif /* _SHIM_IPC_H_ */