diff options
author | ajs <ajs> | 2004-12-15 15:07:19 +0000 |
---|---|---|
committer | ajs <ajs> | 2004-12-15 15:07:19 +0000 |
commit | bc18d616ad7d1d580e1e04c28eab2cd9afb67fad (patch) | |
tree | 2177945097bf719604b066c35724b55606ad7eae /ospfd/ospf_interface.c | |
parent | 766a0ca3dcb824fc9283be89bb57e47132b26826 (diff) |
2004-12-15 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_interface.h: Declare new function ospf_default_iftype.
* ospf_interface.c: (ospf_default_iftype) New function to centralize
this logic in one place.
* ospf_zebra.c: (ospf_interface_add) Use new function
ospf_default_iftype.
* ospf_vty.c: (no_ip_ospf_network,config_write_interface) Fix logic
by using new function ospf_default_iftype.
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r-- | ospfd/ospf_interface.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index 5a8f4532..da08360d 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -1174,6 +1174,17 @@ ospf_crypt_key_delete (struct list *auth_crypt, u_char key_id) return 0; } +u_char +ospf_default_iftype(struct interface *ifp) +{ + if (if_is_pointopoint (ifp)) + return OSPF_IFTYPE_POINTOPOINT; + else if (if_is_loopback (ifp)) + return OSPF_IFTYPE_LOOPBACK; + else + return OSPF_IFTYPE_BROADCAST; +} + void ospf_if_init () { |