#include <opnet.h>
#include <ema.h>
#include <opnet_emadefs.h>
#include <opnet_constants.h>



/* array for all textlist attributes in model */
Prg_List*		prg_lptr [23];

/* array for all objects in model */
EmaT_Object_Id		obj [64];



main (int argc, char* argv [])
	{
	EmaT_Model_Id			model_id;
	int					i;

	/* initialize EMA package */
	Ema_Init (EMAC_MODE_ERR_PRINT, argc, argv);

	/* create an empty model */
	model_id = Ema_Model_Create (MOD_PROCESS);



	/* create all objects */
	obj [0] = Ema_Object_Create (model_id, OBJ_PR_ATTR_ASSGN);
	obj [1] = Ema_Object_Create (model_id, OBJ_PR_ATTR_ASSGN);
	obj [2] = Ema_Object_Create (model_id, OBJ_PR_ATTR_ASSGN);
	obj [3] = Ema_Object_Create (model_id, OBJ_PR_ATTR_ASSGN);
	obj [4] = Ema_Object_Create (model_id, OBJ_PR_ATTR_ASSGN);
	obj [5] = Ema_Object_Create (model_id, OBJ_PR_ATTR_ASSGN);
	obj [6] = Ema_Object_Create (model_id, OBJ_PR_ATTR_ASSGN);
	obj [7] = Ema_Object_Create (model_id, OBJ_PR_STATE);
	obj [8] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [9] = Ema_Object_Create (model_id, OBJ_PR_STATE);
	obj [10] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [11] = Ema_Object_Create (model_id, OBJ_PR_STATE);
	obj [12] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [13] = Ema_Object_Create (model_id, OBJ_PR_STATE);
	obj [14] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [15] = Ema_Object_Create (model_id, OBJ_PR_STATE);
	obj [16] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [17] = Ema_Object_Create (model_id, OBJ_PR_STATE);
	obj [18] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [19] = Ema_Object_Create (model_id, OBJ_PR_STATE);
	obj [20] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [21] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [22] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [23] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [24] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [25] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [26] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [27] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [28] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [29] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [30] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [31] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [32] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [33] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [34] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [35] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [36] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [37] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [38] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [39] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [40] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [41] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [42] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [43] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [44] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [45] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [46] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [47] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [48] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [49] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [50] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [51] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [52] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [53] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [54] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [55] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [56] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [57] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [58] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [59] = Ema_Object_Create (model_id, OBJ_PR_TRANS);
	obj [60] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [61] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [62] = Ema_Object_Create (model_id, OBJ_PR_POS);
	obj [63] = Ema_Object_Create (model_id, OBJ_PR_POS);




	/* set the model level attributes */
	/* create and init prg list 'prg_lptr [0]' */
	prg_lptr [0] = prg_list_create ();
	prg_list_strings_append (prg_lptr [0], 
		"/* State variables defined by OSPF specification. */",
		"OspfT_Interface_Type		\\ospf_interface_type;",
		"OspfT_Interface_State		\\ospf_interface_oper_state;",
		"IpT_Address					\\ospf_interface_address;",
		"IpT_Address					\\ospf_interface_mask;",
		"IpT_Address					\\ospf_interface_area_id;",
		"double						\\ospf_interface_hello_interval;",
		"double						\\ospf_interface_router_dead_interval;",
		"double						\\ospf_interface_transmit_delay;",
		"int							\\ospf_interface_router_priority;",
		"List *						\\ospf_interface_neighbor_list_ptr;",
		"OspfT_Router_Id				\\ospf_interface_designated_router_id;",
		"IpT_Address					\\ospf_interface_dr_intf_addr;",
		"OspfT_Router_Id				\\ospf_interface_backup_designated_router_id;",
		"IpT_Address					\\ospf_interface_backup_dr_intf_addr;",
		"int							\\ospf_interface_cost;",
		"double						\\ospf_interface_retransmit_interval;",
		"",
		"/* State variables used by OPNET model. */",
		"Objid						\\ospf_interface_my_objid;			/* Objid of OSPF module. */",
		"Objid						\\ospf_interface_objid;				/* Objid of interface sub-object. */",
		"Evhandle					\\ospf_interface_hello_timer_handle;",
		"Evhandle					\\ospf_interface_wait_timer_handle;",
		"",
		"/* State variable that represents this interface. */",
		"OspfT_Interface *			\\ospf_interface_self_ptr;",
		PRGC_NIL);

	/* create and init prg list 'prg_lptr [1]' */
	prg_lptr [1] = prg_list_create ();
	prg_list_strings_append (prg_lptr [1], 
		"OspfT_Interface_Invoke_Info *		intf_info_ptr;",
		"Objid								neighbor_list_objid;",
		"OspfT_Dr_Status						router_dr_status;",
		PRGC_NIL);

	/* create and init prg list 'prg_lptr [2]' */
	prg_lptr [2] = prg_list_create ();
	prg_list_strings_append (prg_lptr [2], 
		"/***** Includes *****/",
		"",
		"/* OMS specific headers */",
		"#include \"oms_pr.h\"",
		"",
		"/* IP specific headers */",
		"#include \"ip3_addr.h\"",
		"#include \"ip3_rte.h\"",
		"",
		"/* Dijkstra package. */",
		"#include \"djk.h\"",
		"",
		"/* OSPF specific header files */",
		"#include \"ospf_defs.h\"",
		"#include \"ospf_const.h\"",
		"#include \"ospf_lsa.h\"",
		"#include \"ospf_neighbor.h\"",
		"#include \"ospf_interface.h\"",
		"#include \"ospf_area.h\"",
		"#include \"ospf_msg.h\"",
		"",
		"/***** Globals *****/",
		"extern IpT_Address		IpI_Default_Addr;",
		"extern IpT_Address		OspfI_All_Spf_Routers;",
		"extern IpT_Address		OspfI_All_Dr_Routers;",
		"",
		"/***** Typedefs *****/",
		"typedef enum OspfT_Dr_Status",
		"	{",
		"	OspfC_Dr_Status_Dr,",
		"	OspfC_Dr_Status_Backup,	",
		"	OspfC_Dr_Status_Other",
		"	} OspfT_Dr_Status;",
		"",
		"/***** State Transition Macros *****/",
		"#define PT_TO_PT		ospf_interface_type == OspfC_Interface_Type_Pt_To_Pt",
		"#define DR_ELIGIBLE		ospf_interface_router_priority > 0",
		"#define BACKUP_SEEN		ospf_interface_current_event () == OspfC_Interface_Event_Bkup_Seen",
		"#define WAIT_TIMER		op_intrpt_type () == OPC_INTRPT_SELF",
		"#define NEIGHBOR_CHANGE	ospf_interface_current_event () == OspfC_Interface_Event_Nbr_Change",
		"#define DR				router_dr_status == OspfC_Dr_Status_Dr",
		"#define BACKUP			router_dr_status == OspfC_Dr_Status_Backup",
		"#define DR_OTHER		router_dr_status == OspfC_Dr_Status_Other",
		"",
		"/***** Procdecs *****/",
		"void					ospf_interface_sv_init (OspfT_Interface *interface_ptr, IpT_Interface_Info *ip_interface_ptr);",
		"void					ospf_interface_hello_timer_set (OspfT_Interface *interface_ptr, int intrpt_code);",
		"OspfT_Interface_Event	ospf_interface_current_event (void);",
		"void					ospf_interface_state_change (OspfT_Interface_State new_state);",
		"void					ospf_interface_wait_timer_set (void);",
		"void					ospf_interface_dr_elect (void);",
		"OspfT_Neighbor *		ospf_interface_dr_choose (List *neighbor_list_ptr, OspfT_Router_Id exclude_router_id, Boolean choose_backup_dr);",
		PRGC_NIL);

	/* create and init prg list 'prg_lptr [3]' */
	prg_lptr [3] = prg_list_create ();
	prg_list_strings_append (prg_lptr [3], 
		"void",
		"ospf_interface_sv_init (OspfT_Interface *interface_ptr, IpT_Interface_Info *ip_interface_ptr)",
		"	{",
		"	char					area_id_str [IPC_ADDR_STR_LEN];",
		"	int						num_interfaces, intf_index;",
		"	int						outstrm_count;",
		"	Objid					outstrm_objid;",
		"",
		"	/** Initialize the state variables of this process.  The   **/",
		"	/** values for these variables are gotten from the         **/",
		"	/** attributes of the interface object id (which is a      **/",
		"	/** sub-object of the interface table compound attribute). **/",
		"	/** Note that this function assumes that ospf_interface_objid has **/",
		"	/** already been initialized (this should be passed from   **/",
		"	/** the top level OSPF process to this interface process). **/",
		"	/** This function also has the job of filling in the       **/",
		"	/** components of the interface data structure and         **/",
		"	/** registering the dynamic state as part of the process   **/",
		"	/** registry.                                              **/",
		"	FIN (ospf_interface_sv_init (interface_ptr, interface_index));",
		"",
		"	/* Retrieve appropriate attributes from the interface sub-object */",
		"	/* that correspond to state variables.                           */",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Area ID\", &area_id_str);",
		"	ospf_interface_area_id = ip_address_create (area_id_str);",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Hello Interval\", &ospf_interface_hello_interval);",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Router Dead Interval\", &ospf_interface_router_dead_interval);",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Interface Transmission Delay\", &ospf_interface_transmit_delay);",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Retransmission Interval\", &ospf_interface_retransmit_interval);",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Interface Cost\", &ospf_interface_cost);",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Router Priority\", &ospf_interface_router_priority);",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Interface Type\", &ospf_interface_type);",
		"",
		"	/* Initialize the self-reference. */",
		"	ospf_interface_self_ptr = interface_ptr;",
		"",
		"	/* Also set the static members of the interface data structure. */",
		"	interface_ptr->interface_type = ospf_interface_type;",
		"	ospf_interface_address = ip_address_copy (ip_interface_ptr->addr_range_ptr->address);",
		"	interface_ptr->interface_address = ip_address_copy (ip_interface_ptr->addr_range_ptr->address);",
		"	ospf_interface_mask = ip_address_copy (ip_interface_ptr->addr_range_ptr->subnet_mask);",
		"	interface_ptr->interface_mask = ip_address_copy (ip_interface_ptr->addr_range_ptr->subnet_mask);",
		"	interface_ptr->mtu = ip_interface_ptr->mtu;",
		"	interface_ptr->area_id = ip_address_copy (ospf_interface_area_id);",
		"	interface_ptr->hello_interval = ospf_interface_hello_interval;",
		"	interface_ptr->router_dead_interval = ospf_interface_router_dead_interval; ",
		"	interface_ptr->transmit_delay = ospf_interface_transmit_delay;",
		"	interface_ptr->router_priority = ospf_interface_router_priority;",
		"	interface_ptr->cost = ospf_interface_cost;",
		"	interface_ptr->retransmit_interval = ospf_interface_retransmit_interval;",
		"",
		"	/* Initialize remaining state variables to reasonable values. */",
		"	/* These will be filled in later as part of the operation of  */",
		"	/* the Hello Protocol.                                        */",
		"	ospf_interface_neighbor_list_ptr = op_prg_list_create ();",
		"	ospf_interface_designated_router_id = ip_address_copy (IpI_Default_Addr);",
		"	ospf_interface_dr_intf_addr = ip_address_copy (IpI_Default_Addr);",
		"	ospf_interface_backup_designated_router_id = ip_address_copy (IpI_Default_Addr);",
		"	ospf_interface_backup_dr_intf_addr = ip_address_copy (IpI_Default_Addr);",
		"	ospf_interface_oper_state = OspfC_Interface_State_Down;",
		"",
		"	/* Register the dynamic state in the process registry. */",
		"	oms_pr_attr_set (interface_ptr->proc_reg_handle,",
		"		\"neighbor list\",			OMSC_PR_ADDRESS,	&ospf_interface_neighbor_list_ptr,",
		"		\"designated router\", 		OMSC_PR_ADDRESS,	&ospf_interface_designated_router_id,",
		"		\"DR interface addr\",		OMSC_PR_ADDRESS,	&ospf_interface_dr_intf_addr,",
		"		\"backup designated router\", OMSC_PR_ADDRESS,	&ospf_interface_backup_designated_router_id,",
		"		\"backup DR interface addr\",	OMSC_PR_ADDRESS,	&ospf_interface_backup_dr_intf_addr,",
		"		\"state\",					OMSC_PR_ADDRESS,    &ospf_interface_oper_state,",
		"		OPC_NIL);",
		"",
		"	FOUT;",
		"	}",
		"",
		"void",
		"ospf_interface_hello_timer_set (OspfT_Interface *interface_ptr, int intrpt_code)",
		"	{	",
		"	OspfT_Router_Id				router_id;",
		"	Packet *					hello_message_ptr;",
		"	OspfT_Router *				parent_router_ptr;",
		"",
		"	/** Start the hello timer for this interface, and schedule an event representing      **/",
		"	/** the next firing of the hello timer.  Returns an event handle for the next firing. **/",
		"	/** Note that the above arguments are ignored, since we rely on the fact that this    **/",
		"	/** procedure will be called in its original context, thus giving us access to the    **/",
		"	/** process model state variables.  The variables are there to match the type         **/",
		"	/** op_intrpt_schedule_call () expects.                                               **/",
		"	FIN (ospf_interface_hello_timer_set (interface_ptr, intrpt_code));",
		"",
		"	/* First create a reference to the router ID of the router this interface is a part of. */",
		"	parent_router_ptr = ospf_interface_parent_router_get (ospf_interface_self_ptr);",
		"	router_id = parent_router_ptr->router_id;",
		"",
		"	/* Create a hello message. */",
		"	hello_message_ptr = ospf_message_hello_create (ospf_interface_self_ptr);",
		"",
		"	/* Send the message on this interface. */",
		"	ospf_interface_hello_message_send (ospf_interface_self_ptr, hello_message_ptr);",
		"",
		"	/* Set the next firing of the hello timer.  Update the interface state variable */",
		PRGC_NIL);

	prg_list_strings_append (prg_lptr [3], 
		"	/* which holds the event handle for this timer.                                 */",
		"	ospf_interface_hello_timer_handle = op_intrpt_schedule_call (op_sim_time () + ospf_interface_hello_interval,",
		"		0, ospf_interface_hello_timer_set, OPC_NIL);",
		"",
		"	FOUT;",
		"	}",
		"",
		"OspfT_Interface_Event",
		"ospf_interface_current_event (void)",
		"	{",
		"	OspfT_Interface_Event 			cur_event;",
		"	Prohandle						invoking_process;",
		"	int								invoke_mode;",
		"	OspfT_Interface_Invoke_Info *	invoke_info_ptr;",
		"",
		"	/** Returns the event with which the interface process was invoked or scheduled. **/",
		"	FIN (ospf_interface_current_event (void));",
		"",
		"	/* Determine if this process was invoked by the root or the Simulation Kernel. */",
		"	invoking_process = op_pro_invoker (op_pro_self (), &invoke_mode);",
		"",
		"	if (invoke_mode == OPC_PROINV_DIRECT)",
		"		{",
		"		/* The process was invoked by the Simulation Kernel directly, so look */",
		"		/* at the interrupt code to determine the current event.              */",
		"		cur_event = (OspfT_Interface_Event) op_intrpt_code ();",
		"		}",
		"	else",
		"		{",
		"		/* The process was invoked via op_pro_invoke ().  The event is contained */",
		"		/* in the argument memory state passed from invoker to invokee.          */",
		"		invoke_info_ptr = (OspfT_Interface_Invoke_Info *) op_pro_argmem_access ();",
		"		cur_event = invoke_info_ptr->interface_event;",
		"		}",
		"",
		"	FRET (cur_event);",
		"	}",
		"",
		"void",
		"ospf_interface_state_change (OspfT_Interface_State new_state)",
		"	{",
		"	char					interface_addr_str [IPC_ADDR_STR_LEN];",
		"	char					trace_msg [512];",
		"	char					old_state_str [128];",
		"	OspfT_Interface_State	old_state;",
		"	char					new_state_str [128];",
		"",
		"	/** Change the operational state of the OSPF interface process.  This should **/",
		"	/** be called at the beginning of each OPNET state that corresponds to an    **/",
		"	/** OSPF operational state.                                                  **/",
		"	FIN (ospf_interface_state_change (new_state));",
		"",
		"	/* Keep old state and old state string. */",
		"	old_state = ospf_interface_oper_state;",
		"	ospf_interface_state_str_get (ospf_interface_oper_state, old_state_str);",
		"	",
		"	/* Change the state variable that represents the operational state. */",
		"	ospf_interface_oper_state = new_state;",
		"",
		"	/* Get new state string. */",
		"	ospf_interface_state_str_get (ospf_interface_oper_state, new_state_str);",
		"",
		"	if (op_prg_odb_ltrace_active (\"ospf_state\"))",
		"		{",
		"		ip_address_print (interface_addr_str, ospf_interface_address);",
		"		sprintf (trace_msg, \"Interface (%s) changed states from (%s) to (%s)\\n\", interface_addr_str,",
		"			old_state_str, new_state_str);",
		"		op_prg_odb_print_minor (trace_msg, OPC_NIL);",
		"		}",
		"",
		"	/* For an interface state change, originate a new router links advertisement. */",
		"	if (old_state != new_state)",
		"		{",
		"		ospf_area_router_links_originate (ospf_interface_self_ptr->parent_area_ptr);",
		"		",
		"		/* If we've just become designated router, originate a network links advertisement. */",
		"		if (new_state == OspfC_Interface_State_DR)",
		"			ospf_interface_network_links_originate (ospf_interface_self_ptr);",
		"		}",
		"",
		"	FOUT;",
		"	}",
		"",
		"void",
		"ospf_interface_wait_timer_set (void)",
		"	{",
		"	/** Set the wait timer for this interface.  This should be called from the WAITING **/",
		"	/** state of the interface process.  When this timer expires, the state machine    **/",
		"	/** should transition to Calc DR.                                                  **/",
		"	FIN (ospf_interface_wait_timer_set (void));",
		"",
		"	ospf_interface_self_ptr->wait_timer_handle = op_intrpt_schedule_self (op_sim_time () + ",
		"		ospf_interface_router_dead_interval, 0);",
		"",
		"	FOUT;",
		"	}",
		"",
		"void",
		"ospf_interface_dr_elect (void)",
		"	{",
		PRGC_NIL);

	prg_list_strings_append (prg_lptr [3], 
		"	int						num_neighbors, neighbor_index;",
		"	OspfT_Neighbor *		neighbor_ptr;",
		"	OspfT_Neighbor_State	neighbor_state;",
		"	OspfT_Router_Id			old_dr, old_backup_dr, best_dr, best_backup_dr;",
		"	OspfT_Neighbor *		best_backup_dr_neighbor_ptr;",
		"	OspfT_Neighbor *		best_dr_neighbor_ptr;",
		"	OspfT_Router_Id			self_router_id;",
		"	int						self_router_prio;",
		"	IpT_Address				self_ip_addr;",
		"	Boolean					self_declares, best_declares;",
		"	int						best_backup_dr_priority, best_dr_priority, neighbor_priority;",
		"	OspfT_Router_Id			temp_backup_dr_id, temp_best_dr_id;",
		"	IpT_Address				best_backup_dr_intf, best_dr_intf;",
		"",
		"	/** Carry out the designated router election for the network this router **/",
		"	/** is connected to.  The state variables for the DR and the Backup DR   **/",
		"	/** are modified by this procedure.                                      **/",
		"	FIN (ospf_interface_dr_elect (void));",
		"",
		"	/* Determine this router's ID and priority. */",
		"	self_router_id = ospf_interface_self_ptr->parent_area_ptr->parent_router_ptr->router_id;",
		"	self_router_prio = ospf_interface_router_priority;",
		"	self_ip_addr = ospf_interface_self_ptr->interface_address;",
		"	self_declares = ip_address_equal (ospf_interface_backup_designated_router_id, self_router_id);",
		"",
		"	/* Loop through the neighbors and determine the ones best suited to        */",
		"	/* be (Backup) Designated Routers.  Generally these are the routers with   */",
		"	/* the highest priority (and in the case of a tie, the highest router ID). */",
		"	/* See section 9.4 of RFC 1247 for the description of this algorithm.      */",
		"",
		"	/* Step 1: Note the old Designated Routers for future reference. */",
		"	old_dr = ip_address_copy (ospf_interface_designated_router_id);",
		"	old_backup_dr = ip_address_copy (ospf_interface_backup_designated_router_id);",
		"",
		"	/* Step 2: Choose a Backup Designated Router.  This is the router in the  */",
		"	/* eligible router list with the highest priority, and highest Router ID  */",
		"	/* for routers with equal priorities.  Routers that declared themselves   */",
		"	/* as Backup Designated Routers are preferred over routers that have not. */",
		"	best_backup_dr_neighbor_ptr = ospf_interface_dr_choose (ospf_interface_neighbor_list_ptr, ",
		"		OPC_NIL, OPC_TRUE);",
		"	",
		"	/* If there are no eligible neighbors, then just consider yourself as a candidate. */",
		"	if (best_backup_dr_neighbor_ptr == OPC_NIL)",
		"		{",
		"		best_backup_dr = ip_address_copy (self_router_id);",
		"		best_backup_dr_intf = ip_address_copy (self_ip_addr);",
		"		}",
		"	else",
		"		{",
		"		best_backup_dr_priority = ospf_neighbor_priority_get (best_backup_dr_neighbor_ptr);",
		"		temp_backup_dr_id = ospf_neighbor_router_id_get (best_backup_dr_neighbor_ptr);",
		"",
		"		/* Now compare the best candidate for backup DR to the current router. */",
		"		best_declares = ip_address_equal (temp_backup_dr_id, ",
		"			ospf_neighbor_backup_dr_get (best_backup_dr_neighbor_ptr));",
		"",
		"		/* Prefer the router that thinks it's the backup DR. */",
		"		if (best_declares == self_declares)",
		"			{",
		"			/* Neither or both of the routers thinks it's backup DR. */",
		"			if ((self_router_prio > best_backup_dr_priority) ||",
		"				((self_router_prio == best_backup_dr_priority) &&",
		"					(ip_address_to_int (self_router_id) > ip_address_to_int (temp_backup_dr_id))))",
		"				{",
		"				best_backup_dr = ip_address_copy (self_router_id);",
		"				best_backup_dr_intf = ip_address_copy (self_ip_addr);",
		"				}",
		"			else",
		"				{",
		"				best_backup_dr = ip_address_copy (temp_backup_dr_id);",
		"				best_backup_dr_intf = ip_address_copy (best_backup_dr_neighbor_ptr->ip_address);",
		"				}",
		"			}",
		"		else",
		"			{",
		"			/* Only one of the routers thinks it's backup DR.  Use that router. */",
		"			if (self_declares && (self_router_prio > 0))",
		"				{",
		"				best_backup_dr = ip_address_copy (self_router_id);",
		"				best_backup_dr_intf = ip_address_copy (self_ip_addr);",
		"				}",
		"			else",
		"				{",
		"				best_backup_dr = ip_address_copy (temp_backup_dr_id);",
		"				best_backup_dr_intf = ip_address_copy (best_backup_dr_neighbor_ptr->ip_address);",
		"				}",
		"			}",
		"		}",
		"",
		"	/* Step 3: Choose a Designated Router.  This is the router in the eligble router */",
		"	/* list with the highest priority, and highest Router ID for routers with equal  */",
		"	/* priorities.  If none of the eligible routers have declared themselves as      */",
		"	/* designated routers, the Backup Designated Router calculated in the previous   */",
		"	/* step is promoted to be the Designated Router.                                 */",
		"	self_declares = ip_address_equal (ospf_interface_designated_router_id, self_router_id);",
		"	best_dr_neighbor_ptr = ospf_interface_dr_choose (ospf_interface_neighbor_list_ptr, OPC_NIL, OPC_FALSE);",
		"",
		"	/* If no DR can be chosen from the eligible list, and this router hasn't declared */",
		"	/* itself to be DR, promote the backup DR to be the new DR.                       */",
		"	if ((best_dr_neighbor_ptr == OPC_NIL) && !self_declares)",
		PRGC_NIL);

	prg_list_strings_append (prg_lptr [3], 
		"		{",
		"		best_dr = ip_address_copy (best_backup_dr);",
		"		best_dr_intf = ip_address_copy (best_backup_dr_intf);",
		"		}",
		"	else if ((best_dr_neighbor_ptr == OPC_NIL) && self_declares)",
		"		{",
		"		best_dr = ip_address_copy (self_router_id);",
		"		best_dr_intf = ip_address_copy (self_ip_addr);",
		"		}",
		"	else",
		"		{",
		"		best_dr_priority = ospf_neighbor_priority_get (best_dr_neighbor_ptr);",
		"		temp_best_dr_id = ospf_neighbor_router_id_get (best_dr_neighbor_ptr);",
		"",
		"		/* Compare the selected router to this router. */",
		"		if (!self_declares || (self_router_prio < best_dr_priority))",
		"			{",
		"			best_dr = ip_address_copy (temp_best_dr_id);",
		"			best_dr_intf = ip_address_copy (best_dr_neighbor_ptr->ip_address);",
		"			}",
		"		else",
		"			{",
		"			if ((self_router_prio > best_dr_priority) ||",
		"				((self_router_prio == best_dr_priority) &&",
		"					(ip_address_to_int (self_router_id) > ip_address_to_int (temp_best_dr_id))))",
		"				{",
		"				best_dr = ip_address_copy (self_router_id);",
		"				best_dr_intf = ip_address_copy (self_ip_addr);",
		"				}",
		"			else",
		"				{",
		"				best_dr = ip_address_copy (temp_best_dr_id);",
		"				best_dr_intf = ip_address_copy (best_dr_neighbor_ptr->ip_address);",
		"				}",
		"			}",
		"		}",
		"",
		"	/* Step 4: If this router has either been replaced as (Backup) Designated Router */",
		"	/* or has just been elected as (Backup) Designated Router, then re-choose the    */",
		"	/* Backup Designated Router.  This ensures that this router is considered in the */",
		"	/* election (if it recently was replaced), or that this router doesn't declare   */",
		"	/* itself as both Backup DR and DR (if it has recently replaced another router). */",
		"	if ((!ip_address_equal (old_dr, best_dr) &&",
		"		    (ip_address_equal (self_router_id, old_dr) || ip_address_equal (self_router_id, best_dr))) ||",
		"		(!ip_address_equal (old_backup_dr, best_backup_dr) &&",
		"			(ip_address_equal (self_router_id, old_backup_dr) || ",
		"				(ip_address_equal (self_router_id, best_backup_dr) &&",
		"					ip_address_equal (best_dr, best_backup_dr)))) ||",
		"		(ip_address_equal (best_dr, best_backup_dr)))",
		"		{",
		"		best_backup_dr_neighbor_ptr = ospf_interface_dr_choose (ospf_interface_neighbor_list_ptr, ",
		"			best_dr, OPC_TRUE);",
		"",
		"		if ((best_backup_dr_neighbor_ptr != OPC_NIL) && ",
		"			ip_address_equal (best_dr, self_router_id))",
		"			{",
		"			best_backup_dr = ip_address_copy (ospf_neighbor_router_id_get (best_backup_dr_neighbor_ptr));",
		"			best_backup_dr_intf = ip_address_copy (best_backup_dr_neighbor_ptr->ip_address);",
		"			}",
		"		else if (best_backup_dr_neighbor_ptr != OPC_NIL)",
		"			{",
		"			best_backup_dr_priority = ospf_neighbor_priority_get (best_backup_dr_neighbor_ptr);",
		"			temp_backup_dr_id = ospf_neighbor_router_id_get (best_backup_dr_neighbor_ptr);",
		"",
		"			/* Now compare the best candidate for backup DR to the current router. */",
		"			best_declares = ip_address_equal (temp_backup_dr_id, ",
		"				ospf_neighbor_backup_dr_get (best_backup_dr_neighbor_ptr));",
		"",
		"			self_declares = ip_address_equal (ospf_interface_backup_designated_router_id,",
		"				self_router_id);",
		"",
		"			/* Prefer the router that thinks it's the backup DR. */",
		"			if (best_declares == self_declares)",
		"				{",
		"				/* Neither or both of the routers thinks it's backup DR. */",
		"				if ((self_router_prio > best_backup_dr_priority) ||",
		"					((self_router_prio == best_backup_dr_priority) &&",
		"						(ip_address_to_int (self_router_id) > ip_address_to_int (temp_backup_dr_id))))",
		"					{",
		"					best_backup_dr = ip_address_copy (self_router_id);",
		"					best_backup_dr_intf = ip_address_copy (self_ip_addr);",
		"					}",
		"				else",
		"					{",
		"					best_backup_dr = ip_address_copy (temp_backup_dr_id);",
		"					best_backup_dr_intf = ip_address_copy (best_backup_dr_neighbor_ptr->ip_address);",
		"					}",
		"				}",
		"			else",
		"				{",
		"				/* Only one of the routers thinks it's backup DR.  Use that router. */",
		"				if (self_declares && (self_router_prio > 0))",
		"					{",
		"					best_backup_dr = ip_address_copy (self_router_id);",
		"					best_backup_dr_intf = ip_address_copy (self_ip_addr);",
		"					}",
		"				else",
		"					{",
		"					best_backup_dr = ip_address_copy (temp_backup_dr_id);",
		"					best_backup_dr_intf = ip_address_copy (best_backup_dr_neighbor_ptr->ip_address);",
		PRGC_NIL);

	prg_list_strings_append (prg_lptr [3], 
		"					}",
		"				}",
		"			}",
		"		else",
		"			{",
		"			/* No router was chosen, so just coose yourself. */",
		"			best_backup_dr = ip_address_copy (self_router_id);",
		"			best_backup_dr_intf = ip_address_copy (self_ip_addr);",
		"			}",
		"		}",
		"",
		"	/* This concludes the calculation of the DR and Backup DR, set the */",
		"	/* interface state variables appropriately.                        */",
		"	ip_address_destroy (ospf_interface_designated_router_id);",
		"	ospf_interface_designated_router_id = best_dr;",
		"	ip_address_destroy (ospf_interface_dr_intf_addr);",
		"	ospf_interface_dr_intf_addr = best_dr_intf;",
		"	",
		"	ip_address_destroy (ospf_interface_backup_designated_router_id);",
		"	ospf_interface_backup_designated_router_id = best_backup_dr;",
		"	ip_address_destroy (ospf_interface_backup_dr_intf_addr);",
		"	ospf_interface_backup_dr_intf_addr = best_backup_dr_intf;",
		"",
		"	/* Step 5: The operational state of the interface must be changed at this point */",
		"	/* depending on the results of the calculation.  We will let the process model  */",
		"	/* state machine take care of this step.                                        */",
		"",
		"	/* Step 6: If this router has become the (Backup) DR, and the interface is */",
		"	/* non-broadcast, then start sending hellos to those neighbors not         */",
		"	/* eligible to become a Designated Router.  Do this by invoking the Start  */",
		"	/* event on every neighbor with a priority of 0.                           */",
		"",
		"	/* Step 7: If the DR or Backup DR has changed because of the above calculation, */",
		"	/* the adjacencies associated with this interface may need to be reformed.      */",
		"	/* Accomplish this by invoking the AdjOK? event on every neighbor whose state   */",
		"	/* is at least 2-Way.                                                           */",
		"	num_neighbors = op_prg_list_size (ospf_interface_neighbor_list_ptr);",
		"",
		"	/* Steps 6 and 7 are combined into a single loop. */",
		"	for (neighbor_index = 0; neighbor_index < num_neighbors; neighbor_index++)",
		"		{",
		"		/* Get current neighbor. */",
		"		neighbor_ptr = op_prg_list_access (ospf_interface_neighbor_list_ptr, neighbor_index);",
		"		neighbor_priority = ospf_neighbor_priority_get (neighbor_ptr);",
		"		",
		"		/* Invoke with start event if priority is 0 with a non-broadcast interface. */",
		"		if ((neighbor_priority == 0) && (ospf_interface_type == OspfC_Interface_Type_Non_Broadcast))",
		"			ospf_neighbor_invoke (neighbor_ptr, OspfC_Neighbor_Event_Start);",
		"",
		"		/* Invoke with AdjOK? if the state is at least 2-Way, and a new (Backup) DR was chosen */",
		"		if ((ospf_neighbor_state_get (neighbor_ptr, OPC_NIL) >= OspfC_Neighbor_State_Two_Way) &&",
		"			(!ip_address_equal (old_dr, best_dr) || !ip_address_equal (old_backup_dr, best_backup_dr)))",
		"			ospf_neighbor_invoke (neighbor_ptr, OspfC_Neighbor_Event_Adj_OK);",
		"		}",
		"",
		"	/* Destroy the old IDs. */",
		"	ip_address_destroy (old_dr);",
		"	ip_address_destroy (old_backup_dr);",
		"",
		"	FOUT;",
		"	}",
		"",
		"OspfT_Neighbor *",
		"ospf_interface_dr_choose (List *neighbor_list_ptr, OspfT_Router_Id exclude_router_id, ",
		"	Boolean choose_backup_dr)",
		"	{",
		"	OspfT_Router_Id			cur_dr;",
		"	int						best_prio;",
		"	Boolean					must_declare_self;",
		"	int						num_neighbors, neighbor_index;",
		"	OspfT_Neighbor *		neighbor_ptr;",
		"	OspfT_Neighbor *		best_neighbor_ptr = OPC_NIL;",
		"	int						neighbor_priority;",
		"",
		"	/** Choose a designated router from the given list.  If choose_backup_dr is   **/",
		"	/** OPC_TRUE, then use the backup DR selection algorithm, otherwise use the   **/",
		"	/** DR selection algorithm.  Returns pointer to neighbor selected as (backup) **/",
		"	/** DR.  May return OPC_NIL if eligible list is empty or in the case of       **/",
		"	/** choosing a DR, no neighbor declares itself as DR.                         **/",
		"	FIN (ospf_interface_dr_choose (neighbor_list_ptr, exclude_router_id, choose_backup_dr));",
		"",
		"	must_declare_self = !choose_backup_dr;",
		"	best_prio = 0;",
		"	num_neighbors = op_prg_list_size (neighbor_list_ptr);",
		"	for (neighbor_index = 0; neighbor_index < num_neighbors; neighbor_index++)",
		"		{",
		"		/* Get current neighbor. */",
		"		neighbor_ptr = op_prg_list_access (neighbor_list_ptr, neighbor_index);",
		"		neighbor_priority = ospf_neighbor_priority_get (neighbor_ptr);",
		"		",
		"		/* Consider the neighbor only if its state is 2-Way or greater, */",
		"		/* and its priority is greater than 0.                          */",
		"		if ((ospf_neighbor_state_get (neighbor_ptr, OPC_NIL) < OspfC_Neighbor_State_Two_Way) ||",
		"			(neighbor_priority <= 0))",
		"			continue;",
		"		",
		"		/* Consider the neighbor for backup DR as long as it doesn't */",
		"		/* already declare itself as DR.                             */",
		"		if (ip_address_equal (neighbor_ptr->ip_address, ospf_neighbor_dr_get (neighbor_ptr)) &&",
		"			choose_backup_dr)",
		PRGC_NIL);

	prg_list_strings_append (prg_lptr [3], 
		"			continue;",
		"",
		"		/* If we're selecting the backup DR, exclude what the client specifies. */",
		"		if (choose_backup_dr && (exclude_router_id != OPC_NIL) && ",
		"			(ip_address_equal (ospf_neighbor_router_id_get (neighbor_ptr), exclude_router_id)))",
		"			continue;",
		"",
		"		/* Has the router declared itself as DR or backup DR? */",
		"		if (choose_backup_dr)",
		"			cur_dr = ospf_neighbor_backup_dr_get (neighbor_ptr);",
		"		else",
		"			cur_dr = ospf_neighbor_dr_get (neighbor_ptr);",
		"",
		"		if (ip_address_equal (cur_dr, ospf_neighbor_router_id_get (neighbor_ptr)))",
		"			must_declare_self = OPC_TRUE;",
		"		else if (must_declare_self)",
		"			continue;",
		"		",
		"		/* Check the router priority and (if necessary) router ID to determine */",
		"		/* if we have a new best candidate.                                    */",
		"		if ((neighbor_priority > best_prio) ||",
		"			((neighbor_priority == best_prio) && ",
		"				(ip_address_to_int (ospf_neighbor_router_id_get (neighbor_ptr)) >",
		"					ip_address_to_int (ospf_neighbor_router_id_get (best_neighbor_ptr)))))",
		"			{",
		"			best_prio = neighbor_priority;",
		"			best_neighbor_ptr = neighbor_ptr;",
		"			}",
		"		}",
		"",
		"	FRET (best_neighbor_ptr);",
		"	}",
		"",
		"",
		"",
		PRGC_NIL);

	/* create and init prg list 'prg_lptr [4]' */
	prg_lptr [4] = prg_list_create ();
	prg_list_strings_append (prg_lptr [4], 
		"if (op_prg_odb_ltrace_active (\"ospf_neighbor_summary\"))",
		"	ospf_neighbor_list_summary_print (ospf_interface_neighbor_list_ptr);",
		"",
		PRGC_NIL);

	/* create and init prg list 'prg_lptr [5]' */
	prg_lptr [5] = prg_list_create ();
	/* create and init prg list 'prg_lptr [6]' */
	prg_lptr [6] = prg_list_create ();
	prg_list_strings_append (prg_lptr [6], 
		"ospf_neighbor",
		PRGC_NIL);

	/* create and init prg list 'prg_lptr [7]' */
	prg_lptr [7] = prg_list_create ();
	prg_list_strings_append (prg_lptr [7], 
		"General Process Description:\n",
		"---------------------------\n",
		"The ospf_interface process model represents the state and behavior of an\n",
		"OSPF interface.  This model is a child model of OSPF, and should only be\n",
		"used as such.  This model is based on the OSPF Interface State Machine \n",
		"described in section 9 of RFC 1583.",
		PRGC_NIL);

	/* create and init prg list 'prg_lptr [8]' */
	prg_lptr [8] = prg_list_create ();
	Ema_Model_Attr_Set (model_id,
		"state vars",           COMP_CONTENTS, prg_lptr [0],
		"temp vars",            COMP_CONTENTS, prg_lptr [1],
		"header block",         COMP_CONTENTS, prg_lptr [2],
		"function block",       COMP_CONTENTS, prg_lptr [3],
		"diag block",           COMP_CONTENTS, prg_lptr [4],
		"termination block",    COMP_CONTENTS, prg_lptr [5],
		"global stat descs",    COMP_INTENDED, EMAC_DISABLED,
		"local stat descs",     COMP_INTENDED, EMAC_DISABLED,
		"child processes",      COMP_CONTENTS, prg_lptr [6],
		"model comments",       COMP_CONTENTS, prg_lptr [7],
		"ext fileset",          COMP_CONTENTS, prg_lptr [8],
		"interface descriptions",COMP_INTENDED, EMAC_DISABLED,
		"attribute assignments",COMP_ARRAY_CONTENTS (0), obj [0],
		"attribute assignments",COMP_ARRAY_CONTENTS (1), obj [1],
		"attribute assignments",COMP_ARRAY_CONTENTS (2), obj [2],
		"attribute assignments",COMP_ARRAY_CONTENTS (3), obj [3],
		EMAC_EOL);

	Ema_Model_Attr_Set (model_id,
		"attribute assignments",COMP_ARRAY_CONTENTS (4), obj [4],
		"attribute assignments",COMP_ARRAY_CONTENTS (5), obj [5],
		"attribute assignments",COMP_ARRAY_CONTENTS (6), obj [6],
		"simulation attributes",COMP_INTENDED, EMAC_DISABLED,
		EMAC_EOL);



	/* assign attrs for object 'obj [7]' */
	/* create and init prg list 'prg_lptr [9]' */
	prg_lptr [9] = prg_list_create ();
	prg_list_strings_append (prg_lptr [9], 
		"/* Retrieve the state passed by the root process. */",
		"intf_info_ptr = op_pro_argmem_access ();",
		"",
		"/* Get own object id. */",
		"ospf_interface_my_objid = op_id_self ();",
		"",
		"/* Get the interface object id this process represents. */",
		"ospf_interface_objid = intf_info_ptr->interface_objid;",
		"",
		"/* Initialize the state variables of this process. */",
		"ospf_interface_sv_init (intf_info_ptr->interface_ptr, intf_info_ptr->ip_interface_ptr);",
		"",
		"/* If we're dealing with a multi-access non-broadcast network */",
		"/* then check the list of configured neighbors.               */",
		"if (ospf_interface_type == OspfC_Interface_Type_Non_Broadcast)",
		"	{",
		"	/* Get the compound attribute that represents the list of neighbors. */",
		"	op_ima_obj_attr_get (ospf_interface_objid, \"Neighbor List\", &neighbor_list_objid);",
		"",
		"	/* Create the list of neighbor objects based on the list. */",
		"	ospf_neighbor_static_list_create (ospf_interface_neighbor_list_ptr, neighbor_list_objid,",
		"		ospf_interface_my_objid, ospf_interface_self_ptr);",
		"	}",
		"",
		"/* Start hello timer. */",
		"ospf_interface_hello_timer_set (OPC_NIL, 0);",
		PRGC_NIL);

	/* create and init prg list 'prg_lptr [10]' */
	prg_lptr [10] = prg_list_create ();
	prg_list_strings_append (prg_lptr [10], 
		"				   ",
		PRGC_NIL);

	Ema_Object_Attr_Set (model_id, obj [7], 
		"name",                 COMP_CONTENTS, "Down",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"enter execs",          COMP_CONTENTS, prg_lptr [9],
		"exit execs",           COMP_CONTENTS, prg_lptr [10],
		"status",               COMP_TOGGLE,   EMAC_ENABLED,
		"status",               COMP_INTENDED, EMAC_DISABLED,
		"position",             COMP_CONTENTS, obj [8],
		"initial",              COMP_TOGGLE,   EMAC_ENABLED,
		EMAC_EOL);


	/* assign attrs for object 'obj [9]' */
	/* create and init prg list 'prg_lptr [11]' */
	prg_lptr [11] = prg_list_create ();
	prg_list_strings_append (prg_lptr [11], 
		"/* Set the operational state upon entry. */",
		"ospf_interface_state_change (OspfC_Interface_State_Pt_To_Pt);",
		PRGC_NIL);

	Ema_Object_Attr_Set (model_id, obj [9], 
		"name",                 COMP_CONTENTS, "Point-to-Point",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"enter execs",          COMP_CONTENTS, prg_lptr [11],
		"position",             COMP_CONTENTS, obj [10],
		"initial",              COMP_TOGGLE,   EMAC_DISABLED,
		EMAC_EOL);


	/* assign attrs for object 'obj [11]' */
	/* create and init prg list 'prg_lptr [13]' */
	prg_lptr [13] = prg_list_create ();
	prg_list_strings_append (prg_lptr [13], 
		"/* Set operational state upon entry. */",
		"ospf_interface_state_change (OspfC_Interface_State_DR_Other);",
		"",
		"/* De-register from the AllDRRouters group. */",
		"ip_address_multicast_deregister (OspfI_All_Dr_Routers, op_topo_parent (op_id_self ()));",
		"",
		PRGC_NIL);

	Ema_Object_Attr_Set (model_id, obj [11], 
		"name",                 COMP_CONTENTS, "DR Other",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"enter execs",          COMP_CONTENTS, prg_lptr [13],
		"position",             COMP_CONTENTS, obj [12],
		"initial",              COMP_TOGGLE,   EMAC_DISABLED,
		EMAC_EOL);


	/* assign attrs for object 'obj [13]' */
	/* create and init prg list 'prg_lptr [15]' */
	prg_lptr [15] = prg_list_create ();
	prg_list_strings_append (prg_lptr [15], 
		"/* Set the operational state upon entry. */",
		"ospf_interface_state_change (OspfC_Interface_State_Waiting);",
		"",
		"/* Set up a single-shot wait timer.  After this timer */",
		"/* expires, DR election will occur.                   */",
		"ospf_interface_wait_timer_set ();",
		"",
		PRGC_NIL);

	Ema_Object_Attr_Set (model_id, obj [13], 
		"name",                 COMP_CONTENTS, "Waiting",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"enter execs",          COMP_CONTENTS, prg_lptr [15],
		"position",             COMP_CONTENTS, obj [14],
		"initial",              COMP_TOGGLE,   EMAC_DISABLED,
		EMAC_EOL);


	/* assign attrs for object 'obj [15]' */
	/* create and init prg list 'prg_lptr [17]' */
	prg_lptr [17] = prg_list_create ();
	prg_list_strings_append (prg_lptr [17], 
		"/* Calculate designated router. */",
		"ospf_interface_dr_elect ();",
		"",
		"if (ip_address_equal (ospf_interface_designated_router_id,",
		"	ospf_interface_self_ptr->parent_area_ptr->parent_router_ptr->router_id))",
		"	router_dr_status = OspfC_Dr_Status_Dr;",
		"else if (ip_address_equal (ospf_interface_backup_designated_router_id,",
		"	ospf_interface_self_ptr->parent_area_ptr->parent_router_ptr->router_id))",
		"	router_dr_status = OspfC_Dr_Status_Backup;",
		"else",
		"    router_dr_status = OspfC_Dr_Status_Other;",
		"    ",
		PRGC_NIL);

	Ema_Object_Attr_Set (model_id, obj [15], 
		"name",                 COMP_CONTENTS, "Calc DR",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"enter execs",          COMP_CONTENTS, prg_lptr [17],
		"status",               COMP_TOGGLE,   EMAC_ENABLED,
		"status",               COMP_INTENDED, EMAC_DISABLED,
		"position",             COMP_CONTENTS, obj [16],
		"initial",              COMP_TOGGLE,   EMAC_DISABLED,
		EMAC_EOL);


	/* assign attrs for object 'obj [17]' */
	/* create and init prg list 'prg_lptr [19]' */
	prg_lptr [19] = prg_list_create ();
	prg_list_strings_append (prg_lptr [19], 
		"/* Change operational state of interface. */",
		"ospf_interface_state_change (OspfC_Interface_State_DR);",
		"",
		"/* Register with the AllDRRouters group. */",
		"ip_address_multicast_register (OspfI_All_Dr_Routers, op_topo_parent (op_id_self ()));",
		PRGC_NIL);

	Ema_Object_Attr_Set (model_id, obj [17], 
		"name",                 COMP_CONTENTS, "DR",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"enter execs",          COMP_CONTENTS, prg_lptr [19],
		"position",             COMP_CONTENTS, obj [18],
		"initial",              COMP_TOGGLE,   EMAC_DISABLED,
		EMAC_EOL);


	/* assign attrs for object 'obj [19]' */
	/* create and init prg list 'prg_lptr [21]' */
	prg_lptr [21] = prg_list_create ();
	prg_list_strings_append (prg_lptr [21], 
		"/* Change operational state of interface. */",
		"ospf_interface_state_change (OspfC_Interface_State_Backup);",
		"",
		"/* Register with the AllDRRouters group. */",
		"ip_address_multicast_register (OspfI_All_Dr_Routers, op_topo_parent (op_id_self ()));",
		PRGC_NIL);

	Ema_Object_Attr_Set (model_id, obj [19], 
		"name",                 COMP_CONTENTS, "Backup",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"enter execs",          COMP_CONTENTS, prg_lptr [21],
		"position",             COMP_CONTENTS, obj [20],
		"initial",              COMP_TOGGLE,   EMAC_DISABLED,
		EMAC_EOL);


	/* assign attrs for object 'obj [21]' */
	Ema_Object_Attr_Set (model_id, obj [21], 
		"name",                 COMP_CONTENTS, "tr_0",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "PT_TO_PT",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [9],
		"src state",            COMP_CONTENTS, obj [7],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 42,
		"color",                COMP_INTENDED, EMAC_DISABLED,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [22],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [23],
		"path",                 COMP_ARRAY_CONTENTS (2), obj [24],
		"label pos",            COMP_CONTENTS, obj [25],
		EMAC_EOL);


	/* assign attrs for object 'obj [26]' */
	Ema_Object_Attr_Set (model_id, obj [26], 
		"name",                 COMP_CONTENTS, "tr_1",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "!PT_TO_PT && !DR_ELIGIBLE",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [11],
		"src state",            COMP_CONTENTS, obj [7],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 62,
		"color",                COMP_INTENDED, EMAC_DISABLED,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [27],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [28],
		"label pos",            COMP_CONTENTS, obj [29],
		EMAC_EOL);


	/* assign attrs for object 'obj [30]' */
	Ema_Object_Attr_Set (model_id, obj [30], 
		"name",                 COMP_CONTENTS, "tr_2",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "!PT_TO_PT && DR_ELIGIBLE",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [13],
		"src state",            COMP_CONTENTS, obj [7],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 30,
		"color",                COMP_INTENDED, EMAC_DISABLED,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [31],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [32],
		"path",                 COMP_ARRAY_CONTENTS (2), obj [33],
		"label pos",            COMP_CONTENTS, obj [34],
		EMAC_EOL);


	/* assign attrs for object 'obj [35]' */
	Ema_Object_Attr_Set (model_id, obj [35], 
		"name",                 COMP_CONTENTS, "tr_4",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "NEIGHBOR_CHANGE",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [15],
		"src state",            COMP_CONTENTS, obj [11],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 47,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [36],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [37],
		"label pos",            COMP_CONTENTS, obj [38],
		EMAC_EOL);


	/* assign attrs for object 'obj [39]' */
	Ema_Object_Attr_Set (model_id, obj [39], 
		"name",                 COMP_CONTENTS, "tr_5",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "DR_OTHER",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [11],
		"src state",            COMP_CONTENTS, obj [15],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 62,
		"color",                COMP_INTENDED, EMAC_DISABLED,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [40],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [41],
		"label pos",            COMP_CONTENTS, obj [42],
		EMAC_EOL);


	/* assign attrs for object 'obj [43]' */
	Ema_Object_Attr_Set (model_id, obj [43], 
		"name",                 COMP_CONTENTS, "tr_6",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "DR",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [17],
		"src state",            COMP_CONTENTS, obj [15],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 59,
		"color",                COMP_INTENDED, EMAC_DISABLED,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [44],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [45],
		"label pos",            COMP_CONTENTS, obj [46],
		EMAC_EOL);


	/* assign attrs for object 'obj [47]' */
	Ema_Object_Attr_Set (model_id, obj [47], 
		"name",                 COMP_CONTENTS, "tr_7",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "NEIGHBOR_CHANGE",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [15],
		"src state",            COMP_CONTENTS, obj [17],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 47,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [48],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [49],
		"label pos",            COMP_CONTENTS, obj [50],
		EMAC_EOL);


	/* assign attrs for object 'obj [51]' */
	Ema_Object_Attr_Set (model_id, obj [51], 
		"name",                 COMP_CONTENTS, "tr_9",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "BACKUP",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [19],
		"src state",            COMP_CONTENTS, obj [15],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 57,
		"color",                COMP_INTENDED, EMAC_DISABLED,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [52],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [53],
		"label pos",            COMP_CONTENTS, obj [54],
		EMAC_EOL);


	/* assign attrs for object 'obj [55]' */
	Ema_Object_Attr_Set (model_id, obj [55], 
		"name",                 COMP_CONTENTS, "tr_10",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "NEIGHBOR_CHANGE",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [15],
		"src state",            COMP_CONTENTS, obj [19],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"drawing style",        COMP_INTENDED, EMAC_DISABLED,
		"color",                COMP_CONTENTS, 47,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [56],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [57],
		"label pos",            COMP_CONTENTS, obj [58],
		EMAC_EOL);


	/* assign attrs for object 'obj [59]' */
	Ema_Object_Attr_Set (model_id, obj [59], 
		"name",                 COMP_CONTENTS, "tr_12",
		"name",                 COMP_INTENDED, EMAC_DISABLED,
		"condition",            COMP_CONTENTS, "BACKUP_SEEN || WAIT_TIMER",
		"condition",            COMP_INTENDED, EMAC_DISABLED,
		"executive",            COMP_CONTENTS, "",
		"executive",            COMP_INTENDED, EMAC_DISABLED,
		"dest state",           COMP_CONTENTS, obj [15],
		"src state",            COMP_CONTENTS, obj [13],
		"drawing style",        COMP_TOGGLE,   EMAC_DISABLED,
		"color",                COMP_CONTENTS, 47,
		"color",                COMP_INTENDED, EMAC_DISABLED,
		"path",                 COMP_ARRAY_CONTENTS (0), obj [60],
		"path",                 COMP_ARRAY_CONTENTS (1), obj [61],
		"path",                 COMP_ARRAY_CONTENTS (2), obj [62],
		"label pos",            COMP_CONTENTS, obj [63],
		EMAC_EOL);


	/* assign attrs for object 'obj [8]' */
	Ema_Object_Attr_Set (model_id, obj [8], 
		"x",                    COMP_CONTENTS, (double) 90,
		"y",                    COMP_CONTENTS, (double) 210,
		EMAC_EOL);


	/* assign attrs for object 'obj [10]' */
	Ema_Object_Attr_Set (model_id, obj [10], 
		"x",                    COMP_CONTENTS, (double) 330,
		"y",                    COMP_CONTENTS, (double) 90,
		EMAC_EOL);


	/* assign attrs for object 'obj [12]' */
	Ema_Object_Attr_Set (model_id, obj [12], 
		"x",                    COMP_CONTENTS, (double) 330,
		"y",                    COMP_CONTENTS, (double) 210,
		EMAC_EOL);


	/* assign attrs for object 'obj [14]' */
	Ema_Object_Attr_Set (model_id, obj [14], 
		"x",                    COMP_CONTENTS, (double) 330,
		"y",                    COMP_CONTENTS, (double) 330,
		EMAC_EOL);


	/* assign attrs for object 'obj [16]' */
	Ema_Object_Attr_Set (model_id, obj [16], 
		"x",                    COMP_CONTENTS, (double) 570,
		"y",                    COMP_CONTENTS, (double) 210,
		EMAC_EOL);


	/* assign attrs for object 'obj [18]' */
	Ema_Object_Attr_Set (model_id, obj [18], 
		"x",                    COMP_CONTENTS, (double) 570,
		"y",                    COMP_CONTENTS, (double) 90,
		EMAC_EOL);


	/* assign attrs for object 'obj [20]' */
	Ema_Object_Attr_Set (model_id, obj [20], 
		"x",                    COMP_CONTENTS, (double) 750,
		"y",                    COMP_CONTENTS, (double) 210,
		EMAC_EOL);


	/* assign attrs for object 'obj [22]' */
	Ema_Object_Attr_Set (model_id, obj [22], 
		"x",                    COMP_CONTENTS, (double) 89,
		"y",                    COMP_CONTENTS, (double) 181,
		EMAC_EOL);


	/* assign attrs for object 'obj [23]' */
	Ema_Object_Attr_Set (model_id, obj [23], 
		"x",                    COMP_CONTENTS, (double) 89,
		"y",                    COMP_CONTENTS, (double) 84,
		EMAC_EOL);


	/* assign attrs for object 'obj [24]' */
	Ema_Object_Attr_Set (model_id, obj [24], 
		"x",                    COMP_CONTENTS, (double) 302,
		"y",                    COMP_CONTENTS, (double) 84,
		EMAC_EOL);


	/* assign attrs for object 'obj [25]' */
	Ema_Object_Attr_Set (model_id, obj [25], 
		"x",                    COMP_CONTENTS, (double) 157,
		"y",                    COMP_CONTENTS, (double) 94,
		EMAC_EOL);


	/* assign attrs for object 'obj [27]' */
	Ema_Object_Attr_Set (model_id, obj [27], 
		"x",                    COMP_CONTENTS, (double) 118,
		"y",                    COMP_CONTENTS, (double) 209,
		EMAC_EOL);


	/* assign attrs for object 'obj [28]' */
	Ema_Object_Attr_Set (model_id, obj [28], 
		"x",                    COMP_CONTENTS, (double) 302,
		"y",                    COMP_CONTENTS, (double) 209,
		EMAC_EOL);


	/* assign attrs for object 'obj [29]' */
	Ema_Object_Attr_Set (model_id, obj [29], 
		"x",                    COMP_CONTENTS, (double) 206,
		"y",                    COMP_CONTENTS, (double) 201,
		EMAC_EOL);


	/* assign attrs for object 'obj [31]' */
	Ema_Object_Attr_Set (model_id, obj [31], 
		"x",                    COMP_CONTENTS, (double) 92,
		"y",                    COMP_CONTENTS, (double) 237,
		EMAC_EOL);


	/* assign attrs for object 'obj [32]' */
	Ema_Object_Attr_Set (model_id, obj [32], 
		"x",                    COMP_CONTENTS, (double) 92,
		"y",                    COMP_CONTENTS, (double) 328,
		EMAC_EOL);


	/* assign attrs for object 'obj [33]' */
	Ema_Object_Attr_Set (model_id, obj [33], 
		"x",                    COMP_CONTENTS, (double) 302,
		"y",                    COMP_CONTENTS, (double) 328,
		EMAC_EOL);


	/* assign attrs for object 'obj [34]' */
	Ema_Object_Attr_Set (model_id, obj [34], 
		"x",                    COMP_CONTENTS, (double) 203,
		"y",                    COMP_CONTENTS, (double) 320,
		EMAC_EOL);


	/* assign attrs for object 'obj [36]' */
	Ema_Object_Attr_Set (model_id, obj [36], 
		"x",                    COMP_CONTENTS, (double) 357,
		"y",                    COMP_CONTENTS, (double) 217,
		EMAC_EOL);


	/* assign attrs for object 'obj [37]' */
	Ema_Object_Attr_Set (model_id, obj [37], 
		"x",                    COMP_CONTENTS, (double) 543,
		"y",                    COMP_CONTENTS, (double) 217,
		EMAC_EOL);


	/* assign attrs for object 'obj [38]' */
	Ema_Object_Attr_Set (model_id, obj [38], 
		"x",                    COMP_CONTENTS, (double) 451,
		"y",                    COMP_CONTENTS, (double) 225,
		EMAC_EOL);


	/* assign attrs for object 'obj [40]' */
	Ema_Object_Attr_Set (model_id, obj [40], 
		"x",                    COMP_CONTENTS, (double) 542,
		"y",                    COMP_CONTENTS, (double) 204,
		EMAC_EOL);


	/* assign attrs for object 'obj [41]' */
	Ema_Object_Attr_Set (model_id, obj [41], 
		"x",                    COMP_CONTENTS, (double) 358,
		"y",                    COMP_CONTENTS, (double) 204,
		EMAC_EOL);


	/* assign attrs for object 'obj [42]' */
	Ema_Object_Attr_Set (model_id, obj [42], 
		"x",                    COMP_CONTENTS, (double) 446,
		"y",                    COMP_CONTENTS, (double) 196,
		EMAC_EOL);


	/* assign attrs for object 'obj [44]' */
	Ema_Object_Attr_Set (model_id, obj [44], 
		"x",                    COMP_CONTENTS, (double) 563,
		"y",                    COMP_CONTENTS, (double) 181,
		EMAC_EOL);


	/* assign attrs for object 'obj [45]' */
	Ema_Object_Attr_Set (model_id, obj [45], 
		"x",                    COMP_CONTENTS, (double) 563,
		"y",                    COMP_CONTENTS, (double) 117,
		EMAC_EOL);


	/* assign attrs for object 'obj [46]' */
	Ema_Object_Attr_Set (model_id, obj [46], 
		"x",                    COMP_CONTENTS, (double) 547,
		"y",                    COMP_CONTENTS, (double) 150,
		EMAC_EOL);


	/* assign attrs for object 'obj [48]' */
	Ema_Object_Attr_Set (model_id, obj [48], 
		"x",                    COMP_CONTENTS, (double) 575,
		"y",                    COMP_CONTENTS, (double) 117,
		EMAC_EOL);


	/* assign attrs for object 'obj [49]' */
	Ema_Object_Attr_Set (model_id, obj [49], 
		"x",                    COMP_CONTENTS, (double) 575,
		"y",                    COMP_CONTENTS, (double) 181,
		EMAC_EOL);


	/* assign attrs for object 'obj [50]' */
	Ema_Object_Attr_Set (model_id, obj [50], 
		"x",                    COMP_CONTENTS, (double) 628,
		"y",                    COMP_CONTENTS, (double) 150,
		EMAC_EOL);


	/* assign attrs for object 'obj [52]' */
	Ema_Object_Attr_Set (model_id, obj [52], 
		"x",                    COMP_CONTENTS, (double) 598,
		"y",                    COMP_CONTENTS, (double) 204,
		EMAC_EOL);


	/* assign attrs for object 'obj [53]' */
	Ema_Object_Attr_Set (model_id, obj [53], 
		"x",                    COMP_CONTENTS, (double) 722,
		"y",                    COMP_CONTENTS, (double) 204,
		EMAC_EOL);


	/* assign attrs for object 'obj [54]' */
	Ema_Object_Attr_Set (model_id, obj [54], 
		"x",                    COMP_CONTENTS, (double) 658,
		"y",                    COMP_CONTENTS, (double) 196,
		EMAC_EOL);


	/* assign attrs for object 'obj [56]' */
	Ema_Object_Attr_Set (model_id, obj [56], 
		"x",                    COMP_CONTENTS, (double) 722,
		"y",                    COMP_CONTENTS, (double) 214,
		EMAC_EOL);


	/* assign attrs for object 'obj [57]' */
	Ema_Object_Attr_Set (model_id, obj [57], 
		"x",                    COMP_CONTENTS, (double) 598,
		"y",                    COMP_CONTENTS, (double) 214,
		EMAC_EOL);


	/* assign attrs for object 'obj [58]' */
	Ema_Object_Attr_Set (model_id, obj [58], 
		"x",                    COMP_CONTENTS, (double) 664,
		"y",                    COMP_CONTENTS, (double) 222,
		EMAC_EOL);


	/* assign attrs for object 'obj [60]' */
	Ema_Object_Attr_Set (model_id, obj [60], 
		"x",                    COMP_CONTENTS, (double) 358,
		"y",                    COMP_CONTENTS, (double) 329,
		EMAC_EOL);


	/* assign attrs for object 'obj [61]' */
	Ema_Object_Attr_Set (model_id, obj [61], 
		"x",                    COMP_CONTENTS, (double) 574,
		"y",                    COMP_CONTENTS, (double) 329,
		EMAC_EOL);


	/* assign attrs for object 'obj [62]' */
	Ema_Object_Attr_Set (model_id, obj [62], 
		"x",                    COMP_CONTENTS, (double) 574,
		"y",                    COMP_CONTENTS, (double) 237,
		EMAC_EOL);


	/* assign attrs for object 'obj [63]' */
	Ema_Object_Attr_Set (model_id, obj [63], 
		"x",                    COMP_CONTENTS, (double) 466,
		"y",                    COMP_CONTENTS, (double) 320,
		EMAC_EOL);


	/* assign attrs for object 'obj [0]' */
	Ema_Object_Attr_Set (model_id, obj [0], 
		"name",                 COMP_CONTENTS, "begsim intrpt",
		"operation",            COMP_CONTENTS, 3,
		"value",                COMP_CONTENTS_TYPE, EMAC_TOGGLE,
		"value",                COMP_TOGGLE,   EMAC_DISABLED,
		"value",                COMP_INTENDED, EMAC_DISABLED,
		"type",                 COMP_CONTENTS, 2,
		EMAC_EOL);


	/* assign attrs for object 'obj [1]' */
	Ema_Object_Attr_Set (model_id, obj [1], 
		"name",                 COMP_CONTENTS, "endsim intrpt",
		"operation",            COMP_CONTENTS, 3,
		"value",                COMP_CONTENTS_TYPE, EMAC_TOGGLE,
		"value",                COMP_TOGGLE,   EMAC_DISABLED,
		"value",                COMP_INTENDED, EMAC_DISABLED,
		"type",                 COMP_CONTENTS, 2,
		EMAC_EOL);


	/* assign attrs for object 'obj [2]' */
	Ema_Object_Attr_Set (model_id, obj [2], 
		"name",                 COMP_CONTENTS, "failure intrpts",
		"operation",            COMP_CONTENTS, 3,
		"value",                COMP_CONTENTS_TYPE, EMAC_STRING,
		"value",                COMP_CONTENTS, "disabled",
		"value",                COMP_INTENDED, EMAC_DISABLED,
		"type",                 COMP_CONTENTS, 8,
		EMAC_EOL);


	/* assign attrs for object 'obj [3]' */
	Ema_Object_Attr_Set (model_id, obj [3], 
		"name",                 COMP_CONTENTS, "intrpt interval",
		"operation",            COMP_CONTENTS, 3,
		"value",                COMP_CONTENTS_TYPE, EMAC_DOUBLE,
		"value",                COMP_CONTENTS, (double) -1e+100,
		"value",                COMP_INTENDED, EMAC_DISABLED,
		"type",                 COMP_CONTENTS, 3,
		EMAC_EOL);


	/* assign attrs for object 'obj [4]' */
	Ema_Object_Attr_Set (model_id, obj [4], 
		"name",                 COMP_CONTENTS, "priority",
		"operation",            COMP_CONTENTS, 3,
		"value",                COMP_CONTENTS_TYPE, EMAC_INTEGER,
		"value",                COMP_CONTENTS, 0,
		"value",                COMP_INTENDED, EMAC_DISABLED,
		"type",                 COMP_CONTENTS, 0,
		EMAC_EOL);


	/* assign attrs for object 'obj [5]' */
	Ema_Object_Attr_Set (model_id, obj [5], 
		"name",                 COMP_CONTENTS, "recovery intrpts",
		"operation",            COMP_CONTENTS, 3,
		"value",                COMP_CONTENTS_TYPE, EMAC_STRING,
		"value",                COMP_CONTENTS, "disabled",
		"value",                COMP_INTENDED, EMAC_DISABLED,
		"type",                 COMP_CONTENTS, 8,
		EMAC_EOL);


	/* assign attrs for object 'obj [6]' */
	Ema_Object_Attr_Set (model_id, obj [6], 
		"name",                 COMP_CONTENTS, "super priority",
		"operation",            COMP_CONTENTS, 3,
		"value",                COMP_CONTENTS_TYPE, EMAC_TOGGLE,
		"value",                COMP_TOGGLE,   EMAC_DISABLED,
		"value",                COMP_INTENDED, EMAC_DISABLED,
		"type",                 COMP_CONTENTS, 2,
		EMAC_EOL);








	/* write the model to application-readable form */
	Ema_Model_Write (model_id, "ospf_interface");

	}

