diff options
Diffstat (limited to 'isisd/isis_tlv.c')
-rw-r--r-- | isisd/isis_tlv.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/isisd/isis_tlv.c b/isisd/isis_tlv.c index f4307246..4f8ab393 100644 --- a/isisd/isis_tlv.c +++ b/isisd/isis_tlv.c @@ -927,6 +927,20 @@ tlv_add_ip_addrs (struct list *ip_addrs, struct stream *stream) return add_tlv (IPV4_ADDR, pos - value, value, stream); } +/* Used to add TLV containing just one IPv4 address - either IPv4 address TLV + * (in case of LSP) or TE router ID TLV. */ +int +tlv_add_in_addr (struct in_addr *addr, struct stream *stream, u_char tag) +{ + u_char value[255]; + u_char *pos = value; + + memcpy (pos, addr, IPV4_MAX_BYTELEN); + pos += IPV4_MAX_BYTELEN; + + return add_tlv (tag, pos - value, value, stream); +} + int tlv_add_dynamic_hostname (struct hostname *hostname, struct stream *stream) { |