/* ip_with_rip.h */
/* Definitions for the interface between rip and ip. */

/* Global Definitions. */
#define		IP_NEXT_ADDR_UNDEFINED		-1
#define		IP_BROADCAST_NODE_ADDR		-1
#define		IP_BROADCAST_NET_ADDR		-1


/* The following connection types specify the type of connection to be set up	*/
/* for RIP and other application data e.g. in an ATM network. For RIP messages,	*/
/* connection type 1 is set up (less connection bandwidth), whereas for other	*/
/* data, connection type 0 is used.												*/

#define		CONNECTION_CLASS_0			0
#define		CONNECTION_CLASS_1			1

/* Data Structures */

typedef struct
    {
    Boolean			dirty_bit;
	IpT_Address		dest_addr;
	IpT_Address		subnet_mask;
	IpT_Address		next_addr;
    int				metric;
    Boolean			route_change_flag;
    Boolean			garbage_collection_started;
    Evhandle		timer;
    } RipT_Rte_Entry;

typedef struct
	{
	int					num_entries;
	RipT_Rte_Entry **	entry_ptr_array;
	} RipT_Rte_Table;

typedef	RipT_Rte_Table *		RipT_Rte_Table_Ptr;

typedef Compcode (* RipT_Rte_Select_Func_Ptr) (int, RipT_Rte_Table_Ptr, int *, int *, int, int);

typedef struct
    {
    RipT_Rte_Table_Ptr			rip_rte_table_ptr;
    RipT_Rte_Select_Func_Ptr	rip_rte_select_func_ptr;
    } RipT_Info;

typedef struct
    {
	IpT_Address		dest_addr;
	IpT_Address		subnet_mask;
    int				dest_fast_addr;
    int				metric;
    } RipT_Rte_Update;

typedef		RipT_Rte_Update*	RipT_Rte_Update_Ptr;

typedef struct
	{
	int						num_updates;
	RipT_Rte_Update_Ptr		update_array;
	} RipT_Rte_Update_Set;
