home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / protocol / tcpip / ibmpc / 4828 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  5.1 KB

  1. Path: sparky!uunet!olivea!decwrl!mips!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!VM1.ULG.AC.BE!PIRARD
  2. From: PIRARD@VM1.ULG.AC.BE (Andre' PIRARD)
  3. Newsgroups: comp.protocols.tcp-ip.ibmpc
  4. Subject: Example: PCROUTE declare
  5. Message-ID: <9208211209.aa07780@louie.udel.edu>
  6. Date: 21 Aug 92 15:59:48 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Organization: University of Liege (Belgium), SEGI (Computing Center)
  9. Lines: 121
  10.  
  11. After so many questions about compiling PCROUTE, here is one example
  12. working for 2 PDs and 2 SLIPs.
  13. Remarks:
  14. 1) compare commented/uncommented includes with declare.inc model in dist.
  15. 2) always use 16550 chips for SLIP, it may save you a lot of troubles
  16. (e. g. compatibility with Localtalk and Token/Ring).
  17. 3) be sure to always have one and no more that one cur_dl = cur_dl + 1
  18. per interface.
  19. 4) do not try more than 2 SLIPs: there will be no room for buffers in
  20. the single segment that PCROUTE uses.
  21.  
  22. Andr.
  23.  
  24.     .MODEL SMALL
  25.  
  26.     JUMPS                       ;; deal with long jump displacements
  27.                                 ;; automatically
  28.     .CODE                       ;; extablish the default segment
  29.  
  30.     include debug.inc
  31.     include log.inc
  32.     include timer.inc
  33.     include tasks.inc
  34.     include buffer.inc
  35.     include queue.inc
  36.     include memory.inc
  37.  
  38.         ;; files for hardware support
  39.    ;include wd8003.inc           ;; need for starlan cards
  40.    ;include wd8003e.inc
  41.    ;include 3c507.inc
  42.     include packet.inc
  43.    ;include bridge.inc           ;; need for the bridge-router only
  44.     include qif.inc              ;; needed for slip only
  45.     include slip.inc             ;; needed for slip only
  46.     include i8250.inc            ;; needed for slip only
  47.     include pp.inc               ;; needed for slip only
  48.    ;include atalk.inc
  49.  
  50.         ;; high level code
  51.     include if.inc
  52.     include ether.inc
  53.     include arptab.inc
  54.     include arp.inc
  55.     include dl_ip.inc
  56.     include rip.inc
  57.     include ip.inc
  58.     include icmp.inc
  59.     include udp.inc
  60.     include bootp.inc
  61.  
  62.     DB_DECLARE                  ;; declare debugging routines
  63.  
  64.     cur_dl = 1
  65.  
  66.     ;; this is a packet driver entry
  67.     PKT_DECLARE %cur_dl, 60H, 01        ;; <name>, <Int Num> <Class (Eth=1)>
  68.     IF_DECLARE %cur_dl, %cur_dl, PKT        ;; <if name>, <real if>, <prefix>
  69.     ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task>
  70.     ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  71.     DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  72.     cur_dl = cur_dl + 1
  73.  
  74.     ;; this is a packet driver entry
  75.     PKT_DECLARE %cur_dl, 61H, 01        ;; <name>, <Int Num> <Class (Eth=1)>
  76.     IF_DECLARE %cur_dl, %cur_dl, PKT        ;; <if name>, <real if>, <prefix>
  77.     ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task>
  78.     ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  79.     DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  80.     cur_dl = cur_dl + 1
  81.  
  82.         ;; this is a SLIP entry for COM1
  83.     I8250_DECLARE %cur_dl, SLIP, %cur_dl, IBM_COM1_PORT, IBM_COM1_IRQ, 0
  84.     tmp = cur_dl*100                                 ;; generate temp names
  85.     BUFF_DECLARE %(tmp+1), 3200                      ;; the read buffer
  86.     QUEUE_DECLARE %(tmp+2), 5, %(size qif_entry)     ;; the read queue
  87.     BUFF_DECLARE %(tmp+3),  8960                     ;; the write buffer
  88.     QUEUE_DECLARE %(tmp+4), 14, %(size qif_entry) ;; the write queue
  89.     SLIP_DECLARE %cur_dl,%cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4)
  90.     Q_IF_DECLARE %cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4),SLIP,%cur_dl
  91.     IF_DECLARE %cur_dl, %cur_dl, Q
  92.     PP_DECLARE %cur_dl, %cur_dl, %cur_dl
  93.     DL_IP_DECLARE %cur_dl, %cur_dl, PP   ;; <dlip name>, <real dlip> <prefix>
  94.     cur_dl = cur_dl + 1
  95.  
  96.         ;; this is a SLIP entry for COM2
  97.     I8250_DECLARE %cur_dl, SLIP, %cur_dl, IBM_COM2_PORT, IBM_COM2_IRQ, 0
  98.     tmp = cur_dl*100                                 ;; generate temp names
  99.     BUFF_DECLARE %(tmp+1), 3200                      ;; the read buffer
  100.     QUEUE_DECLARE %(tmp+2), 5, %(size qif_entry)     ;; the read queue
  101.     BUFF_DECLARE %(tmp+3),  8960                     ;; the write buffer
  102.     QUEUE_DECLARE %(tmp+4), 14, %(size qif_entry) ;; the write queue
  103.     SLIP_DECLARE %cur_dl,%cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4)
  104.     Q_IF_DECLARE %cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4),SLIP,%cur_dl
  105.     IF_DECLARE %cur_dl, %cur_dl, Q
  106.     PP_DECLARE %cur_dl, %cur_dl, %cur_dl
  107.     DL_IP_DECLARE %cur_dl, %cur_dl, PP   ;; <dlip name>, <real dlip> <prefix>
  108.     cur_dl = cur_dl + 1
  109.  
  110.     num_dls = cur_dl - 1
  111.     task_timer = cur_dl
  112.     num_tasks  = cur_dl
  113.  
  114.     SCHED_DECLARE %num_tasks
  115.  
  116.     mytimer     = 10                        ;; WD_DECLARE Depends on this value
  117.     TIMER_DECLARE %mytimer, %task_timer
  118.  
  119.     myip = 11
  120.     myrip = 12
  121.     myicmp = 13
  122.     myudp = 14
  123.     mybootp = 15
  124.     mylog = 16
  125.     dlog = 17
  126.     IP_DECLARE %myip, %myrip, %num_dls, %myicmp
  127.     UDP_DECLARE %myudp, %myip, %myicmp
  128.     RIP_DECLARE %myrip, %myip, %mytimer, %myudp
  129.     ICMP_DECLARE %myicmp, %myip, %myrip
  130.     BOOTP_DECLARE %mybootp, %myudp, %num_dls
  131.     LOG_DECLARE %mylog, LOG_LOCAL0, %myudp, %mytimer
  132.