]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_packet.h
zebra: Allow ns delete to happen after under/over flow checks
[mirror_frr.git] / ospfd / ospf_packet.h
index 337686ad886923649af932286ff501db5f01ad5e..a508727968a37366798233fef64055697286cf88 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_PACKET_H
 #define MSG_OK    0
 #define MSG_NG    1
 
-struct ospf_packet
-{
-  struct ospf_packet *next;
+struct ospf_packet {
+       struct ospf_packet *next;
 
-  /* Pointer to data stream. */
-  struct stream *s;
+       /* Pointer to data stream. */
+       struct stream *s;
 
-  /* IP destination address. */
-  struct in_addr dst;
+       /* IP destination address. */
+       struct in_addr dst;
 
-  /* OSPF packet length. */
-  u_int16_t length;
+       /* OSPF packet length. */
+       uint16_t length;
 };
 
 /* OSPF packet queue structure. */
-struct ospf_fifo
-{
-  unsigned long count;
+struct ospf_fifo {
+       unsigned long count;
 
-  struct ospf_packet *head;
-  struct ospf_packet *tail;
+       struct ospf_packet *head;
+       struct ospf_packet *tail;
 };
 
 /* OSPF packet header structure. */
-struct ospf_header
-{
-  u_char version;                       /* OSPF Version. */
-  u_char type;                          /* Packet Type. */
-  u_int16_t length;                     /* Packet Length. */
-  struct in_addr router_id;             /* Router ID. */
-  struct in_addr area_id;               /* Area ID. */
-  u_int16_t checksum;                   /* Check Sum. */
-  u_int16_t auth_type;                  /* Authentication Type. */
-  /* Authentication Data. */
-  union
-  {
-    /* Simple Authentication. */
-    u_char auth_data [OSPF_AUTH_SIMPLE_SIZE];
-    /* Cryptographic Authentication. */
-    struct
-    {
-      u_int16_t zero;                   /* Should be 0. */
-      u_char key_id;                    /* Key ID. */
-      u_char auth_data_len;             /* Auth Data Length. */
-      u_int32_t crypt_seqnum;           /* Cryptographic Sequence Number. */
-    } crypt;
-  } u;
+struct ospf_header {
+       uint8_t version;          /* OSPF Version. */
+       uint8_t type;             /* Packet Type. */
+       uint16_t length;          /* Packet Length. */
+       struct in_addr router_id; /* Router ID. */
+       struct in_addr area_id;   /* Area ID. */
+       uint16_t checksum;      /* Check Sum. */
+       uint16_t auth_type;       /* Authentication Type. */
+       /* Authentication Data. */
+       union {
+               /* Simple Authentication. */
+               uint8_t auth_data[OSPF_AUTH_SIMPLE_SIZE];
+               /* Cryptographic Authentication. */
+               struct {
+                       uint16_t zero;   /* Should be 0. */
+                       uint8_t key_id; /* Key ID. */
+                       uint8_t auth_data_len; /* Auth Data Length. */
+                       uint32_t crypt_seqnum; /* Cryptographic Sequence
+                                                  Number. */
+               } crypt;
+       } u;
 };
 
 /* OSPF Hello body format. */
-struct ospf_hello
-{
-  struct in_addr network_mask;
-  u_int16_t hello_interval;
-  u_char options;
-  u_char priority;
-  u_int32_t dead_interval;
-  struct in_addr d_router;
-  struct in_addr bd_router;
-  struct in_addr neighbors[1];
+struct ospf_hello {
+       struct in_addr network_mask;
+       uint16_t hello_interval;
+       uint8_t options;
+       uint8_t priority;
+       uint32_t dead_interval;
+       struct in_addr d_router;
+       struct in_addr bd_router;
+       struct in_addr neighbors[1];
 };
 
 /* OSPF Database Description body format. */
-struct ospf_db_desc
-{
-  u_int16_t mtu;
-  u_char options;
-  u_char flags;
-  u_int32_t dd_seqnum;
+struct ospf_db_desc {
+       uint16_t mtu;
+       uint8_t options;
+       uint8_t flags;
+       uint32_t dd_seqnum;
 };
 
-struct ospf_ls_update
-{
-  u_int32_t num_lsas;
+struct ospf_ls_update {
+       uint32_t num_lsas;
 };
 
 /* Macros. */
@@ -139,39 +131,41 @@ struct ospf_ls_update
 #define IS_SET_DD_ALL(X)        ((X) & OSPF_DD_FLAG_ALL)
 
 /* Prototypes. */
-extern void ospf_output_forward (struct stream *, int);
-extern struct ospf_packet *ospf_packet_new (size_t);
-extern void ospf_packet_free (struct ospf_packet *);
-extern struct ospf_fifo *ospf_fifo_new (void);
-extern void ospf_fifo_push (struct ospf_fifo *, struct ospf_packet *);
-extern struct ospf_packet *ospf_fifo_pop (struct ospf_fifo *);
-extern struct ospf_packet *ospf_fifo_head (struct ospf_fifo *);
-extern void ospf_fifo_flush (struct ospf_fifo *);
-extern void ospf_fifo_free (struct ospf_fifo *);
-extern void ospf_packet_add (struct ospf_interface *, struct ospf_packet *);
-extern void ospf_packet_delete (struct ospf_interface *);
-extern struct stream *ospf_stream_dup (struct stream *);
-extern struct ospf_packet *ospf_packet_dup (struct ospf_packet *);
-
-extern int ospf_read (struct thread *);
-extern void ospf_hello_send (struct ospf_interface *);
-extern void ospf_db_desc_send (struct ospf_neighbor *);
-extern void ospf_db_desc_resend (struct ospf_neighbor *);
-extern void ospf_ls_req_send (struct ospf_neighbor *);
-extern void ospf_ls_upd_send_lsa (struct ospf_neighbor *, struct ospf_lsa *,
-                                 int);
-extern void ospf_ls_upd_send (struct ospf_neighbor *, struct list *, int);
-extern void ospf_ls_ack_send (struct ospf_neighbor *, struct ospf_lsa *);
-extern void ospf_ls_ack_send_delayed (struct ospf_interface *);
-extern void ospf_ls_retransmit (struct ospf_interface *, struct ospf_lsa *);
-extern void ospf_ls_req_event (struct ospf_neighbor *);
-
-extern int ospf_ls_upd_timer (struct thread *);
-extern int ospf_ls_ack_timer (struct thread *);
-extern int ospf_poll_timer (struct thread *);
-extern int ospf_hello_reply_timer (struct thread *);
+extern void ospf_output_forward(struct stream *, int);
+extern struct ospf_packet *ospf_packet_new(size_t);
+extern void ospf_packet_free(struct ospf_packet *);
+extern struct ospf_fifo *ospf_fifo_new(void);
+extern void ospf_fifo_push(struct ospf_fifo *, struct ospf_packet *);
+extern struct ospf_packet *ospf_fifo_pop(struct ospf_fifo *);
+extern struct ospf_packet *ospf_fifo_head(struct ospf_fifo *);
+extern void ospf_fifo_flush(struct ospf_fifo *);
+extern void ospf_fifo_free(struct ospf_fifo *);
+extern void ospf_packet_add(struct ospf_interface *, struct ospf_packet *);
+extern void ospf_packet_delete(struct ospf_interface *);
+extern struct stream *ospf_stream_dup(struct stream *);
+extern struct ospf_packet *ospf_packet_dup(struct ospf_packet *);
+
+extern int ospf_read(struct thread *);
+extern void ospf_hello_send(struct ospf_interface *);
+extern void ospf_db_desc_send(struct ospf_neighbor *);
+extern void ospf_db_desc_resend(struct ospf_neighbor *);
+extern void ospf_ls_req_send(struct ospf_neighbor *);
+extern void ospf_ls_upd_send_lsa(struct ospf_neighbor *, struct ospf_lsa *,
+                                int);
+extern void ospf_ls_upd_send(struct ospf_neighbor *, struct list *, int, int);
+extern void ospf_ls_ack_send(struct ospf_neighbor *, struct ospf_lsa *);
+extern void ospf_ls_ack_send_delayed(struct ospf_interface *);
+extern void ospf_ls_retransmit(struct ospf_interface *, struct ospf_lsa *);
+extern void ospf_ls_req_event(struct ospf_neighbor *);
+
+extern int ospf_ls_upd_timer(struct thread *);
+extern int ospf_ls_ack_timer(struct thread *);
+extern int ospf_poll_timer(struct thread *);
+extern int ospf_hello_reply_timer(struct thread *);
 
 extern const struct message ospf_packet_type_str[];
 extern const size_t ospf_packet_type_str_max;
 
+extern void ospf_proactively_arp(struct ospf_neighbor *);
+
 #endif /* _ZEBRA_OSPF_PACKET_H */