mirror of
				https://git.proxmox.com/git/mirror_frr
				synced 2025-11-04 01:43:38 +00:00 
			
		
		
		
	NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches.  Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
  safely convert between big-endian IEEE-754 single and double binary
  format, as used in IETF RFCs, and C99.  Implementation depends on host
  using __STDC_IEC_559__, which should be everything we care about.  Should
  correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
   - Add new link-params CLI commands
   - Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
		
	
			
		
			
				
	
	
		
			147 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			147 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * This is an implementation of rfc2370.
 | 
						|
 * Copyright (C) 2001 KDD R&D Laboratories, Inc.
 | 
						|
 * http://www.kddlabs.co.jp/
 | 
						|
 *
 | 
						|
 * This file is part of GNU Zebra.
 | 
						|
 *
 | 
						|
 * GNU Zebra is free software; you can redistribute it and/or modify it
 | 
						|
 * under the terms of the GNU General Public License as published by the
 | 
						|
 * Free Software Foundation; either version 2, or (at your option) any
 | 
						|
 * later version.
 | 
						|
 * 
 | 
						|
 * GNU Zebra is distributed in the hope that it will be useful, but
 | 
						|
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
						|
 * 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.
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef _ZEBRA_OSPF_OPAQUE_H
 | 
						|
#define _ZEBRA_OSPF_OPAQUE_H
 | 
						|
 | 
						|
#include "vty.h"
 | 
						|
 | 
						|
#define	IS_OPAQUE_LSA(type) \
 | 
						|
	((type) == OSPF_OPAQUE_LINK_LSA  || \
 | 
						|
	 (type) == OSPF_OPAQUE_AREA_LSA  || \
 | 
						|
	 (type) == OSPF_OPAQUE_AS_LSA)
 | 
						|
 | 
						|
/*
 | 
						|
 * Opaque LSA's link state ID is redefined as follows.
 | 
						|
 *
 | 
						|
 *        24       16        8        0
 | 
						|
 * +--------+--------+--------+--------+
 | 
						|
 * |tttttttt|........|........|........|
 | 
						|
 * +--------+--------+--------+--------+
 | 
						|
 * |<-Type->|<------- Opaque ID ------>|
 | 
						|
 */
 | 
						|
#define LSID_OPAQUE_TYPE_MASK	0xff000000	/*  8 bits */
 | 
						|
#define LSID_OPAQUE_ID_MASK	0x00ffffff	/* 24 bits */
 | 
						|
 | 
						|
#define	GET_OPAQUE_TYPE(lsid) \
 | 
						|
	(((u_int32_t)(lsid) & LSID_OPAQUE_TYPE_MASK) >> 24)
 | 
						|
 | 
						|
#define	GET_OPAQUE_ID(lsid) \
 | 
						|
	 ((u_int32_t)(lsid) & LSID_OPAQUE_ID_MASK)
 | 
						|
 | 
						|
#define	SET_OPAQUE_LSID(type, id) \
 | 
						|
	((((type) << 24) & LSID_OPAQUE_TYPE_MASK) \
 | 
						|
	| ((id)          & LSID_OPAQUE_ID_MASK))
 | 
						|
 | 
						|
/*
 | 
						|
 * Opaque LSA types will be assigned by IANA.
 | 
						|
 * <http://www.iana.org/assignments/ospf-opaque-types>
 | 
						|
 */
 | 
						|
#define OPAQUE_TYPE_TRAFFIC_ENGINEERING_LSA		1
 | 
						|
#define OPAQUE_TYPE_SYCAMORE_OPTICAL_TOPOLOGY_DESC	2
 | 
						|
#define OPAQUE_TYPE_GRACE_LSA				3
 | 
						|
#define OPAQUE_TYPE_L1VPN_LSA                          5
 | 
						|
#define OPAQUE_TYPE_ROUTER_INFORMATION_LSA             4
 | 
						|
#define OPAQUE_TYPE_INTER_AS_LSA                       6
 | 
						|
#define OPAQUE_TYPE_MAX                                6
 | 
						|
 | 
						|
/* Followings types are proposed in internet-draft documents. */
 | 
						|
#define OPAQUE_TYPE_8021_QOSPF				129
 | 
						|
#define OPAQUE_TYPE_SECONDARY_NEIGHBOR_DISCOVERY	224
 | 
						|
#define OPAQUE_TYPE_FLOODGATE                           225
 | 
						|
 | 
						|
/* Ugly hack to make use of an unallocated value for wildcard matching! */
 | 
						|
#define OPAQUE_TYPE_WILDCARD				0
 | 
						|
 | 
						|
#define OPAQUE_TYPE_RANGE_UNASSIGNED(type) \
 | 
						|
	( OPAQUE_TYPE_MAX  <= (type) && (type) <= 127)
 | 
						|
 | 
						|
