mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-22 01:31:34 +00:00
These contain linkage between number, data type and routines for pb messages we write/read to/from image files. Most of them have simple number-type-routines mapping, so introduce a generating script for that. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
82 lines
1.4 KiB
C
82 lines
1.4 KiB
C
#ifndef __CR_PROTOBUF_DESC_H__
|
|
#define __CR_PROTOBUF_DESC_H__
|
|
|
|
#include <sys/types.h>
|
|
#include <google/protobuf-c/protobuf-c.h>
|
|
|
|
enum {
|
|
/* PB_AUTOGEN_START */
|
|
PB_INVENTORY,
|
|
PB_STATS,
|
|
PB_FDINFO,
|
|
PB_CORE,
|
|
PB_MM,
|
|
PB_VMA,
|
|
PB_ITIMER,
|
|
PB_POSIX_TIMER,
|
|
PB_CREDS,
|
|
PB_FS,
|
|
PB_UTSNS,
|
|
PB_IPC_VAR,
|
|
PB_IPC_SHM,
|
|
PB_IPC_SEM,
|
|
PB_MNT,
|
|
PB_PSTREE,
|
|
PB_GHOST_FILE,
|
|
PB_TCP_STREAM,
|
|
PB_REG_FILE,
|
|
PB_NS_FILE,
|
|
PB_INET_SK,
|
|
PB_UNIX_SK,
|
|
PB_PACKET_SOCK,
|
|
PB_NETLINK_SK,
|
|
PB_PIPE,
|
|
PB_FIFO,
|
|
PB_PIPE_DATA,
|
|
PB_EVENTFD_FILE,
|
|
PB_EVENTPOLL_FILE,
|
|
PB_EVENTPOLL_TFD,
|
|
PB_SIGNALFD,
|
|
PB_INOTIFY_FILE,
|
|
PB_INOTIFY_WD,
|
|
PB_FANOTIFY_FILE,
|
|
PB_FANOTIFY_MARK,
|
|
PB_TTY_FILE,
|
|
PB_TTY_INFO,
|
|
PB_FILE_LOCK,
|
|
PB_RLIMIT,
|
|
PB_PAGEMAP,
|
|
PB_SIGINFO,
|
|
PB_TUNFILE,
|
|
|
|
/* PB_AUTOGEN_STOP */
|
|
|
|
PB_PAGEMAP_HEAD,
|
|
PB_IDS,
|
|
PB_SIGACT,
|
|
PB_NETDEV,
|
|
PB_REMAP_FPATH,
|
|
PB_SK_QUEUES,
|
|
PB_IPCNS_MSG,
|
|
PB_IPCNS_MSG_ENT,
|
|
|
|
PB_MAX,
|
|
};
|
|
|
|
typedef size_t (*pb_getpksize_t)(void *obj);
|
|
typedef size_t (*pb_pack_t)(void *obj, void *where);
|
|
typedef void *(*pb_unpack_t)(void *allocator, size_t size, void *from);
|
|
typedef void (*pb_free_t)(void *obj, void *allocator);
|
|
|
|
struct cr_pb_message_desc {
|
|
pb_getpksize_t getpksize;
|
|
pb_pack_t pack;
|
|
pb_unpack_t unpack;
|
|
pb_free_t free;
|
|
const ProtobufCMessageDescriptor *pb_desc;
|
|
};
|
|
|
|
extern void cr_pb_init(void);
|
|
extern struct cr_pb_message_desc cr_pb_descs[PB_MAX];
|
|
|
|
#endif /* __CR_PROTOBUF_DESC_H__ */
|