diff options
author | Uros Majstorovic <majstor@majstor.org> | 2024-05-10 19:47:06 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2024-05-10 19:47:06 +0200 |
commit | 3f814b6f30a9ae296805ebab49114fb24ab3b0d1 (patch) | |
tree | e30a8b1db2a608263b34bd8cfae5d5743885383a | |
parent | 54f3d8e3accc3b28b076f3ed09385b852c815824 (diff) |
dir reply can be fragmented; renamed caps to roles
-rw-r--r-- | ecp/src/ecp/dir/dir.c | 6 | ||||
-rw-r--r-- | ecp/src/ecp/dir/dir.h | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ecp/src/ecp/dir/dir.c b/ecp/src/ecp/dir/dir.c index 6258e0e..47a43f2 100644 --- a/ecp/src/ecp/dir/dir.c +++ b/ecp/src/ecp/dir/dir.c @@ -9,7 +9,7 @@ int ecp_dir_item_eq(ECPDirItem *item1, ECPDirItem *item2) { if (item1->region != item2->region) return 0; - if (item1->capabilities != item2->capabilities) return 0; + if (item1->roles != item2->roles) return 0; if (!item1->node.key_perma.valid || !item1->node.key_perma.valid) return 0; if (memcmp(&item1->node.key_perma.public, &item2->node.key_perma.public, sizeof(item1->node.key_perma.public)) != 0) return 0; return ecp_tr_addr_eq(&item1->node.addr, &item2->node.addr); @@ -41,7 +41,7 @@ size_t ecp_dir_item_parse(ECPDirItem *item, unsigned char *buf) { rsize += sizeof(uint16_t); item->region = buf[0]; - item->capabilities = buf[1]; + item->roles = buf[1]; buf += 2; rsize += 2; @@ -70,7 +70,7 @@ size_t ecp_dir_item_serialize(ECPDirItem *item, unsigned char *buf) { rsize += sizeof(uint16_t); buf[0] = item->region; - buf[1] = item->capabilities; + buf[1] = item->roles; buf += 2; rsize += 2; diff --git a/ecp/src/ecp/dir/dir.h b/ecp/src/ecp/dir/dir.h index 83b97df..f88cf7c 100644 --- a/ecp/src/ecp/dir/dir.h +++ b/ecp/src/ecp/dir/dir.h @@ -1,17 +1,17 @@ #define ECP_SIZE_DIR_ITEM 40 #define ECP_MTYPE_DIR_REQ 0x00 -#define ECP_MTYPE_DIR_REP 0x01 +#define ECP_MTYPE_DIR_REP (0x01 | ECP_MTYPE_FLAG_FRAG) #define ECP_CTYPE_DIR (0x00 | ECP_CTYPE_FLAG_SYS) -#define ECP_DIR_CAP_DIR 0x01 -#define ECP_DIR_CAP_VCONN 0x02 +#define ECP_ROLE_DIR 0x01 +#define ECP_ROLE_VCONN 0x02 typedef struct ECPDirItem { ECPNode node; uint8_t region; - uint8_t capabilities; + uint8_t roles; } ECPDirItem; int ecp_dir_item_eq(ECPDirItem *item1, ECPDirItem *item2); |