Solstice X.25 9.2 Developer's Guide

7.19 N_traceon --Turn on Packet Level Tracing

This ioctl turns on packet level tracing for a particular link or all configured links. Each incoming and outgoing X.25 packet will be sent up the stream on which the N_traceon ioctl was made.


Note -

This ioctl can have a serious impact on security. For this reason it can only be used by root.


Associated Structures

The following structures are associated with this ioctl:

struct trc_regioc {
    uint8     all_links;                /* Trace on all links           */
    uint8     spare[3];                 /* for alignment                */
    uint32    linkid;                   /* Link                         */
    uint8     level;                    /* Level of tracing required    */
    uint8     spare2[3];                /* for alignment                */
    uint32    active[MAX_LINKS+1];      /* tracing actively on          */
};

The members of the trc_regioc structure are:

Table 7-35 trc_regioc fields

Member 

value 

all_links

Returns the linkids of all links for which tracing was activated in the active array.

linkid

Specify tracing for a particular link. 

level

The level of tracing required. 

active

Indicates that tracing is currently active. 

Each X.25 packet is preceded by a trc_ctl structure:

/*
    Types of tracing message
*/
#define TR_CTL       100            /* Basic                   */
#define TR_LLC2_DAT  101            /* Basic + LLC2 parameters */
#define TR_LAPB_DAT  TR_CTL         /* Basic for now           */
#define TR_MLP_DAT   TR_CTL         /* Basic for now           */
#define TR_X25_DAT   TR_CTL         /* Basic for now           */
#define TR_DLPI      102            /* type used for tracing DLPI primitives */

/*
    Format for control part of trace messages
*/
struct trc_ctl {
    uint8           trc_prim;    /* Trace msg identifier     */
    uint8           trc_mid;     /* Id of protocol module    */
    uint16          trc_spare;   /* for alignment            */
    uint32          trc_linkid;  /* Link Id                  */
    uint8           trc_rcv;     /* Message tx or rx         */
    uint8           trc_spare2[3]; /* for alignment          */
    uint32          trc_time;    /* Time stamp               */
    uint16          trc_seq;     /* Message seq number       */
};
Table 7-36 trc_ctrl fields

Member 

Description 

trc_prim

Always set to TR_X25_DAT.

trc_mid

Always set to the module ID of the X.25 multiplexor (200). 

trc_linkid 

The link identifier 

trc_rcv 

Message receive or rx 

trc_time 

Time stamp 

trc_seq 

Message seq number