Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ X25ReadAccountingLog(3X25) — DECnet WAN Support 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

x25accounting(8X25)

x25accountingd(8X25)

errno(2)

fclose(3)

feof(3)

ferror(3)

fopen(3)

fread(3)

fwrite(3)

X25ReadAccountingLog(3X25)  —  Subroutines

Digital

NAME

X25ReadAccountingLog, X25WriteAccountingLog − Access accounting log files

LIBRARY

X.25 Library (libx25.a)

SYNOPSIS

#include <netx25/x25_accounting.h>
size_t X25ReadAccountingLog(

X25AccountingRecord record[] ,
size_t n ,
FILE ∗from );

#include <netx25/x25_accounting.h>
size_t X25WriteAccountingLog(

X25AccountingRecord record[] ,
size_t n ,
FILE ∗to );

PARAMETERS

recordAn array of accounting records (capable of) containing at least n elements. 

nThe number of records to be read or written. 

fromAn open file from which accounting records are to be read. 

toAn open file into which accounting records are to be written. 

DESCRIPTION

The X25ReadAccountingLog and X25WriteAccountingLog routines are used to access accounting log files generated by the X.25 accounting daemon (x25accountingd(8X25)).  These routines are provided to allow the production of portable, customized, report generation software. 

The accounting records are stored in the log files in a machine-portable format so that log files generated on one machine can be accessed by reporting utilities executing on another.  However, certain fields are specific to the machine on which the log file was generated (for example the user and process information). 

The X.25 accounting utility (x25accounting(8X25)) is provided with X.25 Digital UNIX to generate formatted reports from the accounting records collected by the X.25 accounting daemon.  The X25ReadAccountingLog and X25WriteAccountingLog routines can be used to implement a customized reporting utility. 

The fopen(3) and fclose(3) routines can be used to open and close the accounting log files. 

RETURN VALUES

Upon successful completion, the X25ReadAccountingLog routine returns the number of accounting records read.  Otherwise, a value of 0 (zero) is returned.  Use the ferror(3) macro to determine whether an error has occurred, and the feof(3) macro to determine whether the end of file has been reached. 

Upon successful completion, the X25WriteAccountingLog routine returns the number of accounting records written.  Otherwise, a value of 0 (zero) is returned. 

ERRORS

If either the X25ReadAccountingLog or X25WriteAccountingLog routine fails, errno(2) is set to a value indicating the error as follows:

X25ReadAccountingLog

The same error values are returned as for the fread(3) routine.  The following error value can also be returned:

[EINVAL]The data read from the input file is corrupted. 

X25WriteAccountingLog

The same error values are returned as for the fwrite(3) routine. 

RELATED INFORMATION

Commands: x25accounting(8X25), x25accountingd(8X25). 

Functions: errno(2), fclose(3), feof(3), ferror(3), fopen(3), fread(3), fwrite(3)

X.25 for Digital UNIX - Management Guide. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026