|
|
The strcf file contains several functions that perform various configuration operations, along with a sample boot function. Normally, no function should be modified to customize the configuration for a given installation. In some cases, however, it may be necessary to change existing functions or add new functions.
The tp and linkint functions perform basic linking operations. The add_interface, add_interface_SNAP, and add_loop functions configure different types of interfaces.
# # tp - configure transport provider (i.e. tcp, udp, icmp) # usage: tp devname # tp { p = open $1 ip = open /dev/ip plink p ip close p }
# # linkint - link interface to ip or arp # usage: linkint top bottom ifname flags # linkint { x = plink $1 $2 sifname $1 x $3 $4 }
# # add_interface - configure ethernet-type interface for cloning driver with # one major per interface. Arguments are already concatenated with # the major device number (such as emd0). It is assumed that boot has # already run. We open /dev/ip and link the device beneath it. # # usage: add_interface compat_ip_fd dev ifname # add_interface { dev = open $2 addr = dlbind dev 0x800 # For Ethernet encoding ip = open /dev/ip linkint ip dev $3 0x4042 close ip dev2 = open $2 addr = dlbind dev2 0x806 # For Ethernet encoding arp = open /dev/arp sifhrd arp ether # hardware interface is ethernet linkint arp dev2 $3 0x4042 sifaddr arp $3 addr close arp close dev2 }
# # add_interface_SNAP - configure ethernet-type interface for cloning driver # with one major per interface. This version sets up 802.n framing. # Arguments are already concatenated with the major device number # (such as emd0). It is assumed that boot has already run. # We bind the device to the SNAP SAP for ip and link the device # under ip. We also bind the device to the SNAP SAP for arp and link # the device under arp. # # usage: add_interface_SNAP compat_ip_fd dev ifname # add_interface_SNAP { dev = open $2 addr = dlbind dev 0xaa # For IEEE 802 encoding dlsubsbind dev 0x800 ip = open /dev/ip linkint ip dev $3 0x4042 close ip dev2 = open $2 addr = dlbind dev2 0xaa # For IEEE 802 encoding dlsubsbind dev2 0x806 arp = open /dev/arp sifhrd arp ieee # hardware interface is ieee802 linkint arp dev2 $3 0x4042 sifaddr arp $3 addr close arp close dev2 }
# # add_loop - configure loopback device. It is assumed that # boot has already run. We will open /dev/ip ourselves # and link the device beneath it. # # usage: add_loop compat_ip_fd compat_dev ifname # # add_loop { dev = open $2 addr = dlbind dev 0x800 ip = open /dev/ip linkint ip dev $3 0x4048 close ip close dev }
# # boot - boot time configuration # boot { # # queue params # initqp /dev/udp rq 8192 49152 initqp /dev/ip muxrq 8192 49152 muxwq 8192 49152 initqp /dev/tcp muxrq 8192 49152 muxwq 8192 49152 # # transport # tp /dev/tcp tp /dev/udp tp /dev/icmp tp /dev/igmp tp /dev/ipip tp /dev/rip }