/*++ /* NAME /* scache 3 /* SUMMARY /* generic session cache API /* SYNOPSIS /* #include <scache.h> /* DESCRIPTION /* typedef struct { /* .in +4 /* int dest_count; /* int endp_count; /* int sess_count; /* .in -4 /* } SCACHE_SIZE; /* /* unsigned scache_size(scache, size) /* SCACHE *scache; /* SCACHE_SIZE *size; /* /* void scache_free(scache) /* SCACHE *scache; /* /* void scache_save_endp(scache, endp_ttl, endp_label, endp_prop, fd) /* SCACHE *scache; /* int endp_ttl; /* const char *endp_label; /* const char *endp_prop; /* int fd; /* /* int scache_find_endp(scache, endp_label, endp_prop) /* SCACHE *scache; /* const char *endp_label; /* VSTRING *endp_prop; /* /* void scache_save_dest(scache, dest_ttl, dest_label, /* dest_prop, endp_label) /* SCACHE *scache; /* int dest_ttl; /* const char *dest_label; /* const char *dest_prop; /* const char *endp_label; /* /* int scache_find_dest(dest_label, dest_prop, endp_prop) /* SCACHE *scache; /* const char *dest_label; /* VSTRING *dest_prop; /* VSTRING *endp_prop; /* DESCRIPTION /* This module implements a generic session cache interface. /* Specific cache types are described in scache_single(3), /* scache_clnt(3) and scache_multi(3). These documents also /* describe now to instantiate a specific session cache type. /* /* The code maintains two types of association: a) physical /* endpoint to file descriptor, and b) logical endpoint /* to physical endpoint. Physical endpoints are stored and /* looked up under their low-level session details such as /* numerical addresses, while logical endpoints are stored /* and looked up by the domain name that humans use. One logical /* endpoint can refer to multiple physical endpoints, one /* physical endpoint may be referenced by multiple logical /* endpoints, and one physical endpoint may have multiple /* sessions. /* /* scache_size() returns the number of logical destination /* names, physical endpoint addresses, and cached sessions. /* /* scache_free() destroys the specified session cache. /* /* scache_save_endp() stores an open session under the specified /* physical endpoint name. /* /* scache_find_endp() looks up a saved session under the /* specified physical endpoint name. /* /* scache_save_dest() associates the specified physical endpoint /* with the specified logical endpoint name. /* /* scache_find_dest() looks up a saved session under the /* specified physical endpoint name. /* /* Arguments: /* .IP endp_ttl /* How long the session should be cached. When information /* expires it is purged automatically. /* .IP endp_label /* The transport name and the physical endpoint name under /* which the session is stored and looked up. /* /* In the case of SMTP, the physical endpoint includes the numerical /* IP address, address family information, and the numerical TCP port. /* .IP endp_prop /* Application-specific data with endpoint attributes. It is up to /* the application to passivate (flatten) and re-activate this content /* upon storage and retrieval, respectively. /* .sp /* In the case of SMTP, the endpoint attributes specify the /* server hostname, IP address, numerical TCP port, as well /* as ESMTP features advertised by the server, and when information /* expires. All this in some application-specific format that is easy /* to unravel when re-activating a cached session. /* .IP dest_ttl /* How long the destination-to-endpoint binding should be /* cached. When information expires it is purged automatically. /* .IP dest_label /* The transport name and the logical destination under which the /* destination-to-endpoint binding is stored and looked up. /* /* In the case of SMTP, the logical destination is the DNS /* host or domain name with or without [], plus the numerical TCP port. /* .IP dest_prop /* Application-specific attributes that describe features of /* this logical to physical binding. It is up to the application /* to passivate (flatten) and re-activate this content. /* upon storage and retrieval, respectively /* .sp /* In case the of an SMTP logical destination to physical /* endpoint binding, the attributes specify the logical /* destination name, numerical port, whether the physical /* endpoint is best mx host with respect to a logical or /* fall-back destination, and when information expires. /* .IP fd /* File descriptor with session to be cached. /* DIAGNOSTICS /* scache_find_endp() and scache_find_dest() return -1 when /* the lookup fails, and a file descriptor upon success. /* /* Other diagnostics: fatal error: memory allocation problem; /* panic: internal consistency failure. /* SEE ALSO /* scache_single(3), single-session, in-memory cache /* scache_clnt(3), session cache client /* scache_multi(3), multi-session, in-memory cache /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.