Diff for /embedaddon/quagga/ospfd/ospf_interface.c between versions 1.1.1.1 and 1.1.1.3

version 1.1.1.1, 2012/02/21 17:26:12 version 1.1.1.3, 2016/11/02 10:09:12
Line 49 Line 49
 #include "ospfd/ospf_snmp.h"  #include "ospfd/ospf_snmp.h"
 #endif /* HAVE_SNMP */  #endif /* HAVE_SNMP */
   
 int  int
 ospf_if_get_output_cost (struct ospf_interface *oi)  ospf_if_get_output_cost (struct ospf_interface *oi)
 {  {
Line 241  ospf_if_new (struct ospf *ospf, struct interface *ifp, Line 241  ospf_if_new (struct ospf *ospf, struct interface *ifp,
   
   oi->crypt_seqnum = time (NULL);    oi->crypt_seqnum = time (NULL);
   
 #ifdef HAVE_OPAQUE_LSA  
   ospf_opaque_type9_lsa_init (oi);    ospf_opaque_type9_lsa_init (oi);
 #endif /* HAVE_OPAQUE_LSA */  
   
   oi->ospf = ospf;    oi->ospf = ospf;
       
Line 295  ospf_if_cleanup (struct ospf_interface *oi) Line 293  ospf_if_cleanup (struct ospf_interface *oi)
   ospf_ls_upd_queue_empty (oi);    ospf_ls_upd_queue_empty (oi);
       
   /* Reset pseudo neighbor. */    /* Reset pseudo neighbor. */
  ospf_nbr_delete (oi->nbr_self);  ospf_nbr_self_reset (oi);
  oi->nbr_self = ospf_nbr_new (oi); 
  ospf_nbr_add_self (oi); 
 }  }
   
 void  void
Line 307  ospf_if_free (struct ospf_interface *oi) Line 303  ospf_if_free (struct ospf_interface *oi)
   
   assert (oi->state == ISM_Down);    assert (oi->state == ISM_Down);
   
 #ifdef HAVE_OPAQUE_LSA  
   ospf_opaque_type9_lsa_term (oi);    ospf_opaque_type9_lsa_term (oi);
 #endif /* HAVE_OPAQUE_LSA */  
   
   /* Free Pseudo Neighbour */    /* Free Pseudo Neighbour */
   ospf_nbr_delete (oi->nbr_self);    ospf_nbr_delete (oi->nbr_self);
Line 334  ospf_if_free (struct ospf_interface *oi) Line 328  ospf_if_free (struct ospf_interface *oi)
   XFREE (MTYPE_OSPF_IF, oi);    XFREE (MTYPE_OSPF_IF, oi);
 }  }
   
 /*  /*
 *  check if interface with given address is configured and  *  check if interface with given address is configured and
 *  return it if yes.  special treatment for PtP networks.  *  return it if yes.  special treatment for PtP networks.
Line 392  ospf_if_exists (struct ospf_interface *oic) Line 386  ospf_if_exists (struct ospf_interface *oic)
   return NULL;    return NULL;
 }  }
   
   /* Lookup OSPF interface by router LSA posistion */
 struct ospf_interface *  struct ospf_interface *
   ospf_if_lookup_by_lsa_pos (struct ospf_area *area, int lsa_pos)
   {
     struct listnode *node;
     struct ospf_interface *oi;
   
     for (ALL_LIST_ELEMENTS_RO (area->oiflist, node, oi))
       {
         if (lsa_pos >= oi->lsa_pos_beg && lsa_pos < oi->lsa_pos_end)
           return oi;
       }
     return NULL;
   }
   
   struct ospf_interface *
 ospf_if_lookup_by_local_addr (struct ospf *ospf,  ospf_if_lookup_by_local_addr (struct ospf *ospf,
                               struct interface *ifp, struct in_addr address)                                struct interface *ifp, struct in_addr address)
 {  {
Line 474  ospf_if_lookup_recv_if (struct ospf *ospf, struct in_a Line 483  ospf_if_lookup_recv_if (struct ospf *ospf, struct in_a
   
   return match;    return match;
 }  }
 void  void
 ospf_if_stream_set (struct ospf_interface *oi)  ospf_if_stream_set (struct ospf_interface *oi)
 {  {
Line 503  ospf_if_stream_unset (struct ospf_interface *oi) Line 512  ospf_if_stream_unset (struct ospf_interface *oi)
     }      }
 }  }
   
 static struct ospf_if_params *  static struct ospf_if_params *
 ospf_new_if_params (void)  ospf_new_if_params (void)
 {  {
Line 673  ospf_if_new_hook (struct interface *ifp) Line 682  ospf_if_new_hook (struct interface *ifp)
   SET_IF_PARAM (IF_DEF_PARAMS (ifp), auth_type);    SET_IF_PARAM (IF_DEF_PARAMS (ifp), auth_type);
   IF_DEF_PARAMS (ifp)->auth_type = OSPF_AUTH_NOTSET;    IF_DEF_PARAMS (ifp)->auth_type = OSPF_AUTH_NOTSET;
       
 #ifdef HAVE_OPAQUE_LSA  
   rc = ospf_opaque_new_if (ifp);    rc = ospf_opaque_new_if (ifp);
 #endif /* HAVE_OPAQUE_LSA */  
   return rc;    return rc;
 }  }
   
