diff options
| author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-02-14 15:43:52 +0100 |
|---|---|---|
| committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-09-11 22:11:25 +0200 |
| commit | 0afeda742c02b0aa239a48f120721142beee2ba7 (patch) | |
| tree | 7842d886863dc1339aa53c6fdc6cff17ec6cbdd0 | |
| parent | b9547a0b70e9c6ea8a32789f8ef216bef7e129cb (diff) | |
isisd: Add new macros to define Sub-Sub-TLV ops
Add two macros `SUBSUBTLV_OPS` and `ITEM_SUBSUBTLV_OPS` that help the
developer to define the TLV operations for the IS-IS Sub-Sub-TLVs.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
| -rw-r--r-- | isisd/isis_tlvs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index 1b466d0076..45abc38db7 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -6533,6 +6533,15 @@ int isis_unpack_tlvs(size_t avail_len, struct stream *stream, #define ITEM_SUBTLV_OPS(_name_, _desc_) \ ITEM_TLV_OPS(_name_, _desc_) +#define SUBSUBTLV_OPS(_name_, _desc_) \ + static const struct tlv_ops subsubtlv_##_name_##_ops = { \ + .name = _desc_, \ + .unpack = unpack_subsubtlv_##_name_, \ + } + +#define ITEM_SUBSUBTLV_OPS(_name_, _desc_) \ + ITEM_TLV_OPS(_name_, _desc_) + ITEM_TLV_OPS(area_address, "TLV 1 Area Addresses"); ITEM_TLV_OPS(oldstyle_reach, "TLV 2 IS Reachability"); ITEM_TLV_OPS(lan_neighbor, "TLV 6 LAN Neighbors"); |
