NAME

suffix2pkttype, header2pkttype - find packet type in list

SYNOPSIS

#include "Pkt.h"

PacketType *suffix2pkttype(char *suffix)
PacketType *header2pkttype(short hdrcode, short bodycode)

Tbl *pktsuffixes(int content)

DESCRIPTION

The packet library has an internal table of packet types, constructed by mk_libpkt(1) as it makes the packet stuff and unstuff routines. This routine provides a method of looking up the information in this table via the suffix.

Because some earlier packet source names don't include a suffix, but instead use a now deprecated "standard" header, a secondary method using the hdrcode and bodycode from that header for cases where the suffix is null.

pktsuffixes returns a list of the suffixes which promise to return a particular content: waveform (Pkt_wf), database row (Pkt_db), etcetera. However, the actual content may be dynamic: a few packets sometimes return waveform data, and other times return some other data type. Only unstuffPkt can truly determine the content of every packet. The list may be freed with freetbl(list,0) ;

PARAMETER FILE

See the packets.pf parameter file packets(5) which is used to generate the packet library using mk_libpkt(1).

RETURN VALUES

The return value is zero if no packet matches; otherwise the returned PacketType * value contains at least the following:



typedef struct PacketType {
    char *name ;
    char *suffix ;
    int content ;
    int hdrcode ;
    int bodycode ;
    char *desc ;
    int (*stuff)(Packet *,char *,double *,char **,int *,int *) ;
    int (*unstuff)(char *,double,char *,int,Packet *) ;
} PacketType ;

LIBRARY

$(ORBLIBS)

SEE ALSO

stuffPkt(3)
unstuffPkt(3)

AUTHOR

Daniel Quinlan

Table of Contents
Antelope Release 4.8 Darwin 8.8.0 2006-12-19
Boulder Real Time Technologies, Inc For more information, contact support@brtt.com