bgp_mplsvpn.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* MPLS-VPN
  2. Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
  3. This file is part of GNU Zebra.
  4. GNU Zebra is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by the
  6. Free Software Foundation; either version 2, or (at your option) any
  7. later version.
  8. GNU Zebra is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Zebra; see the file COPYING. If not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  15. 02111-1307, USA. */
  16. #ifndef _QUAGGA_BGP_MPLSVPN_H
  17. #define _QUAGGA_BGP_MPLSVPN_H
  18. #define RD_TYPE_AS 0
  19. #define RD_TYPE_IP 1
  20. #define RD_TYPE_AS4 2
  21. #define RD_ADDRSTRLEN 28
  22. struct rd_as
  23. {
  24. u_int16_t type;
  25. as_t as;
  26. u_int32_t val;
  27. };
  28. struct rd_ip
  29. {
  30. u_int16_t type;
  31. struct in_addr ip;
  32. u_int16_t val;
  33. };
  34. extern void bgp_mplsvpn_init (void);
  35. extern int bgp_nlri_parse_vpn (struct peer *, struct attr *, struct bgp_nlri *);
  36. extern u_int32_t decode_label (u_char *);
  37. extern int str2prefix_rd (const char *, struct prefix_rd *);
  38. extern int str2tag (const char *, u_char *);
  39. extern char *prefix_rd2str (struct prefix_rd *, char *, size_t);
  40. #endif /* _QUAGGA_BGP_MPLSVPN_H */