strcf(4) strcf(4)
NAME
strcf - STREAMS configuration file for STREAMS TCP/IP
SYNOPSIS
/etc/strcf
DESCRIPTION
The strcf file contains the script that is executed by
slink(1M) to perform the STREAMS configuration operations
required for STREAMS TCP/IP.
USAGE
The standard 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.
Linking Functions
The following functions perform basic linking operations:
The tp function is used to set up the link between a transport
provider, such as TCP, and IP.
#
# tp - configure transport provider (that is, tcp, udp, icmp)
# usage: tp devname
#
tp {
p = open $1
ip = open /dev/ip
link p ip
}
The iplinkint function binds the lower stream to the specified
SAP value, links the lower stream under IP and performs a
sifname operation with the given name.
#
# iplinkint - link interface to ip
# usage: iplinkint fd_of_ip fd_of_dev ifname sap
#
# NOTE: If app is needed on this stream, it must be pushed before
# iplinkint is called.
#
iplinkint {
bind $2 $4
Copyright 1994 Novell, Inc. Page 1
strcf(4) strcf(4)
muxid = new_link $1 $2
sifname $1 muxid $3
}
The iplinkint_subs function binds the lower stream to the
specified SAP and subsequent SAP values, links the lower
stream under IP and performs a sifname operation with the
given name.
#
# iplinkint_subs - link interface to ip
# usage: iplinkint_subs fd_of_ip fd_of_dev ifname sap subs_sap
#
# NOTE: If app is needed on this stream, it must be pushed before
# iplinkint_subs is called.
#
iplinkint_subs {
bind $2 $4 $5
muxid = new_link $1 $2
sifname $1 muxid $3
}
The arplinkint function binds the lower stream to the
specified SAP value, links the lower stream under ARP and
performs a sifname operation with the given name.
#
# arplinkint - link interface to arp
# usage: arplinkint fd_of_arp fd_of_dev ifname sap
#
arplinkint {
bind $2 $4
muxid = new_link $1 $2
sifname $1 muxid $3
}
The arplinkint_subs function binds the lower stream to the
specified SAP and subsequent SAP values, links the lower
stream under ARP and performs a sifname operation with the
given name.
#
# arplinkint_subs - link interface to arp
# usage: arplinkint_subs fd_of_arp fd_of_dev ifname sap subs_sap
#
arplinkint_subs {
bind $2 $4 $5
muxid = new_link $1 $2
sifname $1 muxid $3
Copyright 1994 Novell, Inc. Page 2
strcf(4) strcf(4)
}
The linkint function links the specified streams and does a
sifname operation with the given name. This script is
provided for compatibility purposes only. Use iplinkint or
arplinkint as appropriate.
#
# linkint - link interface to ip or arp
# usage: linkint top bottom ifname
#
# THIS SCRIPT IS FOR COMPATIBILITY ONLY - see iplinkint or arplinkint
#
linkint {
x = link $1 $2
sifname $1 x $3
}
The aplinkint function performs the same function as linkint
for an interface that uses the app module. This script is
provided for compatibility purposes only. Use
iplinkint/arplinkint and push as appropriate.
#
# aplinkint - like linkint, but app is pushed on dev
# usage: aplinkint top bottom ifname
#
# THIS SCRIPT IS FOR COMPATIBILITY ONLY - see iplinkint, arplinkint and push
#
aplinkint {
push $2 app
linkint $1 $2 $3
}
Configuration Functions
The following functions are used to configure different types
of Ethernet interfaces:
The add_interface function is used to configure an Ethernet
interface (with the Ethernet II frame type) for a cloning
device driver that uses a different major number for each
interface. The device name and interface name have already
had the unit number concatenated to them.
#
# add_interface - configure ethernet-type interface for cloning driver with
# one major per interface. Similar to cenet except we are given
# arguments that are already concatenated with major device
# number (such as emd0).
Copyright 1994 Novell, Inc. Page 3
strcf(4) strcf(4)
# We will also assume that boot{} has already run and
# we will open /dev/ip ourselves and link up underneath it.
# usage: add_interface compat_ip_reserved devpath ifname
#
add_interface {
ip = open /dev/ip
dev = open $2
push dev app
iplinkint ip dev $3 0x800
dev = open $2
arp = open /dev/arp
arplinkint arp dev $3 0x806
}
The add_interface_SNAP function is used to configure an
Ethernet interface (with the SNAP SAP frame type) for a
cloning device driver that uses a different major number for
each interface. The device name and interface name have
already had the unit number concatenated to them.
#
# add_interface_SNAP - configure ethernet-type interface for cloning driver
# with one major per interface. Similar to cenet except we are given
# arguments that are already concatenated with a major device number
# (such as emd0). We assume that boot{} has already run. We will use
# iplinkint to bind the device to the SNAP SAP for ip and link devpath
# under IP, and will open devpath, and use arplinkint to bind it to
# the SNAP SAP for arp and link it under arp.
# usage: add_interface_SNAP compat_ip_reserved devpath ifname
#
add_interface_SNAP {
ip = open /dev/ip
dev = open $2
push dev app
iplinkint_subs ip dev $3 0xaa 0x800
dev = open $2
arp = open /dev/arp
arplinkint_subs arp dev $3 0xaa 0x806
}
The uenet function is used to configure an Ethernet interface
for a cloning device driver that uses the ``unit select''
ioctl to select the desired interface. The interface name is
constructed by concatenating the supplied prefix and the unit
number.
Copyright 1994 Novell, Inc. Page 4
strcf(4) strcf(4)
#
# uenet - configure ethernet-type interface for cloning driver using
# unit select
# usage: uenet ip-fd devname ifprefix unit
#
uenet {
ifname = strcat $3 $4
dev = open $2
unitsel dev $4
push dev app
iplinkint $1 dev ifname 0x800
dev = open $2
unitsel dev $4
arp = open /dev/arp
arplinkint arp dev ifname 0x806
}
The denet function performs the same function as uenet, except
that DL_ATTACH is used instead of ``unit select.''
#
# denet - configure ethernet-type interface for cloning driver using
# DL_ATTACH
# usage: denet ip-fd devname ifprefix unit
#
denet {
ifname = strcat $3 $4
dev = open $2
dlattach dev $4
push dev app
iplinkint $1 dev ifname 0x800
dev = open $2
dlattach dev $4
arp = open /dev/arp
arplinkint arp dev ifname 0x806
}
The cenet function is used to configure an Ethernet interface
for a cloning device driver that uses a different major number
for each interface. The device name is formed by
concatenating the supplied device name prefix and the unit
number. The interface name is formed in a similar manner
using the interface name prefix.
Copyright 1994 Novell, Inc. Page 5
strcf(4) strcf(4)
#
# cenet - configure ethernet-type interface for cloning driver with
# one major per interface
# usage: cenet ip-fd devprefix ifprefix unit
#
cenet {
devname = strcat $2 $4
ifname = strcat $3 $4
dev = open devname
push dev app
iplinkint $1 dev ifname 0x800
dev = open devname
arp = open /dev/arp
arplinkint arp dev ifname 0x806
}
The senet function is used to configure an Ethernet interface
for a non-cloning device driver. Two different device nodes
must be specified for IP and ARP.
#
# senet - configure ethernet-type interface for non-cloning driver
# usage: senet ip-fd ipdevname arpdevname ifname
#
senet {
dev = open $2
push dev app
iplinkint $1 dev $4 0x800
dev = open $3
arp = open /dev/arp
arplinkint arp dev $4 0x806
}
The senetc function is like senet, except that it allows the
specification of a convergence module to be used with the
Ethernet driver (such as, for the 3B2 emd driver).
#
# senetc - configure ethernet-type interface for non-cloning driver
# using convergence module
# usage: senetc ip-fd convergence ipdevname arpdevname ifname
#
senetc {
dev = open $3
push dev $2
push dev app
Copyright 1994 Novell, Inc. Page 6
strcf(4) strcf(4)
iplinkint $1 dev $5 0x800
dev = open $4
push dev $2
arp = open /dev/arp
arplinkint arp dev $5 0x806
}
The loopback function is used to configure the loopback
interface.
#
# loopback - configure loopback device
# usage: loopback compat_ip_reserved ifname
#
loopback {
ip = open /dev/ip
dev = open /dev/loop
iplinkint ip dev $2 0x800
}
The slip function is used to configure a SLIP interface. This
function is not normally executed at boot time. This script
is provided for compatibility purposes only.
#
# slip - configure slip interface
# usage: slip unit
#
# THIS SCRIPT IS FOR COMPATIBILITY ONLY.
#
slip {
ip = open /dev/ip
s = open /dev/slip
ifname = strcat sl $1
unitsel s $1
iplinkint ip s ifname 0x800
}
The add_ppp function is used to configure a PPP interface.
#
# usage: add_ppp compat_ip_reserved devicename interfacename
# We will assume that boot{} has already run and
# we will open /dev/ip ourselves and link up underneath it.
add_ppp {
ip = open /dev/ip
Copyright 1994 Novell, Inc. Page 7
strcf(4) strcf(4)
dev = open $2
iplinkint $1 dev $3 0x800
}
The boot function is called by default when slink is executed.
Normally, only the ``interfaces'' section and possibly the
``queue params'' section will have to be customized for a
given installation. Examples are provided for the various
Ethernet driver types.
#
# boot - boot time configuration
#
boot {
#
# queue params
#
initqp /dev/ip muxrq 40960 64386 rq 8192 40960
initqp /dev/tcp muxrq 8192 40960
initqp /dev/udp hdrq 32768 64512
#
# transport
#
tp /dev/tcp
tp /dev/udp
tp /dev/icmp
tp /dev/rawip
}
REFERENCES
slink(1M)
Copyright 1994 Novell, Inc. Page 8