| Introduction | Function Summary | Function Reference |
| sync_open | Opens up a synchronous connection |
|---|---|
| sync_getconfig | Get settings for the link configuration that is currently active |
| sync_close | Closes a SCALLT |
| sync_read | Receive characters from a synchronous connection |
| sync_write | Send data over a synchronous link |
| sync_ioctl | Sends an ioctl message to the device driver |
| sync_logmsg | Logs message to stdout |
| sync_setopts | Sets global synchronous library options |
| sync_getopts | Gets global synchronous library options |
| sync_findtag | Find a tag in tags list |
| sync_geterror/sync_geterrno | Retrieve most recent library error number |
| sync_getsyserror | Retrieve current library system error number |
| sync_setuservalue | Sets a user supplied value inside SCALLT * |
| sync_getuservalue | Gets a user supplied value inside SCALLT * |
| sync_setnetent | Initializes packetnets file for reading |
| sync_endnetent | Ends packetnets file operations |
| sync_setfilter | Sets packetnets network type filter |
| sync_getnetent | Retrieves next syncnetent structure |
| sync_getnetbyname | Look up packetnets entry by name |
| sync_getnetbynetid | Look up packetnets entry by netid |
| sync_lookinit | Initialize selection mechanism |
| sync_lookadd | Add the SCALLT * to selection list |
| sync_lookdel | sync_lookdel |
| sync_looksel | Checks for readability of SCALLTs |
| sync_lookclose | Close selection list |
| sync_look | Check readability of a single SCALLT * |
| sync_openstats | Open statistics request |
| sync_closestats | Closes statistics request |
| sync_getstats | Obtain statistics |
| sync_getdevtype | Obtain the device name associated with netid |
| sync_getdevicename | Obtain the device name associated with netid |
| sync_error | Prints error message to console |
| sync_errorstr | Copies error message to provided buffer |
| sync_getfd | Returns file descriptor associated with SCALLT * |
| sync_getdatafd | Returns file descriptor associated with SCALLT * |
| sync_getdevname | Return device name associated with SCALLT * |
| sync_getflags | Get flags currently set for SCALLT * |
| sync_getnetid | Return Network ID associated with SCALLT * |
| Introduction | Function Summary | Function Reference |
sync_open | |||||
| Prototypes | SCALLT *sync_open(int netid, ...) SCALLT *sync_opentags(int netid, TAGS *tags) | ||||
|---|---|---|---|---|---|
| Purpose | Opens up a synchronous connection | ||||
| Description | netid must be valid or this call will fail. If ST_NETNAME is supplied then the netid argument is ignored. Suppliying the ST_RAWOPEN, TRUE pair will cause no configuration of the link to take place. The order of deciding on a configuration set to use is as follows:
| ||||
| Tags |
| ||||
| Parameters |
| ||||
| Returns |
| ||||
| Errors |
| ||||
| See Also | |||||
sync_getconfig | |||||
| Prototypes | int sync_getconfig(SCALLT *ct, ...) int sync_getconfigtags(SCALLT *ct, TAGS *tags) | ||||
|---|---|---|---|---|---|
| Purpose | Get settings for the link configuration that is currently active | ||||
| Description | Some or all of the configuration items for a link may not have been specified using tags passed to sync_open(). Rather, the link configuration items may have come from the link defaults. This function allows the application to determine the configuration for a link. It must be called after sync_open(). The application may, for example, use this function to determine the active framesize so that it can pass an appropriate sized buffer to sync_write(). It is a good idea to check the sync_geterror() return value for more information when a -1 is returned. | ||||
| Tags |
| ||||
| Parameters |
| ||||
| Returns |
| ||||
| Errors |
| ||||
| See Also | |||||
sync_close | |||
| Prototypes | void sync_close(SCALLT *ct) | ||
|---|---|---|---|
| Purpose | Closes a SCALLT | ||
| Description | Frees all internally allocated memory. After this call ct should no longer be considered a valid pointer. | ||
| Parameters |
| ||
| See Also | |||
sync_read | |||||||
| Prototypes | int sync_read(SCALLT *ct, ...) int sync_readtags(SCALLT *ct, TAGS *tags) | ||||||
|---|---|---|---|---|---|---|---|
| Purpose | Receive characters from a synchronous connection | ||||||
| Description | This function returns the number of bytes read. The function expects a buffer big enough to hold the largest frame. If the frame is larger than the buffer, this buffer is returned full, and the next sync_read will return the next bytes of the frame. This function returns the number of bytes read or -1 if there was an error. It is a good idea to check the sync_geterror() return value for more information when a -1 is returned. If blocking is set (the default) then this function will attempt to read without error ST_MAXTRIES (default 20) times and will wait 1 second after each failed attempt. | ||||||
| Tags |
| ||||||
| Parameters |
| ||||||
| Returns |
| ||||||
| Errors |
| ||||||
| See Also | |||||||
sync_write | |||||||
| Prototypes | int sync_write(SCALLT *ct, ...) int sync_writetags(SCALLT *ct, TAGS *tags) | ||||||
|---|---|---|---|---|---|---|---|
| Purpose | Send data over a synchronous link | ||||||
| Description | The data appears "as is" except that the driver will prepend a flag character and append a 16 bit CRC to the data. This function returns the number of bytes written or -1 if a failure occurs. In the event of a failure use sync_geterror() to determine the cause. When unable to write data due to flow control, this function will sleep one second after receiving a time-out and then try again for ST_MAXTRIES (default 20) times. | ||||||
| Tags |
| ||||||
| Parameters |
| ||||||
| Returns |
| ||||||
| Errors |
| ||||||
| See Also | |||||||
sync_ioctl | |||||||||||
| Prototypes | int sync_ioctl(SCALLT *ct, int cmd, char *buf, int len, int timeout) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Purpose | Sends an ioctl message to the device driver | ||||||||||
| Description | |||||||||||
| Parameters |
| ||||||||||
| Returns |
| ||||||||||
| Errors |
| ||||||||||
sync_logmsg | |||
| Prototypes | void sync_logmsg(char *s, ...) | ||
|---|---|---|---|
| Purpose | Logs message to stdout | ||
| Description | |||
| Parameters |
| ||
sync_setopts | |||||
| Prototypes | int sync_setoptstags(SCALLT *ct, TAGS *tags) int sync_setopts(SCALLT *ct, ...) | ||||
|---|---|---|---|---|---|
| Purpose | Sets global synchronous library options | ||||
| Description | Any function using tags arguments will call this function. | ||||
| Tags |
| ||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_getopts | |||||
| Prototypes | int sync_getoptstags(SCALLT *ct, TAGS *tags) int sync_getopts(SCALLT *ct, ...) | ||||
|---|---|---|---|---|---|
| Purpose | Gets global synchronous library options | ||||
| Description | |||||
| Tags |
| ||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_findtag | |||||
| Prototypes | int sync_findtag(TAGS *tags, unsigned long item) | ||||
|---|---|---|---|---|---|
| Purpose | Find a tag in tags list | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
sync_geterror/sync_geterrno | |||
| Prototypes | int sync_geterror(void) int sync_geterrno(void) | ||
|---|---|---|---|
| Purpose | Retrieve most recent library error number | ||
| Description | If the return value is SYE_SYSERR, a call to sync_getsyserror() will retrieve the system error defined in errno.h. | ||
| See Also | |||
sync_getsyserror | |||
| Prototypes | int sync_getsyserrno(void) | ||
|---|---|---|---|
| Purpose | Retrieve current library system error number | ||
| Description | |||
| See Also | |||
sync_setuservalue | |||
| Prototypes | void sync_setuservalue(SCALLT *ct, unsigned long val) | ||
|---|---|---|---|
| Purpose | Sets a user supplied value inside SCALLT * | ||
| Description | |||
| See Also | |||
sync_getuservalue | |||
| Prototypes | unsigned long sync_getuservalue(SCALLT *ct) | ||
|---|---|---|---|
| Purpose | Gets a user supplied value inside SCALLT * | ||
| Description | |||
| See Also | |||
sync_setnetent | |||
| Prototypes | void sync_setnetent(void) | ||
|---|---|---|---|
| Purpose | Initializes packetnets file for reading | ||
| Description | |||
| See Also | |||
sync_endnetent | |||
| Prototypes | void sync_endnetent(void) | ||
|---|---|---|---|
| Purpose | Ends packetnets file operations | ||
| Description | |||
| See Also | |||
sync_setfilter | |||
| Prototypes | void sync_setfilter(int typemask) | ||
|---|---|---|---|
| Purpose | Sets packetnets network type filter | ||
| Description | The typemask is a type of network ie. NETX25_TYPE, NETFREL_TYPE, etc. may be OR'd together or NETALL_TYPE selecting all protocol/card types except disabled network IDs. If typemask is set to 0 or -1 we reset to the default type (NETSYNC_TYPE). | ||
| Parameters |
| ||
| See Also | |||
sync_getnetent | |||||
| Prototypes | syncnetent *sync_getnetent(void) | ||||
|---|---|---|---|---|---|
| Purpose | Retrieves next syncnetent structure | ||||
| Description | This function only returns synchronous (NETSYNC_TYPE) entries by default. See sync_setfilter() to change. | ||||
| Returns |
| ||||
| See Also | |||||
sync_getnetbyname | |||||
| Prototypes | syncnetent *sync_getnetbyname(char *name) | ||||
|---|---|---|---|---|---|
| Purpose | Look up packetnets entry by name | ||||
| Description | This function only returns synchronous (NETSYNC_TYPE) entries by default. See sync_setfilter() to change. | ||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_getnetbynetid | |||||
| Prototypes | syncnetent *sync_getnetbynetid(int netid) | ||||
|---|---|---|---|---|---|
| Purpose | Look up packetnets entry by netid | ||||
| Description | This function only returns synchronous (NETSYNC_TYPE) entries by default. See sync_setfilter() to change. | ||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_lookinit | |||||
| Prototypes | sync_lookent *sync_lookinit(int maxnetids) | ||||
|---|---|---|---|---|---|
| Purpose | Initialize selection mechanism | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_lookadd | |||||
| Prototypes | int sync_lookadd(sync_lookent *look, SCALLT *ct) | ||||
|---|---|---|---|---|---|
| Purpose | Add the SCALLT * to selection list | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_lookdel | |||||
| Prototypes | int sync_lookdel(sync_lookent *look, SCALLT *ct) | ||||
|---|---|---|---|---|---|
| Purpose | sync_lookdel | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_looksel | |||||
| Prototypes | SCALLT *sync_looksel(sync_lookent *look, int tmout) | ||||
|---|---|---|---|---|---|
| Purpose | Checks for readability of SCALLTs | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_lookclose | |||
| Prototypes | void sync_lookclose(sync_lookent *look) | ||
|---|---|---|---|
| Purpose | Close selection list | ||
| Description | |||
| Parameters |
| ||
| See Also | |||
sync_look | |||||||
| Prototypes | int sync_look(SCALLT *ct, int tmout) | ||||||
|---|---|---|---|---|---|---|---|
| Purpose | Check readability of a single SCALLT * | ||||||
| Description | |||||||
| Parameters |
| ||||||
| Returns |
| ||||||
| See Also | |||||||
sync_openstats | |||||||
| Prototypes | int sync_openstats(int netid, int type) | ||||||
|---|---|---|---|---|---|---|---|
| Purpose | Open statistics request | ||||||
| Description | Only one type of statistics request may be made at a time. | ||||||
| Parameters |
| ||||||
| Returns |
| ||||||
| See Also | |||||||
sync_closestats | |||
| Prototypes | void sync_closestats(void) | ||
|---|---|---|---|
| Purpose | Closes statistics request | ||
| Description | |||
| See Also | |||
sync_getstats | |||||||
| Prototypes | int sync_getstats(int netid, char *buf, int len) | ||||||
|---|---|---|---|---|---|---|---|
| Purpose | Obtain statistics | ||||||
| Description | |||||||
| Example |
| ||||||
| Parameters |
| ||||||
| Returns |
| ||||||
| See Also | |||||||
sync_getdevtype | |||||
| Prototypes | int sync_getdevtype(int netid) | ||||
|---|---|---|---|---|---|
| Purpose | Obtain the device name associated with netid | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_getdevicename | |||||
| Prototypes | int sync_getdevicename(int netid, char *name) | ||||
|---|---|---|---|---|---|
| Purpose | Obtain the device name associated with netid | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_error | |||
| Prototypes | void sync_error(char *errstring) | ||
|---|---|---|---|
| Purpose | Prints error message to console | ||
| Description | Also prints out the error string associated with a system error (in errno.) (not under SV4 & Windows NT) SV4 only: the errno value is appended to the error string. Windows NT only: the value returned by GetLastError() is appended to the error string. Use of stdout is restricted to Console (Text mode) applications. | ||
| Parameters |
| ||
| See Also | |||
sync_errorstr | |||||
| Prototypes | int sync_errorstr(char *buf, int buflen) | ||||
|---|---|---|---|---|---|
| Purpose | Copies error message to provided buffer | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_getfd | |||||
| Prototypes | int sync_getfd(SCALLT *ct) | ||||
|---|---|---|---|---|---|
| Purpose | Returns file descriptor associated with SCALLT * | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_getdatafd | |||||
| Prototypes | int sync_getdatafd(SCALLT *ct) | ||||
|---|---|---|---|---|---|
| Purpose | Returns file descriptor associated with SCALLT * | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
| See Also | |||||
sync_getdevname | |||||
| Prototypes | char *sync_getdevname(SCALLT *ct) | ||||
|---|---|---|---|---|---|
| Purpose | Return device name associated with SCALLT * | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
sync_getflags | |||||
| Prototypes | int sync_getflags(SCALLT *ct | ||||
|---|---|---|---|---|---|
| Purpose | Get flags currently set for SCALLT * | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
sync_getnetid | |||||
| Prototypes | int sync_getnetid(SCALLT *ct) | ||||
|---|---|---|---|---|---|
| Purpose | Return Network ID associated with SCALLT * | ||||
| Description | |||||
| Parameters |
| ||||
| Returns |
| ||||
Mon May 3 12:14:47 2004
by xtractxml.pl$Revision: 1.2 $
Copyright (C) 2003 The Software Group Limited. All Rights Reserved.