--     
--  network     
--     

type LAN is interface
    provides        
	net_no : NetID;
    service
	ws_conn : dual network_comm;  -- to the workstations on the net     
end;

module newLAN(net_no_ : NetID) return LAN is

	net_no : NetID is net_no_;
	action LAN_start(net_no : NetID);  
    initial
	LAN_start(net_no); -- report on the startup of the LAN
    parallel
        when (?data : Data; ?destination : Address)
            ws_conn.to_net(?data, ?destination)
        do
	    -- for now, broadcast everything     
            ws_conn.to_node(?data, ?destination);  
        end;
end;

type WAN is LAN;
-- a WAN is the same as a LAN, as far as this approximation is concerned

module newWAN(net_no_ : NetID) return WAN is
	action WAN_start(net_no : NetID);
	net_no is net_no_;	
    initial
	WAN_start(net_no);
    parallel
        when (?data : Data; ?destination : Address) 
            ws_conn.to_net(?data, ?destination)
        do
            ws_conn.to_node(?data, ?destination);
        end;
end;
