Solstice X.25 9.2 Administration Guide

Shutdown

Normally, HDLC remains up for as long as the remote host is physically connected to the local port. For this reason, close (2) does not affect the state of HDLC, and any packets queued for output are transmitted.

To shut down HDLC, execute the following ioctl:


int fid;
error = ioctl(fid, HDLC_RESET, 0);

This puts the line into the HDLCLINK_DOWN state. Calls to read and write will fail, and errno is set to ENETDOWN. This is the same call that hdlcstop uses.