8 #define PB_SOCKET_PATH "/tmp/petitboot.ui"
10 #define PB_PROTOCOL_MAX_PAYLOAD_SIZE (64 * 1024)
12 enum pb_protocol_action {
13 PB_PROTOCOL_ACTION_ADD = 0x1,
14 PB_PROTOCOL_ACTION_REMOVE = 0x2,
17 struct pb_protocol_message {
29 struct list boot_options;
39 char *boot_image_file;
43 struct list_item list;
48 int pb_protocol_device_len(const struct device *dev);
49 int pb_protocol_device_cmp(const struct device *a, const struct device *b);
51 int pb_protocol_boot_option_cmp(const struct boot_option *a,
52 const struct boot_option *b);
54 int pb_protocol_serialise_string(char *pos, const char *str);
55 char *pb_protocol_deserialise_string(void *ctx,
56 const struct pb_protocol_message *message);
58 int pb_protocol_serialise_device(const struct device *dev, char *buf, int buf_len);
60 int pb_protocol_write_message(int fd, struct pb_protocol_message *message);
62 struct pb_protocol_message *pb_protocol_create_message(void *ctx,
63 enum pb_protocol_action action, int payload_len);
65 struct pb_protocol_message *pb_protocol_read_message(void *ctx, int fd);
67 struct device *pb_protocol_deserialise_device(void *ctx,
68 const struct pb_protocol_message *message);
70 #endif /* _PB_PROTOCOL_H */