diff options
author | hasso <hasso> | 2005-09-26 17:58:24 +0000 |
---|---|---|
committer | hasso <hasso> | 2005-09-26 17:58:24 +0000 |
commit | 81ad8f6a1040eaf9d4230bd63b71d85397660653 (patch) | |
tree | 93ccfab5fe8ca9d9e79b65aed0e359ab21f0a1c1 /isisd/isis_tlv.c | |
parent | aa4376ec0c37b9b2d484e9503ad7b8e1a010afd2 (diff) |
* isis_tlv.[ch]: New function tlv_add_in_addr() to put just one IPv4
address into TLV. Used for IPv4 address TLV (in case of LSP) and TE
router ID TLV.
* isis_lsp.c: Use tlv_add_in_addr() and include router ID in LSP.
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) { |