bgp_packet.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* BGP packet management header.
  2. Copyright (C) 1999 Kunihiro Ishiguro
  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_PACKET_H
  17. #define _QUAGGA_BGP_PACKET_H
  18. #define BGP_NLRI_LENGTH 1U
  19. #define BGP_TOTAL_ATTR_LEN 2U
  20. #define BGP_UNFEASIBLE_LEN 2U
  21. #define BGP_WRITE_PACKET_MAX 10U
  22. /* When to refresh */
  23. #define REFRESH_IMMEDIATE 1
  24. #define REFRESH_DEFER 2
  25. /* ORF Common part flag */
  26. #define ORF_COMMON_PART_ADD 0x00
  27. #define ORF_COMMON_PART_REMOVE 0x80
  28. #define ORF_COMMON_PART_REMOVE_ALL 0xC0
  29. #define ORF_COMMON_PART_PERMIT 0x00
  30. #define ORF_COMMON_PART_DENY 0x20
  31. /* Packet send and receive function prototypes. */
  32. extern int bgp_read (struct thread *);
  33. extern int bgp_write (struct thread *);
  34. extern void bgp_keepalive_send (struct peer *);
  35. extern void bgp_open_send (struct peer *);
  36. extern void bgp_notify_send (struct peer *, u_int8_t, u_int8_t);
  37. extern void bgp_notify_send_with_data (struct peer *, u_int8_t, u_int8_t,
  38. u_int8_t *, size_t);
  39. extern void bgp_route_refresh_send (struct peer *, afi_t, safi_t, u_char, u_char, int);
  40. extern void bgp_capability_send (struct peer *, afi_t, safi_t, int, int);
  41. extern void bgp_default_update_send (struct peer *, struct attr *,
  42. afi_t, safi_t, struct peer *);
  43. extern void bgp_default_withdraw_send (struct peer *, afi_t, safi_t);
  44. extern int bgp_capability_receive (struct peer *, bgp_size_t);
  45. extern int bgp_nlri_parse (struct peer *, struct attr *, struct bgp_nlri *);
  46. #endif /* _QUAGGA_BGP_PACKET_H */