#define OPAQUE_TYPE_RANGE_RESERVED(type) \
 | 
						|
	(127 <  (type) && (type) <= 255)
 | 
						|
 | 
						|
#define VALID_OPAQUE_INFO_LEN(lsahdr) \
 | 
						|
	((ntohs((lsahdr)->length) >= sizeof (struct lsa_header)) && \
 | 
						|
	((ntohs((lsahdr)->length) %  sizeof (u_int32_t)) == 0))
 | 
						|
 | 
						|
/* Prototypes. */
 | 
						|
 | 
						|
extern void ospf_opaque_init (void);
 | 
						|
extern void ospf_opaque_term (void);
 | 
						|
extern int ospf_opaque_type9_lsa_init (struct ospf_interface *oi);
 | 
						|
extern void ospf_opaque_type9_lsa_term (struct ospf_interface *oi);
 | 
						|
extern int ospf_opaque_type10_lsa_init (struct ospf_area *area);
 | 
						|
extern void ospf_opaque_type10_lsa_term (struct ospf_area *area);
 | 
						|
extern int ospf_opaque_type11_lsa_init (struct ospf *ospf);
 | 
						|
extern void ospf_opaque_type11_lsa_term (struct ospf *ospf);
 | 
						|
 | 
						|
extern int
 | 
						|
ospf_register_opaque_functab (
 | 
						|
  u_char lsa_type,
 | 
						|
  u_char opaque_type,
 | 
						|
  int (* new_if_hook)(struct interface *ifp),
 | 
						|
  int (* del_if_hook)(struct interface *ifp),
 | 
						|
  void (* ism_change_hook)(struct ospf_interface *oi, int old_status),
 | 
						|
  void (* nsm_change_hook)(struct ospf_neighbor *nbr, int old_status),
 | 
						|
  void (* config_write_router)(struct vty *vty),
 | 
						|
  void (* config_write_if    )(struct vty *vty, struct interface *ifp),
 | 
						|
  void (* config_write_debug )(struct vty *vty),
 | 
						|
  void (* show_opaque_info   )(struct vty *vty, struct ospf_lsa *lsa),
 | 
						|
  int  (* lsa_originator)(void *arg),
 | 
						|
  struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
 | 
						|
  int (* new_lsa_hook)(struct ospf_lsa *lsa),
 | 
						|
  int (* del_lsa_hook)(struct ospf_lsa *lsa)
 | 
						|
);
 | 
						|
extern void ospf_delete_opaque_functab (u_char lsa_type, u_char opaque_type);
 | 
						|
 | 
						|
extern int ospf_opaque_new_if (struct interface *ifp);
 | 
						|
extern int ospf_opaque_del_if (struct interface *ifp);
 | 
						|
extern void ospf_opaque_ism_change (struct ospf_interface *oi,
 | 
						|
				    int old_status);
 | 
						|
extern void ospf_opaque_nsm_change (struct ospf_neighbor *nbr,
 | 
						|
				    int old_status);
 | 
						|
extern void ospf_opaque_config_write_router (struct vty *vty, struct ospf *);
 | 
						|
extern void ospf_opaque_config_write_if (struct vty *vty,
 | 
						|
					 struct interface *ifp);
 | 
						|
extern void ospf_opaque_config_write_debug (struct vty *vty);
 | 
						|
extern void show_opaque_info_detail (struct vty *vty, struct ospf_lsa *lsa);
 | 
						|
extern void ospf_opaque_lsa_dump (struct stream *s, u_int16_t length);
 | 
						|
 | 
						|
extern void ospf_opaque_lsa_originate_schedule (struct ospf_interface *oi,
 | 
						|
						int *init_delay);
 | 
						|
extern struct ospf_lsa *ospf_opaque_lsa_install (struct ospf_lsa *,
 | 
						|
						 int rt_recalc);
 | 
						|
extern struct ospf_lsa *ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
 | 
						|
 | 
						|
extern void ospf_opaque_lsa_reoriginate_schedule (void *lsa_type_dependent,
 | 
						|
						  u_char lsa_type,
 | 
						|
						  u_char opaque_type);
 | 
						|
extern void ospf_opaque_lsa_refresh_schedule (struct ospf_lsa *lsa);
 | 
						|
extern void ospf_opaque_lsa_flush_schedule (struct ospf_lsa *lsa);
 | 
						|
 | 
						|
extern void ospf_opaque_self_originated_lsa_received (struct ospf_neighbor
 | 
						|
						      *nbr,
 | 
						|
						      struct ospf_lsa *lsa);
 | 
						|
extern struct ospf *oi_to_top (struct ospf_interface *oi);
 | 
						|
 | 
						|
#endif /* _ZEBRA_OSPF_OPAQUE_H */
 |