summaryrefslogtreecommitdiff
path: root/ecp/src/ecp/dir/dir.h
blob: 83b97df9e05f2dbbd9f853c189c46597b3391dfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#define ECP_SIZE_DIR_ITEM       40

#define ECP_MTYPE_DIR_REQ       0x00
#define ECP_MTYPE_DIR_REP       0x01

#define ECP_CTYPE_DIR           (0x00 | ECP_CTYPE_FLAG_SYS)

#define ECP_DIR_CAP_DIR         0x01
#define ECP_DIR_CAP_VCONN       0x02

typedef struct ECPDirItem {
    ECPNode node;
    uint8_t region;
    uint8_t capabilities;
} ECPDirItem;

int ecp_dir_item_eq(ECPDirItem *item1, ECPDirItem *item2);
size_t ecp_dir_item_parse(ECPDirItem *item, unsigned char *buf);
size_t ecp_dir_item_serialize(ECPDirItem *item, unsigned char *buf);

int ecp_dir_handle_open(ECPConnection *conn, ECP2Buffer *b);
ssize_t ecp_dir_send_req(ECPConnection *conn);
void ecp_dir_conn_init(ECPConnection *conn, ECPSocket *sock);