Annotation of embedaddon/quagga/ospf6d/ospf6_neighbor.h, revision 1.1.1.2

1.1       misho       1: /*
                      2:  * Copyright (C) 2003 Yasuhiro Ohara
                      3:  *
                      4:  * This file is part of GNU Zebra.
                      5:  *
                      6:  * GNU Zebra is free software; you can redistribute it and/or modify it
                      7:  * under the terms of the GNU General Public License as published by the
                      8:  * Free Software Foundation; either version 2, or (at your option) any
                      9:  * later version.
                     10:  *
                     11:  * GNU Zebra is distributed in the hope that it will be useful, but
                     12:  * WITHOUT ANY WARRANTY; without even the implied warranty of
                     13:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                     14:  * General Public License for more details.
                     15:  *
                     16:  * You should have received a copy of the GNU General Public License
                     17:  * along with GNU Zebra; see the file COPYING.  If not, write to the 
                     18:  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
                     19:  * Boston, MA 02111-1307, USA.  
                     20:  */
                     21: 
                     22: #ifndef OSPF6_NEIGHBOR_H
                     23: #define OSPF6_NEIGHBOR_H
                     24: 
                     25: /* Debug option */
                     26: extern unsigned char conf_debug_ospf6_neighbor;
                     27: #define OSPF6_DEBUG_NEIGHBOR_STATE   0x01
                     28: #define OSPF6_DEBUG_NEIGHBOR_EVENT   0x02
                     29: #define OSPF6_DEBUG_NEIGHBOR_ON(level) \
                     30:   (conf_debug_ospf6_neighbor |= (level))
                     31: #define OSPF6_DEBUG_NEIGHBOR_OFF(level) \
                     32:   (conf_debug_ospf6_neighbor &= ~(level))
                     33: #define IS_OSPF6_DEBUG_NEIGHBOR(level) \
                     34:   (conf_debug_ospf6_neighbor & OSPF6_DEBUG_NEIGHBOR_ ## level)
                     35: 
                     36: /* Neighbor structure */
                     37: struct ospf6_neighbor
                     38: {
                     39:   /* Neighbor Router ID String */
                     40:   char name[32];
                     41: 
                     42:   /* OSPFv3 Interface this neighbor belongs to */
                     43:   struct ospf6_interface *ospf6_if;
                     44: 
                     45:   /* Neighbor state */
                     46:   u_char state;
                     47: 
                     48:   /* timestamp of last changing state */
1.1.1.2 ! misho      49:   u_int32_t state_change;
1.1       misho      50:   struct timeval last_changed;
                     51: 
                     52:   /* Neighbor Router ID */
                     53:   u_int32_t router_id;
                     54: 
                     55:   /* Neighbor Interface ID */
                     56:   u_int32_t ifindex;
                     57: 
                     58:   /* Router Priority of this neighbor */
                     59:   u_char priority;
                     60: 
                     61:   u_int32_t drouter;
                     62:   u_int32_t bdrouter;
                     63:   u_int32_t prev_drouter;
                     64:   u_int32_t prev_bdrouter;
                     65: 
                     66:   /* Options field (Capability) */
                     67:   char options[3];
                     68: 
                     69:   /* IPaddr of I/F on our side link */
                     70:   struct in6_addr linklocal_addr;
                     71: 
                     72:   /* For Database Exchange */
                     73:   u_char               dbdesc_bits;
                     74:   u_int32_t            dbdesc_seqnum;
                     75:   /* Last received Database Description packet */
                     76:   struct ospf6_dbdesc  dbdesc_last;
                     77: 
                     78:   /* LS-list */
                     79:   struct ospf6_lsdb *summary_list;
                     80:   struct ospf6_lsdb *request_list;
                     81:   struct ospf6_lsdb *retrans_list;
                     82: 
                     83:   /* LSA list for message transmission */
                     84:   struct ospf6_lsdb *dbdesc_list;
                     85:   struct ospf6_lsdb *lsreq_list;
                     86:   struct ospf6_lsdb *lsupdate_list;
                     87:   struct ospf6_lsdb *lsack_list;
                     88: 
                     89:   /* Inactivity timer */
                     90:   struct thread *inactivity_timer;
                     91: 
                     92:   /* Thread for sending message */
                     93:   struct thread *thread_send_dbdesc;
                     94:   struct thread *thread_send_lsreq;
                     95:   struct thread *thread_send_lsupdate;
                     96:   struct thread *thread_send_lsack;
                     97: };
                     98: 
                     99: /* Neighbor state */
                    100: #define OSPF6_NEIGHBOR_DOWN     1
                    101: #define OSPF6_NEIGHBOR_ATTEMPT  2
                    102: #define OSPF6_NEIGHBOR_INIT     3
                    103: #define OSPF6_NEIGHBOR_TWOWAY   4
                    104: #define OSPF6_NEIGHBOR_EXSTART  5
                    105: #define OSPF6_NEIGHBOR_EXCHANGE 6
                    106: #define OSPF6_NEIGHBOR_LOADING  7
                    107: #define OSPF6_NEIGHBOR_FULL     8
                    108: 
                    109: extern const char *ospf6_neighbor_state_str[];
                    110: 
                    111: 
                    112: /* Function Prototypes */
                    113: int ospf6_neighbor_cmp (void *va, void *vb);
                    114: void ospf6_neighbor_dbex_init (struct ospf6_neighbor *on);
                    115: 
                    116: struct ospf6_neighbor *ospf6_neighbor_lookup (u_int32_t,
                    117:                                               struct ospf6_interface *);
                    118: struct ospf6_neighbor *ospf6_neighbor_create (u_int32_t,
                    119:                                               struct ospf6_interface *);
                    120: void ospf6_neighbor_delete (struct ospf6_neighbor *);
                    121: 
                    122: /* Neighbor event */
                    123: extern int hello_received (struct thread *);
                    124: extern int twoway_received (struct thread *);
                    125: extern int negotiation_done (struct thread *);
                    126: extern int exchange_done (struct thread *);
                    127: extern int loading_done (struct thread *);
                    128: extern int adj_ok (struct thread *);
                    129: extern int seqnumber_mismatch (struct thread *);
                    130: extern int bad_lsreq (struct thread *);
                    131: extern int oneway_received (struct thread *);
                    132: extern int inactivity_timer (struct thread *);
                    133: 
                    134: extern void ospf6_neighbor_init (void);
                    135: extern int config_write_ospf6_debug_neighbor (struct vty *vty);
                    136: extern void install_element_ospf6_debug_neighbor (void);
                    137: 
                    138: #endif /* OSPF6_NEIGHBOR_H */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>