home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / p / pcrte224.zip / SOURCE.ZIP / DECLARE.INC < prev    next >
Text File  |  1992-06-09  |  11KB  |  249 lines

  1. ;;****************************************************************************
  2. ;;                      declare.inc         declare.inc
  3. ;;****************************************************************************
  4. ;;
  5. ;;  Copyright (C) 1989 Northwestern University, Vance Morrison
  6. ;;
  7. ;;
  8. ;; Permission to view, compile, and modify for LOCAL (intra-organization) 
  9. ;; USE ONLY is hereby granted, provided that this copyright and permission 
  10. ;; notice appear on all copies.  Any other use by permission only.
  11. ;;
  12. ;; Northwestern University makes no representations about the suitability 
  13. ;; of this software for any purpose.  It is provided "as is" without expressed 
  14. ;; or implied warranty.  See the copywrite notice file for complete details.
  15. ;;
  16. ;;*****************************************************************************
  17. ;;
  18. ;; Due to limitations in TURBO ASSEMBLER, we have to compile PCroute in 
  19. ;; pieces.  declare.inc is a 'header' file that constains the declarations
  20. ;; of all compile-time information that is shared among seperately compiled
  21. ;; pieces.  
  22. ;;
  23. ;;  AUTHOR: Vance Morrison  
  24. ;;  DATE:   4/28/89  
  25. ;;****************************************************************************
  26.  
  27.     .MODEL SMALL
  28.  
  29.     JUMPS                       ;; deal with long jump displacements 
  30.                                 ;; automatically
  31.     .CODE                       ;; extablish the default segment
  32.  
  33.     include debug.inc
  34.     include log.inc
  35.     include timer.inc
  36.     include tasks.inc
  37.     include buffer.inc
  38.     include queue.inc
  39.     include memory.inc 
  40.  
  41.         ;; files for hardware support
  42.    ;include wd8003.inc           ;; need for starlan cards
  43.    ;include wd8003e.inc     
  44.     include 3c507.inc
  45.    ;include packet.inc
  46.    ;include bridge.inc           ;; need for the bridge-router only
  47.    ;include qif.inc              ;; needed for slip only
  48.    ;include slip.inc             ;; needed for slip only 
  49.    ;include i8250.inc            ;; needed for slip only
  50.    ;include pp.inc               ;; needed for slip only
  51.    ;include atalk.inc
  52.  
  53.         ;; high level code
  54.     include if.inc
  55.     include ether.inc
  56.     include arptab.inc
  57.     include arp.inc
  58.     include dl_ip.inc
  59.     include rip.inc
  60.     include ip.inc
  61.     include icmp.inc
  62.     include udp.inc
  63.     include bootp.inc 
  64.  
  65.     DB_DECLARE                  ;; declare debugging routines
  66.  
  67.     cur_dl = 1
  68.  
  69.             ;; designed for 1st WD card (assumes D0000-D7FFF is free)
  70.         ; this is a wd8013EBT entry
  71.  ;  WDE_DECLARE %cur_dl, 280H, 0D000H, 0,0,64,1  ;;<name>, <I/O>, <seg>, <off>
  72.  ;      ; this is a wd8003EBT entry
  73.  ;  WDE_DECLARE %cur_dl, 280H, 0D000H, 0,0,128,0 ;;<name>, <I/O>, <seg>, <off>
  74.  ;      ; this is a wd8003E entry
  75.  ;  WDE_DECLARE %cur_dl, 280H, 0D000H, 0,0,32,0  ;;<name>, <I/O>, <seg>, <off>
  76.  ;      ; this is a starlan entry
  77.  ;  WD_DECLARE %cur_dl, 280H, 0D000H, 0,10,16 ;;<name>, <I/O>, <seg>, <off>
  78.  ;  IF_DECLARE %cur_dl, %cur_dl, WDE        ;; <if name>, <real if>, <prefix>
  79.  ;  ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task>
  80.  ;  ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  81.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  82.  ;  cur_dl = cur_dl + 1
  83.  
  84.             ;; designed for 2nd WD card (assumes D8000-DFFFF is free)
  85.         ; this is a wd8013EBT entry
  86.  ;  WDE_DECLARE %cur_dl, 2A0H, 0D800H, 0,0,64,1  ;;<name>, <I/O>, <seg>, <off>
  87.  ;      ; this is a wd8003EBT entry
  88.  ;  WDE_DECLARE %cur_dl, 2A0H, 0D800H, 0,0,128,0 ;;<name>, <I/O>, <seg>, <off>
  89.  ;      ; this is a wd8003E entry
  90.  ;  WDE_DECLARE %cur_dl, 2A0H, 0D800H, 0,0,32,0  ;;<name>, <I/O>, <seg>, <off>
  91.  ;      ; this is a starlan entry
  92.  ;  WD_DECLARE %cur_dl, 2A0H, 0D800H, 0,10,16 ;;<name>, <I/O>, <seg>, <off>
  93.  ;  IF_DECLARE %cur_dl, %cur_dl, WDE        ;; <if name>, <real if>, <prefix>
  94.  ;  ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task> 
  95.  ;  ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  96.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  97.  ;  cur_dl = cur_dl + 1
  98.  
  99.             ;; designed for 3rd WD card (assumes A0000-A7FFF is free)
  100.  ;      ; this is a wd8013EBT entry
  101.  ;  WDE_DECLARE %cur_dl, 2C0H, 0A000H, 0,0,64,1  ;;<name>, <I/O>, <seg>, <off>
  102.  ;      ; this is a wd8003EBT entry
  103.  ;  WDE_DECLARE %cur_dl, 2C0H, 0A000H, 0,0,128,0 ;;<name>, <I/O>, <seg>, <off>
  104.  ;      ; this is a wd8003E entry
  105.  ;  WDE_DECLARE %cur_dl, 2C0H, 0A000H, 0,0,32,0  ;;<name>, <I/O>, <seg>, <off>
  106.  ;      ; this is a starlan entry
  107.  ;  WD_DECLARE %cur_dl, 2E0H, 0A000H, 0,10,16 ;;<name>, <I/O>, <seg>, <off>
  108.  ;  IF_DECLARE %cur_dl, %cur_dl, WDE        ;; <if name>, <real if>, <prefix>
  109.  ;  ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task> 
  110.  ;  ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  111.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  112.  ;  cur_dl = cur_dl + 1
  113.  
  114.         ;; a 3C507 card entry 64K of memory at D0000H
  115.     C507_DECLARE %cur_dl, 280H, 0D000H, 10000H, 0   ;; name,io,seg,len,prom
  116.     IF_DECLARE %cur_dl, %cur_dl, C507
  117.     ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task> 
  118.     ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  119.     DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  120.     cur_dl = cur_dl + 1
  121.  
  122.         ;; a 3C507 card entry 64K of memory at C0000H
  123.     C507_DECLARE %cur_dl, 2A0H, 0C000H, 10000H, 0   ;; name,io,seg,len,prom
  124.     IF_DECLARE %cur_dl, %cur_dl, C507
  125.     ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task> 
  126.     ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  127.     DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  128.     cur_dl = cur_dl + 1
  129.  
  130.     ;; this is a packet driver entry
  131.  ;  PKT_DECLARE %cur_dl, 60H, 01        ;; <name>, <Int Num> <Class (Eth=1)>
  132.  ;  IF_DECLARE %cur_dl, %cur_dl, PKT        ;; <if name>, <real if>, <prefix>
  133.  ;  ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task> 
  134.  ;  ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  135.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  136.  ;  cur_dl = cur_dl + 1
  137.  
  138.     ;; this is a packet driver entry
  139.  ;  PKT_DECLARE %cur_dl, 61H, 01        ;; <name>, <Int Num> <Class (Eth=1)>
  140.  ;  IF_DECLARE %cur_dl, %cur_dl, PKT        ;; <if name>, <real if>, <prefix>
  141.  ;  ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task> 
  142.  ;  ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  143.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  144.  ;  cur_dl = cur_dl + 1
  145.  
  146.         ;; this is a SLIP entry for COM1
  147.  ;  I8250_DECLARE %cur_dl, SLIP, %cur_dl, IBM_COM1_PORT, IBM_COM1_IRQ, 0
  148.  ;  tmp = cur_dl*100                                 ;; generate temp names
  149.  ;  BUFF_DECLARE %(tmp+1), 3200                      ;; the read buffer
  150.  ;  QUEUE_DECLARE %(tmp+2), 5, %(size qif_entry)     ;; the read queue
  151.  ;  BUFF_DECLARE %(tmp+3), 10240                     ;; the write buffer
  152.  ;  QUEUE_DECLARE %(tmp+4), 16, %(size qif_entry) ;; the write queue
  153.  ;  SLIP_DECLARE %cur_dl,%cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4)
  154.  ;  Q_IF_DECLARE %cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4),SLIP,%cur_dl
  155.  ;  IF_DECLARE %cur_dl, %cur_dl, Q
  156.  ;  PP_DECLARE %cur_dl, %cur_dl, %cur_dl
  157.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, PP   ;; <dlip name>, <real dlip> <prefix>
  158.  ;  cur_dl = cur_dl + 1
  159.  
  160.         ;; this is a SLIP entry for COM2
  161.  ;  I8250_DECLARE %cur_dl, SLIP, %cur_dl, IBM_COM2_PORT, IBM_COM2_IRQ, 0
  162.  ;  tmp = cur_dl*100                                 ;; generate temp names
  163.  ;  BUFF_DECLARE %(tmp+1), 3200                      ;; the read buffer
  164.  ;  QUEUE_DECLARE %(tmp+2), 5, %(size qif_entry)     ;; the read queue
  165.  ;  BUFF_DECLARE %(tmp+3), 10240                     ;; the write buffer
  166.  ;  QUEUE_DECLARE %(tmp+4), 16, %(size qif_entry) ;; the write queue
  167.  ;  SLIP_DECLARE %cur_dl,%cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4)
  168.  ;  Q_IF_DECLARE %cur_dl,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4),SLIP,%cur_dl
  169.  ;  IF_DECLARE %cur_dl, %cur_dl, Q
  170.  ;  PP_DECLARE %cur_dl, %cur_dl, %cur_dl
  171.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, PP   ;; <dlip name>, <real dlip> <prefix>
  172.  ;  cur_dl = cur_dl + 1
  173.  
  174.         ;; localtalk interface
  175.  ;  ATP_DECLARE %cur_dl, 60H, %cur_dl, 10, 2000 ;; <name> <int> <task> <wqueue>
  176.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, ATP     ;; <dlip name>, <real dlip> <prefix>
  177.  ;  cur_dl = cur_dl + 1
  178.  
  179.         ;; FOR A BRIDGE ROUTER
  180. ;;***************************************************************************
  181.     bdg_start = 5
  182.     bdg_dl = bdg_start
  183.  
  184.         ;; declare IF 1
  185.  ;  WDE_DECLARE %bdg_dl, 280H, 0D000H,0,1,32,0  ;;<name>, <I/O>, <seg>, <off>
  186.  ;  WDE_DECLARE %bdg_dl, 280H, 0D000H,0,1,64,1  ;;<name>, <I/O>, <seg>, <off>
  187.  ;  IF_DECLARE %bdg_dl, %bdg_dl, WDE       ;; <if name>, <real if>, <prefix>
  188.  ;  bdg_dl = bdg_dl + 1
  189.  
  190.         ;; a 3C507 card entry 64K of memory at D0000H
  191.  ;  C507_DECLARE %bdg_dl, 280H, 0D000H, 10000H, 1   ;; name,io,seg,len,prom
  192.  ;  IF_DECLARE %bdg_dl, %bdg_dl, C507
  193.  ;  bdg_dl = bdg_dl + 1
  194.  
  195.         ;; declare IF 2
  196.  ;  WDE_DECLARE %bdg_dl, 2A0H, 0D800H, 0,1,32,0  ;;<name>, <I/O>, <seg>, <off>
  197.  ;  WDE_DECLARE %bdg_dl, 2A0H, 0D800H, 0,1,64,1  ;;<name>, <I/O>, <seg>, <off>
  198.  ;  IF_DECLARE %bdg_dl, %bdg_dl, WDE       ;; <if name>, <real if>, <prefix>
  199.  ;  bdg_dl = bdg_dl + 1
  200.  
  201.         ;; a 3C507 card entry 64K of memory at C0000H
  202.  ;  C507_DECLARE %bdg_dl, 2A0H, 0C000H, 10000H, 1   ;; name,io,seg,len,prom
  203.  ;  IF_DECLARE %bdg_dl, %bdg_dl, C507
  204.  ;  bdg_dl = bdg_dl + 1
  205.  
  206.         ;; declare that these are BRIDGED
  207.  ;  BDG_DECLARE 1,%bdg_start,%(bdg_dl-1),0  ;; <name> <start> <end> <forward ip>
  208.  ;  bdg_dl = bdg_start
  209.  
  210.  ;  IF_DECLARE %cur_dl, %bdg_dl, BDG        ;; <name> <real if> <prefix>
  211.  ;  ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task>
  212.  ;  ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  213.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  214.  ;  cur_dl = cur_dl + 1
  215.  ;  bdg_dl = bdg_dl + 1
  216.  
  217.  ;  IF_DECLARE %cur_dl, %bdg_dl, BDG        ;; <name> <real if> <prefix>
  218.  ;  ETH_DECLARE %cur_dl, %cur_dl, %cur_dl   ;; <eth name>, <if>, <task>
  219.  ;  ARP_DECLARE %cur_dl, %cur_dl            ;; <arp name>, <ether>
  220.  ;  DL_IP_DECLARE %cur_dl, %cur_dl, ARP     ;; <dlip name>, <real dlip> <prefix>
  221.  ;  cur_dl = cur_dl + 1
  222.  ;  bdg_dl = bdg_dl + 1
  223.  
  224. ;; end of declarations
  225. ;;****************************************************************************
  226.  
  227.     num_dls = cur_dl - 1
  228.     task_timer = cur_dl
  229.     num_tasks  = cur_dl
  230.  
  231.     SCHED_DECLARE %num_tasks
  232.  
  233.     mytimer     = 10                        ;; WD_DECLARE Depends on this value
  234.     TIMER_DECLARE %mytimer, %task_timer
  235.  
  236.     myip = 11
  237.     myrip = 12
  238.     myicmp = 13
  239.     myudp = 14
  240.     mybootp = 15
  241.     mylog = 16
  242.     dlog = 17
  243.     IP_DECLARE %myip, %myrip, %num_dls, %myicmp
  244.     UDP_DECLARE %myudp, %myip, %myicmp
  245.     RIP_DECLARE %myrip, %myip, %mytimer, %myudp
  246.     ICMP_DECLARE %myicmp, %myip, %myrip
  247.     BOOTP_DECLARE %mybootp, %myudp, %num_dls
  248.     LOG_DECLARE %mylog, LOG_LOCAL0, %myudp, %mytimer
  249.