From: PIRARD@VM1.ULG.AC.BE (Andre' PIRARD)
Newsgroups: comp.protocols.tcp-ip.ibmpc
Subject: Example: PCROUTE declare
Date: 21 Aug 92 15:59:48 GMT
Organization: University of Liege (Belgium), SEGI (Computing Center)

After so many questions about compiling PCROUTE, here is one example
working for 2 PDs and 2 SLIPs.
Remarks:
1) compare commented/uncommented includes with declare.inc model in dist.
2) always use 16550 chips for SLIP, it may save you a lot of troubles
(e. g. compatibility with Localtalk and Token/Ring).
3) be sure to always have one and no more that one cur_dl = cur_dl + 1
per interface.
4) do not try more than 2 SLIPs: there will be no room for buffers in
the single segment that PCROUTE uses.

Andr.

    .MODEL SMALL

    JUMPS                       ;; deal with long jump displacements
                                ;; automatically
    .CODE                       ;; extablish the default segment

    include debug.inc
    include log.inc
    include timer.inc
    include tasks.inc
    include buffer.inc
    include queue.inc
    include memory.inc

        ;; files for hardware support
   ;include wd8003.inc           ;; need for starlan cards
   ;include wd8003e.inc
   ;include 3c507.inc
    include packet.inc
   ;include bridge.inc           ;; need for the bridge-router only
    include qif.inc              ;; needed for slip only
    include slip.inc             ;; needed for slip only
    include i8250.inc            ;; needed for slip only
    include pp.inc               ;; needed for slip only
   ;include atalk.inc

        ;; high level code
    include if.inc
    include ether.inc
    include arptab.inc
    include arp.inc
    include dl_ip.inc
    include rip.inc
    include ip.inc
    include icmp.inc
    include udp.inc
    include bootp.inc

    DB_DECLARE                  ;; declare debugging routines

    cur_dl = 1

    ;; this is a packet driver entry
    PKT_DECLARE %cur_dl, 60H, 01        ;; <name>, <Int Num> <Class (Eth=1)>
    IF_DECLARE %cur_dl, %cur_dl, PKT        ;; <if name>, <real if>, <prefix>
    ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task>
    ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
    DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
    cur_dl = cur_dl + 1

    ;; this is a packet driver entry
    PKT_DECLARE %cur_dl, 61H, 01        ;; <name>, <Int Num> <Class (Eth=1)>
    IF_DECLARE %cur_dl, %cur_dl, PKT        ;; <if name>, <real if>, <prefix>
    ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task>
    ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
    DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
    cur_dl = cur_dl + 1

        ;; this is a SLIP entry for COM1
    I8250_DECLARE %cur_dl, SLIP, %cur_dl, IBM_COM1_PORT, IBM_COM1_IRQ, 0
    tmp = cur_dl*100                                 ;; generate temp names
    BUFF_DECLARE %(tmp+1), 3200                      ;; the read buffer
    QUEUE_DECLARE %(tmp+2), 5, %(size qif_entry)     ;; the read queue
    BUFF_DECLARE %(tmp+3),  8960                     ;; the write buffer
    QUEUE_DECLARE %(tmp+4), 14, %(size qif_entry) ;; the write queue
    SLIP_DECLARE %cur_dl,%cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4)
    Q_IF_DECLARE %cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4),SLIP,%cur_dl
    IF_DECLARE %cur_dl, %cur_dl, Q
    PP_DECLARE %cur_dl, %cur_dl, %cur_dl
    DL_IP_DECLARE %cur_dl, %cur_dl, PP   ;; <dlip name>, <real dlip> <prefix>
    cur_dl = cur_dl + 1

        ;; this is a SLIP entry for COM2
    I8250_DECLARE %cur_dl, SLIP, %cur_dl, IBM_COM2_PORT, IBM_COM2_IRQ, 0
    tmp = cur_dl*100                                 ;; generate temp names
    BUFF_DECLARE %(tmp+1), 3200                      ;; the read buffer
    QUEUE_DECLARE %(tmp+2), 5, %(size qif_entry)     ;; the read queue
    BUFF_DECLARE %(tmp+3),  8960                     ;; the write buffer
    QUEUE_DECLARE %(tmp+4), 14, %(size qif_entry) ;; the write queue
    SLIP_DECLARE %cur_dl,%cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4)
    Q_IF_DECLARE %cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4),SLIP,%cur_dl
    IF_DECLARE %cur_dl, %cur_dl, Q
    PP_DECLARE %cur_dl, %cur_dl, %cur_dl
    DL_IP_DECLARE %cur_dl, %cur_dl, PP   ;; <dlip name>, <real dlip> <prefix>
    cur_dl = cur_dl + 1

    num_dls = cur_dl - 1
    task_timer = cur_dl
    num_tasks  = cur_dl

    SCHED_DECLARE %num_tasks

    mytimer     = 10                        ;; WD_DECLARE Depends on this value
    TIMER_DECLARE %mytimer, %task_timer

    myip = 11
    myrip = 12
    myicmp = 13
    myudp = 14
    mybootp = 15
    mylog = 16
    dlog = 17
    IP_DECLARE %myip, %myrip, %num_dls, %myicmp
    UDP_DECLARE %myudp, %myip, %myicmp
    RIP_DECLARE %myrip, %myip, %mytimer, %myudp
    ICMP_DECLARE %myicmp, %myip, %myrip
    BOOTP_DECLARE %mybootp, %myudp, %num_dls
    LOG_DECLARE %mylog, LOG_LOCAL0, %myudp, %mytimer