summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.h
diff options
context:
space:
mode:
authorajs <ajs>2005-02-08 15:37:30 +0000
committerajs <ajs>2005-02-08 15:37:30 +0000
commitba6454ec1fd1ca7266b10eba07d016becb22db74 (patch)
tree1ee3f882924db44883e1023e5081741e10d86b3a /ospfd/ospf_interface.h
parent3a9eb091494f7afb8ce6bf82b8e1a20bb2a8f10f (diff)
2005-02-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_interface.h: Improve passive_interface comment. Add new multicast_memberships bitmask to struct ospf_interface to track active multicast subscriptions. Declare new function ospf_if_set_multicast. * ospf_interface.c: (ospf_if_set_multicast) New function to configure multicast memberships properly based on the current multicast_memberships status and the current values of the ospf_interface state, type, and passive_interface status. (ospf_if_up) Remove call to ospf_if_add_allspfrouters (this is now handled by ism_change_state's call to ospf_if_set_multicast). (ospf_if_down) Remove call to ospf_if_drop_allspfrouters (now handled by ism_change_state). * ospf_ism.c: (ospf_dr_election) Remove logic to join or leave the DRouters multicast group (now handled by ism_change_state's call to ospf_if_set_multicast). (ism_change_state) Add call to ospf_if_set_multicast to change multicast memberships as necessary to reflect the new interface state. * ospf_packet.c: (ospf_hello) When a Hello packet is received on a passive interface: 1. Increase the severity of the error message from LOG_INFO to LOG_WARNING; 2. Add more information to the error message (packet destination address and interface address); and 3. If the packet was sent to ospf-all-routers, then try to fix the multicast group memberships. (ospf_read) When a packet is received on an interface whose state is ISM_Down, enhance the warning message to show the packet destination address, and try to update/fix the multicast group memberships if the packet was sent to a multicast address. When a packet is received for ospf-designated-routers, but the current interface state is not DR or BDR, then increase the severity level of the error message from LOG_INFO to LOG_WARNING, and try to fix the multicast group memberships. * ospf_vty.c: (ospf_passive_interface) Call ospf_if_set_multicast for any ospf interface that may have changed from active to passive. (no_ospf_passive_interface) Call ospf_if_set_multicast for any ospf interface that may have changed from passive to active. (show_ip_ospf_interface_sub) Show multicast group memberships.
Diffstat (limited to 'ospfd/ospf_interface.h')
-rw-r--r--ospfd/ospf_interface.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h
index 60ee1650..ca22c1a0 100644
--- a/ospfd/ospf_interface.h
+++ b/ospfd/ospf_interface.h
@@ -44,7 +44,7 @@ struct ospf_if_params
DECLARE_IF_PARAM (u_int32_t, transmit_delay); /* Interface Transmisson Delay */
DECLARE_IF_PARAM (u_int32_t, output_cost_cmd);/* Command Interface Output Cost */
DECLARE_IF_PARAM (u_int32_t, retransmit_interval); /* Retransmission Interval */
- DECLARE_IF_PARAM (u_char, passive_interface); /* OSPF Interface is passive */
+ DECLARE_IF_PARAM (u_char, passive_interface); /* OSPF Interface is passive: no sending or receiving (no need to join multicast groups) */
DECLARE_IF_PARAM (u_char, priority); /* OSPF Interface priority */
DECLARE_IF_PARAM (u_char, type); /* type of interface */
#define OSPF_IF_ACTIVE 0
@@ -126,6 +126,11 @@ struct ospf_interface
struct prefix *address; /* Interface prefix */
struct connected *connected; /* Pointer to connected */
+ /* To which multicast groups do we currently belong? */
+ u_char multicast_memberships;
+#define MEMBER_ALLROUTERS 0x1
+#define MEMBER_DROUTERS 0x2
+
/* Configured varables. */
struct ospf_if_params *params;
u_int32_t crypt_seqnum; /* Cryptographic Sequence Number */
@@ -248,4 +253,8 @@ int ospf_crypt_key_delete (struct list *, u_char);
u_char ospf_default_iftype(struct interface *ifp);
+/* Set all multicast memberships appropriately based on the type and
+ state of the interface. */
+extern void ospf_if_set_multicast(struct ospf_interface *);
+
#endif /* _ZEBRA_OSPF_INTERFACE_H */