From 05b7709dad416146376cc4f41db0c866b3738f5b Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Tue, 23 Aug 2011 11:36:27 +0400 Subject: ospfd: sizing macros cleanup * ospf_spf.c * ROUTER_LSA_TOS_SIZE: prepend OSPF_ and move to ospf_lsa.h * ROUTER_LSA_MIN_SIZE: replace with existing OSPF_ROUTER_LSA_LINK_SIZE --- ospfd/ospf_lsa.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ospfd/ospf_lsa.h') diff --git a/ospfd/ospf_lsa.h b/ospfd/ospf_lsa.h index 72e2f8a5..bf3b083c 100644 --- a/ospfd/ospf_lsa.h +++ b/ospfd/ospf_lsa.h @@ -49,6 +49,7 @@ #define OSPF_LSA_HEADER_SIZE 20U #define OSPF_ROUTER_LSA_LINK_SIZE 12U +#define OSPF_ROUTER_LSA_TOS_SIZE 4U #define OSPF_MAX_LSA_SIZE 1500U /* AS-external-LSA refresh method. */ -- cgit v1.2.1 From 8216f53b73d8eb375615ad4395deace11d1e22d6 Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Mon, 3 Oct 2011 14:08:01 +0400 Subject: ospfd: justify ospf_default_originate_timer() The function is implemented in ospf_lsa.c, move its "extern" declaration to ospf_lsa.h for consistency. --- ospfd/ospf_lsa.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ospfd/ospf_lsa.h') diff --git a/ospfd/ospf_lsa.h b/ospfd/ospf_lsa.h index bf3b083c..f364840f 100644 --- a/ospfd/ospf_lsa.h +++ b/ospfd/ospf_lsa.h @@ -275,6 +275,7 @@ extern struct in_addr ospf_get_ip_from_ifp (struct ospf_interface *); extern struct ospf_lsa *ospf_external_lsa_originate (struct ospf *, struct external_info *); extern int ospf_external_lsa_originate_timer (struct thread *); +extern int ospf_default_originate_timer (struct thread *); extern struct ospf_lsa *ospf_lsa_lookup (struct ospf_area *, u_int32_t, struct in_addr, struct in_addr); extern struct ospf_lsa *ospf_lsa_lookup_by_id (struct ospf_area *, -- cgit v1.2.1 From 4e31de792ec5e48a97360b5b86196b4fa02996a3 Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Fri, 17 Feb 2012 16:20:50 +0400 Subject: ospfd: introduce ospf_lsa_minlen[] (BZ#705) This commit ports more packet checks to OSPFv2, in particular, LSA size verification and Router-LSA link blocks verification. * ospf_lsa.h: add LSA size macros * ospf_packet.h: add struct ospf_ls_update * ospf_packet.c * ospf_lsa_minlen[]: a direct equivalent of ospf6_lsa_minlen[] * ospf_router_lsa_links_examin(): new function, verifies trailing part of a Router-LSA * ospf_lsa_examin(): new function like ospf6_lsa_examin() * ospf_lsaseq_examin(): new function like ospf6_lsaseq_examin() * ospf_packet_examin(): add type-specific deeper level checks --- ospfd/ospf_lsa.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ospfd/ospf_lsa.h') diff --git a/ospfd/ospf_lsa.h b/ospfd/ospf_lsa.h index f364840f..297cd984 100644 --- a/ospfd/ospf_lsa.h +++ b/ospfd/ospf_lsa.h @@ -153,6 +153,7 @@ struct router_lsa_link }; /* OSPF Router-LSAs structure. */ +#define OSPF_ROUTER_LSA_MIN_SIZE 16U /* w/1 link descriptor */ struct router_lsa { struct lsa_header header; @@ -170,6 +171,7 @@ struct router_lsa }; /* OSPF Network-LSAs structure. */ +#define OSPF_NETWORK_LSA_MIN_SIZE 8U /* w/1 router-ID */ struct network_lsa { struct lsa_header header; @@ -178,6 +180,7 @@ struct network_lsa }; /* OSPF Summary-LSAs structure. */ +#define OSPF_SUMMARY_LSA_MIN_SIZE 8U /* w/1 TOS metric block */ struct summary_lsa { struct lsa_header header; @@ -187,6 +190,7 @@ struct summary_lsa }; /* OSPF AS-external-LSAs structure. */ +#define OSPF_AS_EXTERNAL_LSA_MIN_SIZE 16U /* w/1 TOS forwarding block */ struct as_external_lsa { struct lsa_header header; -- cgit v1.2.1