|
|
The example /etc/strcf file contains several functions that perform various configuration operations, along with a sample boot function. Normally, only the boot function must 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 cenetb, c802b, and loopback 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/inet/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
}
#
# cenetb - configure ethernet-type interface for cloning driver with
# one major per interface. This version assumes less about
# node names.
# usage: cenetb ip-fd dev if
cenetb {
onerror cenetb_fail
dev = open $2
addr = dlbind dev 0x800 # For Ethernet encoding
linkint $1 dev $3 0x4042
dev2 = open $2
addr = dlbind dev2 0x806 # For Ethernet encoding
arp = open /dev/inet/arp
sifhrd arp ether # hardware interface is ethernet
linkint arp dev2 $3 0x4042
sifaddr arp $3 addr
close arp
label cenetb_fail
}
#
# c802b - configure ethernet-type interface for cloning driver with
# one major per interface. This version sets up 802.n framing.
# usage: c802b ip-fd dev if
c802b {
onerror c802b_fail
dev = open $2
addr = dlbind dev 0xaa # For IEEE802 encoding
dlsubsbind dev 0x800
linkint $1 dev $3 0x4042
dev2 = open $2
addr = dlbind dev2 0xaa # For IEEE802 encoding
dlsubsbind dev2 0x806
arp = open /dev/inet/arp
sifhrd arp ieee # hardware interface is ieee802
linkint arp dev2 $3 0x4042
sifaddr arp $3 addr
close arp
label c802b_fail
}
#
# loopback - configure loopback device
# usage: loopback ip-fd
#
loopback {
dev = open /dev/llcloop
addr = dlbind dev 0x800
linkint $1 dev lo0 0x4048
}
#
# boot - boot time configuration
#
boot {
exit # failure causes exit/panic
#
# queue params
#
initqp /dev/inet/udp rq 8192 49152
initqp /dev/inet/ip muxrq 8192 49152 muxwq 8192 49152
initqp /dev/inet/tcp muxrq 8192 49152 muxwq 8192 49152
#
# transport
#
tp /dev/inet/tcp
tp /dev/inet/udp
tp /dev/inet/icmp
tp /dev/inet/igmp
tp /dev/inet/rip
#
# interfaces
#
ip = open /dev/inet/ip
noexit # we will accept failure now
boot_net1
loopback ip
close ip
call ip_set_if_address
}
The function boot_net1 adds an Ethernet driver.
boot_net1 {
ip = open /dev/inet/ip
cenetb ip /dev/net1 net1
close ip
}