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

#define ECP_MTYPE_DIR_UPD       0x00
#define ECP_MTYPE_DIR_REQ       0x01
#define ECP_MTYPE_DIR_ANN       0x02
#define ECP_MTYPE_DIR_REP       0x03
#define ECP_MTYPE_DIR_SHADOW    0x04

#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;
    uint16_t capabilities;
} ECPDirItem;

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);