session.h
Go to the documentation of this file.
1/* Copyright (c) 2004-2009, Isode Limited, London, England.
2 * All rights reserved.
3 *
4 * Acquisition and use of this software and related materials for any
5 * purpose requires a written licence agreement from Isode Limited,
6 * or a written licence from an organisation licenced by Isode Limited
7 * to grant such a licence.
8 *
9 */
10
11#ifndef _SOM_SESSION_H
12#define _SOM_SESSION_H
13
14/* stdlib.h is included to ensure the declaration of size_t */
15#include <stdlib.h>
16
17#include "cdecl.h"
18#include "errors.h"
19
20#define SOM_LIBRARY_VERSION 100
38struct SOMSession;
39
56typedef void SOMSessionCallback (struct SOMSession *session,
57 void *ophandle,
58 void *clientdata,
59 int status,
60 const char *opdata,
61 size_t opdatalen);
62
69SOMAPI_CDECL const char *SOMError (int error);
70
76SOMAPI_CDECL void SOMSetService(struct SOMSession *session,
77 const char *service);
78
84SOMAPI_CDECL int SOMSessionAuthenticated(struct SOMSession *session);
85
97SOMAPI_CDECL int SOMInit (int version);
98
114/* Create a Session object which can be used in a multithreaded,
115 * single-SOM-session-per-thread, synchronous, manner */
116#define SOM_FACILITY_MULTITHREADED (32)
117
118SOMAPI_CDECL int SOMSessionCreate (int facilities,
119 void *clientdata,
120 struct SOMSession **session);
121
137SOMAPI_CDECL int SOMEventPoll (int dispatch, int timeout);
138
154SOMAPI_CDECL int SOMEventPollSingle (struct SOMSession *sp, int dispatch, int timeout);
155
178SOMAPI_CDECL int SOMSessionSetTLS (struct SOMSession *session,
179 const char *identity,
180 const char *passphrase);
181
193SOMAPI_CDECL int SOMSessionSetSessionCallback (struct SOMSession *session,
194 SOMSessionCallback *callback,
195 SOMSessionCallback **oldvalue);
196
220SOMAPI_CDECL int SOMSessionOpen (struct SOMSession *session,
221 const char *host,
222 int port,
223 const char *username,
224 const char *password,
225 void *ophandle,
226 int async);
227
253SOMAPI_CDECL int SOMSessionOpenRole (struct SOMSession *session,
254 const char *host,
255 int port,
256 const char *username,
257 const char *password,
258 const char *role,
259 void *ophandle,
260 int async);
261
262
289SOMAPI_CDECL int SOMSessionOpenMech (struct SOMSession *session,
290 const char *host,
291 int port,
292 const char *username,
293 const char *passwd,
294 void *ophandle,
295 int async,
296 const char *mech);
297
298
327SOMAPI_CDECL int SOMSessionOpenMechRole (struct SOMSession *session,
328 const char *host,
329 int port,
330 const char *username,
331 const char *passwd,
332 const char *role,
333 void *ophandle,
334 int async,
335 const char *mech);
336
345SOMAPI_CDECL int SOMSessionClose (struct SOMSession *sp);
346
347
359SOMAPI_CDECL int SOMSessionDelete (struct SOMSession *session);
360
361
362
374SOMAPI_CDECL int SOMSessionClear (struct SOMSession *session,
375 int facilities);
376
377/* \} */
378
379#endif /* _SOM_SESSION_H */
Switch Operation Management Interface.
int SOMEventPollSingle(struct SOMSession *sp, int dispatch, int timeout)
Poll for asynchronous events on a single Session.
int SOMSessionAuthenticated(struct SOMSession *session)
Return TRUE if session authenticated, FALSE otherwise.
const char * SOMError(int error)
Return string for error code.
void SOMSessionCallback(struct SOMSession *session, void *ophandle, void *clientdata, int status, const char *opdata, size_t opdatalen)
Prototype for callback for session operation completion.
Definition session.h:56
int SOMSessionSetTLS(struct SOMSession *session, const char *identity, const char *passphrase)
Enable use of TLS/SSL for the session.
int SOMInit(int version)
Return string for error code.
int SOMSessionOpenMechRole(struct SOMSession *session, const char *host, int port, const char *username, const char *passwd, const char *role, void *ophandle, int async, const char *mech)
Open a session to the MTA, specifying the SASL mechanism to be used.
int SOMSessionOpenMech(struct SOMSession *session, const char *host, int port, const char *username, const char *passwd, void *ophandle, int async, const char *mech)
Open a session to the MTA, specifying the SASL mechanism to be used.
int SOMSessionOpenRole(struct SOMSession *session, const char *host, int port, const char *username, const char *password, const char *role, void *ophandle, int async)
Open a session to the MTA.
int SOMEventPoll(int dispatch, int timeout)
Poll for asynchronous events on all open sessions.
int SOMSessionDelete(struct SOMSession *session)
Delete a session.
int SOMSessionOpen(struct SOMSession *session, const char *host, int port, const char *username, const char *password, void *ophandle, int async)
Open a session to the MTA.
int SOMSessionSetSessionCallback(struct SOMSession *session, SOMSessionCallback *callback, SOMSessionCallback **oldvalue)
Set the session callback function for this session.
int SOMSessionClear(struct SOMSession *session, int facilities)
Clear all subordinate objects.
void SOMSetService(struct SOMSession *session, const char *service)
Set the service name - defaults to "som".
int SOMSessionClose(struct SOMSession *sp)
Close a X400 Session.
Opaque session data.

All rights reserved © 2002 - 2024 Isode Ltd.