Line 684  ospf_if_delete_hook (struct interface *ifp) Line 691  ospf_if_delete_hook (struct interface *ifp)
 {  {
   int rc = 0;    int rc = 0;
   struct route_node *rn;    struct route_node *rn;
 #ifdef HAVE_OPAQUE_LSA  
   rc = ospf_opaque_del_if (ifp);    rc = ospf_opaque_del_if (ifp);
 #endif /* HAVE_OPAQUE_LSA */  
   
   route_table_finish (IF_OIFS (ifp));    route_table_finish (IF_OIFS (ifp));
   
Line 801  ospf_if_down (struct ospf_interface *oi) Line 806  ospf_if_down (struct ospf_interface *oi)
     return 0;      return 0;
   
   OSPF_ISM_EVENT_EXECUTE (oi, ISM_InterfaceDown);    OSPF_ISM_EVENT_EXECUTE (oi, ISM_InterfaceDown);
     /* delete position in router LSA */
     oi->lsa_pos_beg = 0;
     oi->lsa_pos_end = 0;
   /* Shutdown packet reception and sending */    /* Shutdown packet reception and sending */
   ospf_if_stream_unset (oi);    ospf_if_stream_unset (oi);
   
   return 1;    return 1;
 }  }
   
 /* Virtual Link related functions. */  /* Virtual Link related functions. */
   
 struct ospf_vl_data *  struct ospf_vl_data *
Line 995  ospf_vl_set_params (struct ospf_vl_data *vl_data, stru Line 1003  ospf_vl_set_params (struct ospf_vl_data *vl_data, stru
   struct ospf_interface *voi;    struct ospf_interface *voi;
   struct listnode *node;    struct listnode *node;
   struct vertex_parent *vp = NULL;    struct vertex_parent *vp = NULL;
  int i;  unsigned int i;
   struct router_lsa *rl;    struct router_lsa *rl;
   
   voi = vl_data->vl_oi;    voi = vl_data->vl_oi;
Line 1176  ospf_vls_in_area (struct ospf_area *area) Line 1184  ospf_vls_in_area (struct ospf_area *area)
   return c;    return c;
 }  }
   
 struct crypt_key *  struct crypt_key *
 ospf_crypt_key_new ()  ospf_crypt_key_new ()
 {  {
Line 1236  void Line 1244  void
 ospf_if_init ()  ospf_if_init ()
 {  {
   /* Initialize Zebra interface data structure. */    /* Initialize Zebra interface data structure. */
   if_init ();  
   om->iflist = iflist;    om->iflist = iflist;
   if_add_hook (IF_NEW_HOOK, ospf_if_new_hook);    if_add_hook (IF_NEW_HOOK, ospf_if_new_hook);
   if_add_hook (IF_DELETE_HOOK, ospf_if_delete_hook);    if_add_hook (IF_DELETE_HOOK, ospf_if_delete_hook);

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.3


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