File Underlay/IPv4Underlay/OverlayRouter.ned

Contains:

//
// This program 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
// of the License, or (at your option) any later version.
//
// This program 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 this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//

import
    "NotificationBoard",
    "InterfaceTable",
    "RoutingTable",
    "Overlay",
    "UDP",
    "NetworkLayer",
    "PingApp",
    "PPPInterface",
    "TestApp";

module OverlayRouter
    parameters:
	overlayType : string,
	overlayAppType : string,
        IPForward : bool,
        routingFile : string;

    gates:
       	in: 	in[],
		overlayNeighborArrowIn[];	

       	out: 	out[],
		overlayNeighborArrowOut[];

    submodules:
        namTrace: NAMTraceWriter;
            parameters:
                namid = -1; // auto
            display: "p=330,60;i=block/sink";

	notificationBoard: NotificationBoard;
	    display: "p=60,80;i=block/control";

    	interfaceTable: InterfaceTable;
            display: "p=60,150;i=block/table";

    	routingTable: RoutingTable;
            parameters:
		IPForward = IPForward,
                routerId = "",
                routingFile = routingFile;
            display: "p=60,220;i=block/table";

	app: overlayAppType like OverlayApp;
	    display: "p=250,10;i=block/segm";

       	overlay: overlayType like Overlay;
	    display: "p=250,80;i=block/network2";

        udp: UDP;
            display: "p=250,150;i=block/transport";

        networkLayer: NetworkLayer;
            parameters:
                proxyARP = false;
            gatesizes:
                ifIn[sizeof(out)+sizeof(ethOut)],
                ifOut[sizeof(out)+sizeof(ethOut)];
            display: "p=250,220;i=block/fork;q=queue";

        ppp: PPPInterface[sizeof(out)];
            display: "p=250,310,row,90;q=txQueue;i=block/ifcard";

    connections nocheck:
	app.to_overlay --> overlay.from_app;
	app.from_overlay <-- overlay.to_app;

	overlay.to_udp --> udp.from_app++;
	overlay.from_udp <-- udp.to_app++;

        udp.to_ip --> networkLayer.UDPIn;
        udp.from_ip <-- networkLayer.UDPOut;

        // connections to network outside
        for i=0..sizeof(out)-1 do
            in[i] --> ppp[i].physIn;
            out[i] <-- ppp[i].physOut;
            ppp[i].netwOut --> networkLayer.ifIn[i];
            ppp[i].netwIn <-- networkLayer.ifOut[i];
        endfor;

endmodule