freebsd-dev/share/man/man4/ng_atmpif.4
Hartmut Brandt ee4080d424 Add ng_atmpif: a HARP physical interface emulation. This allows one
to run the HARP ATM stack without real hardware.

Submitted by:	Vincent Jardin <vjardin@wanadoo.fr>
2003-08-11 08:40:02 +00:00

151 lines
5.6 KiB
Groff

.\"
.\" Copyright (c) 2001-2003
.\" Harti Brandt.
.\" Vincent Jardin.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" Author: Hartmut Brandt <harti@freebsd.org>
.\" Author: Vincent Jardin <vjardin@free.fr>
.\"
.\" $FreeBSD$
.\"
.\" ng_atmpif(4) man page
.\"
.Dd August 7, 2003
.Dt ng_atmpif 4
.Os FreeBSD
.Sh NAME
.Nm ng_atmpif
.Nd netgraph HARP/ATM Virtual Physical Interface
.Sh SYNOPSIS
.Fd #include <netgraph/netgraph.h>
.Fd #include <netgraph/atm/ng_atmpif.h>
.Sh DESCIPTION
The
.Nm
netgraph node type allows the emulation of
.Xr atm 8
(netatm/HARP) Physical devices (PIF) to be connected to the
.Xr netgraph 4
networking subsystem.
Moreover it includes protection of the PDU against duplication and
desequencement.
It supports up to 65535 VCs and up to 255 VPs. AAL0, AAL3/4 and AAL5
emulation are provided.
In order to optimize CPU, this node does not emulate the SAR layer.
.Pp
The purpose of this node is to help in debugging and testing the HARP
stack when one does not have an ATM board or when the available boards do not
have enough features.
.Pp
When a node
.Nm
is created, a PIF is created automatically.
It is named hvaX.
It has the same features as any other HARP devices.
The PIF is removed when the node is removed.
.Sh HOOKS
There is only one hook: link. This hook can be connected to any other
Netgraph node. For example, in order
to test the HARP stack over UDP, it can be connected on a
.Xr ksocket 4
node.
.Sh CONTROL MESSAGES
This node type supports the generic messages plus the following:
.Bl -tag -width xxx
.It Dv NGM_ATMPIF_SET_CONFIG Ta setconfig
Configures the debugging features of the node and a virtual
Peak Cell Rate (PCR).
It uses the same structure as NGM_ATMPIF_GET_CONFIG.
.It Dv NGM_ATMPIF_GET_CONFIG Ta getconfig
Returns a structure defining the configuration of the interface:
.Bd -literal
struct ng_vatmpif_config {
uint8_t debug; /* debug bit field (see below) */
uint32_t pcr; /* peak cell rate */
Mac_addr macaddr; /* Mac Address */
};
.Ed
Note that the following debugging flags can be used:
.Bl -column ATM_PH_LLCSNAP -offset indent
.It Dv VATMPIF_DEBUG_NONE Ta disable debugging
.It Dv VATMPIF_DEBUG_PACKET Ta enable debugging
.El
.Pp
.It Dv NGM_ATMPIF_GET_LINK_STATUS Ta getlinkstatus
Returns the last received sequence number, the last sent sequence
number and the current total PCR that is reserved among all the VCCs
of the interface.
.Bd -literal
struct ng_atmpif_link_status {
uint32_t InSeq; /* last received sequence number + 1 */
uint32_t OutSeq; /* last sent sequence number */
uint32_t cur_pcr; /* slot's reserved PCR */
};
.Ed
.Pp
.It Dv NGM_ATMPIF_GET_STATS Ta getstats
.It Dv NGM_ATMPIF_CLR_STATS Ta clrstats
.It Dv NGM_ATMPIF_GETCLR_STATS Ta getclrstats
It returns the node's statistics, it clears them or it returns and reset
their values to 0.
The following stats are provided.
.Bd -literal
struct hva_stats_ng {
uint32_t ng_errseq; /* Duplicate or out of order */
uint32_t ng_lostpdu; /* PDU lost detected */
uint32_t ng_badpdu; /* Unknown PDU type */
uint32_t ng_rx_novcc; /* Draining PDU on closed VCC */
uint32_t ng_rx_iqfull; /* PDU drops no room in atm_intrq */
uint32_t ng_tx_rawcell; /* PDU raw cells transmitted */
uint32_t ng_rx_rawcell; /* PDU raw cells received */
uint64_t ng_tx_pdu; /* PDU transmitted */
uint64_t ng_rx_pdu; /* PDU received */
};
struct hva_stats_atm {
uint64_t atm_xmit; /* Cells transmitted */
uint64_t atm_rcvd; /* Cells received */
};
struct hva_stats_aal5 {
uint64_t aal5_xmit; /* Cells transmitted */
uint64_t aal5_rcvd; /* Cells received */
uint32_t aal5_crc_len; /* Cells with CRC/length errors */
uint32_t aal5_drops; /* Cell drops */
uint64_t aal5_pdu_xmit; /* CS PDUs transmitted */
uint64_t aal5_pdu_rcvd; /* CS PDUs received */
uint32_t aal5_pdu_crc; /* CS PDUs with CRC errors */
uint32_t aal5_pdu_errs; /* CS layer protocol errors */
uint32_t aal5_pdu_drops; /* CS PDUs dropped */
};
.Ed
.El
.Sh SEE ALSO
.Xr netgraph 4 ,
.Xr ng_ksocket 4 ,
.Xr natm 4 ,
.Xr ngctl 8
.Sh AUTHORS
.An Harti Brandt Aq harti@freebsd.org
.An Vincent Jardin Aq vjardin@wanadoo.fr