x400_mtapi.h
Go to the documentation of this file.
1 /* Copyright (c) 2003-2017, 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 /*
12  *
13  * @VERSION@
14  */
15 
16 #ifndef _X400_MTAPI_H
17 #define _X400_MTAPI_H
18 
19 #include "cdecl.h"
20 #include "x400_api.h"
21 
22 
23 
181 X400MT_CDECL const char *X400mtError (int error);
182 
183 struct X400mtSession;
184 
195 X400MT_CDECL int X400mtOpen (const char *credentials,
196  struct X400mtSession **spp);
197 
198 
199 
208 X400MT_CDECL int X400mtClose (struct X400mtSession *sp);
209 
223 X400MT_CDECL int X400mtSetIntDefault(struct X400mtSession *sp,
224  int paramtype,
225  int value);
226 
241 X400MT_CDECL int X400mtSetStrDefault(struct X400mtSession *sp,
242  int paramtype,
243  const char *value,
244  size_t length);
245 
246 struct X400mtMessage;
247 
261 X400MT_CDECL int X400mtMsgNew (struct X400mtSession *sp,
262  int type,
263  struct X400mtMessage **mpp);
264 
273 X400MT_CDECL int X400mtMsgCountRecip(struct X400mtMessage *mp, int type, int *cp);
274 
281 X400MT_CDECL int X400mtMsgSend (struct X400mtMessage *mp);
282 
292 X400MT_CDECL int X400mtMsgDelete (struct X400mtMessage *mp);
293 
303 X400MT_CDECL int X400mtMsgAddStrParam (struct X400mtMessage *mp,
304  int paramtype,
305  const char *value,
306  size_t length);
307 
316 X400MT_CDECL int X400mtMsgAddIntParam (struct X400mtMessage *mp,
317  int paramtype,
318  int value);
319 
320 
330 X400MT_CDECL int X400mtMsgAddAttachment (struct X400mtMessage *mp,
331  int type,
332  const char *string,
333  size_t length);
334 
335 
342 X400MT_CDECL int X400mtMsgAddBodypart (struct X400mtMessage *mp,
343  struct X400Bodypart *bp);
344 
348 X400MT_CDECL int X400mtMsgAddMessageBody (struct X400mtMessage *mp,
349  struct X400Message *mbp);
350 
364 X400MT_CDECL int X400mtMsgAddMessageBodyWType (struct X400mtMessage *mp,
365  struct X400Message *mbp,
366  int type);
367 
368 struct X400Recipient;
369 
400 X400MT_CDECL int X400mtRecipNew (struct X400mtMessage *mp,
401  int type,
402  struct X400Recipient **rpp);
403 
404 
414 X400MT_CDECL int X400mtRecipAddStrParam (struct X400Recipient *rp,
415  int paramtype,
416  const char *value,
417  size_t length);
418 
427 X400MT_CDECL int X400mtRecipAddIntParam (struct X400Recipient *rp,
428  int paramtype,
429  int value);
430 
431 
443 X400MT_CDECL int X400mtWait (struct X400mtSession *sp,
444  int seconds,
445  int *count);
446 
456 X400MT_CDECL int X400mtMsgGet (struct X400mtSession *sp,
457  struct X400mtMessage **mpp,
458  int *typep);
459 
474 X400MT_CDECL int X400mtMsgGetStart (struct X400mtSession *sp,
475  struct X400mtMessage **mpp,
476  int *typep);
477 
501 X400MT_CDECL int X400mtMsgGetFinish (struct X400mtMessage *mp,
502  int status,
503  int reason,
504  int diag,
505  const char *info);
506 
517 X400MT_CDECL int X400mtMsgGetStrParam (struct X400mtMessage *mp,
518  int paramtype,
519  char *buffer,
520  size_t buflen,
521  size_t *paramlenp);
522 
531 X400MT_CDECL int X400mtMsgGetIntParam (struct X400mtMessage *mp,
532  int paramtype,
533  int *valp);
534 
545 X400MT_CDECL int X400mtMsgGetCriticality(struct X400mtMessage *mp,
546  int attType,
547  int *critp);
548 
549 
564 X400MT_CDECL int X400mtMsgGetAttachment (struct X400mtMessage *mp,
565  int number,
566  int *typep,
567  char *buffer,
568  size_t buflen,
569  size_t *lengthp);
570 
571 
580 X400MT_CDECL int X400mtMsgGetBodypart (struct X400mtMessage *mp,
581  int number,
582  int *typep,
583  struct X400Bodypart **bpp);
584 
585 
594 X400MT_CDECL int X400mtMsgGetMessageBody (struct X400mtMessage *mp,
595  int number,
596  struct X400Message **mpp);
597 
609 X400MT_CDECL int X400mtRecipGet (struct X400mtMessage *mp,
610  int type,
611  int number,
612  struct X400Recipient **rpp);
613 
614 
625 X400MT_CDECL int X400mtRecipGetStrParam (struct X400Recipient *rp,
626  int paramtype,
627  char *buffer,
628  size_t buflen,
629  size_t *paramlenp);
630 
639 X400MT_CDECL int X400mtRecipGetIntParam (struct X400Recipient *rp,
640  int paramtype,
641  int *valp);
642 
652 X400MT_CDECL int X400mtGetRecipCriticality(struct X400Recipient *rp, int attType, int *critp);
653 
661 X400MT_CDECL int X400mtDLExpHistGet (struct X400mtMessage *mp,
662  int entry,
663  struct X400DLExpHist **hist);
664 
665 
666 struct X400DLExpHist;
667 
675 X400MT_CDECL int X400mtDLExpHistNew (
676  struct X400mtMessage *mp,
677  struct X400DLExpHist **histp
678 );
679 
680 
688 X400MT_CDECL struct X400DLExpHist *X400mtDLExpHistDeepCopy (struct X400mtMessage *mp,
689  struct X400DLExpHist *orig);
690 
699 X400MT_CDECL int X400mtTraceInfoGet (
700  struct X400mtMessage *mp,
701  int entry,
702  struct X400TraceInfo **info,
703  int type
704 );
705 struct X400TraceInfo;
706 
707 
715 X400MT_CDECL int X400mtTraceInfoNew(
716  struct X400mtMessage *mp,
717  struct X400TraceInfo **info,
718  int type
719 );
720 
729 X400MT_CDECL struct X400TraceInfo *X400mtTraceInfoDeepCopy (struct X400mtMessage *mp,
730  struct X400TraceInfo *orig,
731  int type);
732 
740 X400MT_CDECL int X400mtInternalTraceInfoGet (
741  struct X400mtMessage *mp,
742  int entry,
743  struct X400InternalTraceInfo **info
744 );
745 struct X400InternalTraceInfo;
746 
747 
754 X400MT_CDECL int X400mtInternalTraceInfoNew(
755  struct X400mtMessage *mp,
756  struct X400InternalTraceInfo **info
757 );
758 
766 X400MT_CDECL struct X400InternalTraceInfo *X400mtInternalTraceInfoDeepCopy (struct X400mtMessage *mp,
767  struct X400InternalTraceInfo *orig);
768 
769 struct X400ALI;
770 
771 
778 X400MT_CDECL int X400mtALINew(
779  struct X400mtMessage *mp,
780  struct X400ALI **ali
781 );
782 
790 X400MT_CDECL struct X400ALI *X400mtALIDeepCopy (struct X400mtMessage *mp,
791  struct X400ALI *orig);
792 
800 X400MT_CDECL int X400mtALIGet (
801  struct X400mtMessage *mp,
802  int entry,
803  struct X400ALI **ali
804 );
805 
806 
807 struct X400PSS;
808 
809 
817 X400MT_CDECL int X400mtPSSNew(
818  struct X400mtMessage *mp,
819  int type,
820  struct X400PSS **pss
821 );
822 
831 X400MT_CDECL struct X400PSS *X400mtPSSDeepCopy (struct X400mtMessage *mp,
832  struct X400PSS *orig,
833  int type);
834 
835 
844 X400MT_CDECL int X400mtPSSGet (
845  struct X400mtMessage *mp,
846  int type,
847  int entry,
848  struct X400PSS **pss
849 );
850 
851 struct X400DistField;
852 
853 
860 X400MT_CDECL int X400mtDistFieldNew(
861  struct X400mtMessage *mp,
862  struct X400DistField **distfield
863 );
864 
872 X400MT_CDECL struct X400DistField *X400mtDistFieldDeepCopy (struct X400mtMessage *mp,
873  struct X400DistField *orig);
874 
882 X400MT_CDECL int X400mtDistFieldGet (
883  struct X400mtMessage *mp,
884  int entry,
885  struct X400DistField **distfield
886 );
887 
888 
889 struct X400OtherRecip;
890 
891 
898 X400MT_CDECL int X400mtOtherRecipNew(
899  struct X400mtMessage *mp,
900  struct X400OtherRecip **otherrecip
901 );
902 
910 X400MT_CDECL struct X400OtherRecip *X400mtOtherRecipDeepCopy (struct X400mtMessage *mp,
911  struct X400OtherRecip *orig);
912 
920 X400MT_CDECL int X400mtOtherRecipGet (
921  struct X400mtMessage *mp,
922  int entry,
923  struct X400OtherRecip **otherrecip
924 );
925 
926 
927 
935 X400MT_CDECL int X400mtRediHistGetEnv(struct X400mtMessage *msg,
936  int entry,
937  struct X400RediHist **hist);
938 
945 X400MT_CDECL int X400mtRediHistNewEnv(
946  struct X400mtMessage *msg,
947  struct X400RediHist **hist
948 );
949 
957 X400MT_CDECL struct X400RediHist *X400mtRediHistDeepCopyEnv(struct X400mtMessage *mp,
958  struct X400RediHist *orig);
959 
966 X400MT_CDECL int X400mtORandDLNew(
967  struct X400mtMessage *msg,
968  struct X400ORandDL **or_and_dl
969 );
970 
978 X400MT_CDECL struct X400ORandDL *X400mtORandDLDeepCopy (struct X400mtMessage *mp,
979  struct X400ORandDL *orig);
980 
988 X400MT_CDECL int X400mtORandDLGet(struct X400mtMessage *msg,
989  int entry,
990  struct X400ORandDL **or_and_dl);
991 
992 struct X400ORandDL;
995 /* Here we add the API versioning into the API, so that it is hidden
996  * from the client
997  */
999 #define X400mtOpen(p1, p2) X400mtOpenVer(p1, p2, X400_API_VERSN)
1000 
1008 X400MT_CDECL int X400mtOpenVer (const char *credentials,
1009  struct X400mtSession **spp, int version);
1010 
1011 
1028 X400MT_CDECL int X400mtMarkToFault(struct X400mtSession *sp, int attType, int fault);
1029 
1030 
1031 
1043 X400MT_CDECL int X400mtGetContentOctets(struct X400mtMessage *mp,
1044  char *buf,
1045  size_t buflen,
1046  size_t *lenp);
1047 
1048 
1059 X400MT_CDECL int X400mtSetContentOctets(struct X400mtMessage *mp,
1060  char *buf, size_t len);
1061 
1062 
1073 X400MT_CDECL int X400ReadArchive(char *filepath, struct X400Message **mpp);
1074 
1075 
1082 X400MT_CDECL int X400mtACP127RespGet (struct X400mtMessage *mp, struct X400ACP127Resp **respp);
1083 
1090 X400MT_CDECL int X400mtACP127RespNew(struct X400mtMessage *mp, struct X400ACP127Resp **respp);
1091 
1098 X400MT_CDECL struct X400ACP127Resp *X400mtACP127RespDeepCopy(struct X400mtMessage *mp,
1099  struct X400ACP127Resp *orig);
1100 
1101 #endif /* _X400_MTAPI_H */
struct X400ALI * X400mtALIDeepCopy(struct X400mtMessage *mp, struct X400ALI *orig)
Copy an AddressListIndicator object, and associate it with the a message.
int X400mtGetContentOctets(struct X400mtMessage *mp, char *buf, size_t buflen, size_t *lenp)
Obtains the bytes containing the ASN.1 encoding of the Content of a message. The Content is obtained ...
int X400mtGetRecipCriticality(struct X400Recipient *rp, int attType, int *critp)
Return the criticality associated with an extension attribute from a recipient Sets a *critp as a bit...
int X400mtMsgAddAttachment(struct X400mtMessage *mp, int type, const char *string, size_t length)
Add an attachment to the message.
X400 Object Interface.
int X400mtACP127RespNew(struct X400mtMessage *mp, struct X400ACP127Resp **respp)
Create an ACP127 Notification Response object.
int X400mtSetStrDefault(struct X400mtSession *sp, int paramtype, const char *value, size_t length)
Set a default string parameter value in a session.
int X400mtMsgDelete(struct X400mtMessage *mp)
Delete message object.
int X400mtMsgGet(struct X400mtSession *sp, struct X400mtMessage **mpp, int *typep)
Transfer message object out from MTA completely.
int X400mtInternalTraceInfoGet(struct X400mtMessage *mp, int entry, struct X400InternalTraceInfo **info)
Get an Internal Trace Info object for a message object.
int X400ReadArchive(char *filepath, struct X400Message **mpp)
Takes the path to a file containing the archived envelope of an X.400 message (i.e....
int X400mtMsgGetCriticality(struct X400mtMessage *mp, int attType, int *critp)
Get the criticality value for a parameter which comes from an extension field within a message's enve...
int X400mtClose(struct X400mtSession *sp)
Close a X400 Session.
struct X400ORandDL * X400mtORandDLDeepCopy(struct X400mtMessage *mp, struct X400ORandDL *orig)
Copy an Originator and DL Expansion History object, and associate it with the a message.
int X400mtDistFieldGet(struct X400mtMessage *mp, int entry, struct X400DistField **distfield)
Get a new P772 Distribution Field object for a message object.
int X400mtMsgGetStart(struct X400mtSession *sp, struct X400mtMessage **mpp, int *typep)
Get message object for transfer out from MTA.
struct X400TraceInfo * X400mtTraceInfoDeepCopy(struct X400mtMessage *mp, struct X400TraceInfo *orig, int type)
Copy a TraceInformation object, and associate it with the a message.
int X400mtMsgGetFinish(struct X400mtMessage *mp, int status, int reason, int diag, const char *info)
Finish transfer-out of message from MTA, generate DR if required.
int X400mtOtherRecipGet(struct X400mtMessage *mp, int entry, struct X400OtherRecip **otherrecip)
Get a new P772 Other Recipient object for a message object.
int X400mtMsgGetMessageBody(struct X400mtMessage *mp, int number, struct X400Message **mpp)
Return a pointer to a body part object.
int X400mtMsgGetBodypart(struct X400mtMessage *mp, int number, int *typep, struct X400Bodypart **bpp)
Return a pointer to a body part object.
int X400mtRediHistNewEnv(struct X400mtMessage *msg, struct X400RediHist **hist)
Create a new Redirection History object for a message envelope this is represented by 8....
int X400mtRecipAddStrParam(struct X400Recipient *rp, int paramtype, const char *value, size_t length)
Add string-valued parameter to the message.
int X400mtRecipGet(struct X400mtMessage *mp, int type, int number, struct X400Recipient **rpp)
Get recipient object from message.
struct X400OtherRecip * X400mtOtherRecipDeepCopy(struct X400mtMessage *mp, struct X400OtherRecip *orig)
Copy a P772 Other Recipient object, and associate it with the a message.
struct X400RediHist * X400mtRediHistDeepCopyEnv(struct X400mtMessage *mp, struct X400RediHist *orig)
Copy a Redirection History object, and associate it with the a message.
int X400mtMarkToFault(struct X400mtSession *sp, int attType, int fault)
Control how extension attributes in Envelopes and Envelope Recipient addresses are handled....
int X400mtMsgGetIntParam(struct X400mtMessage *mp, int paramtype, int *valp)
Return a integer-valued parameter from the message object.
const char * X400mtError(int error)
Return string for error code.
int X400mtMsgAddMessageBodyWType(struct X400mtMessage *mp, struct X400Message *mbp, int type)
Add a message body part object to a message.
int X400mtRecipNew(struct X400mtMessage *mp, int type, struct X400Recipient **rpp)
Add new recipient to a message.
struct X400DistField * X400mtDistFieldDeepCopy(struct X400mtMessage *mp, struct X400DistField *orig)
Copy a P772 DistributionField object, and associate it with the a message.
struct X400InternalTraceInfo * X400mtInternalTraceInfoDeepCopy(struct X400mtMessage *mp, struct X400InternalTraceInfo *orig)
Copy an InternalTraceInformation object, and associate it with the a message.
int X400mtRecipGetIntParam(struct X400Recipient *rp, int paramtype, int *valp)
Return a integer-valued parameter from the recipient object.
#define X400mtOpen(p1, p2)
Definition: x400_mtapi.h:999
int X400mtSetContentOctets(struct X400mtMessage *mp, char *buf, size_t len)
Takes a byte stream containing the ASN.1 encoding of a P22 (or P772) content, decodes it and sets it ...
int X400mtRediHistGetEnv(struct X400mtMessage *msg, int entry, struct X400RediHist **hist)
Get the Redirection History object from a message envelope this is represented by 8....
int X400mtDLExpHistGet(struct X400mtMessage *mp, int entry, struct X400DLExpHist **hist)
Create a new DL Expansion History object from the message object.
struct X400ACP127Resp * X400mtACP127RespDeepCopy(struct X400mtMessage *mp, struct X400ACP127Resp *orig)
Copy an ACP127 Notification Response object.
int X400mtMsgCountRecip(struct X400mtMessage *mp, int type, int *cp)
Returns count of addresses of given type in message object.
int X400mtWait(struct X400mtSession *sp, int seconds, int *count)
Wait for messages to be transferred out.
int X400mtMsgAddStrParam(struct X400mtMessage *mp, int paramtype, const char *value, size_t length)
Add string-valued parameter to the message.
int X400mtMsgGetStrParam(struct X400mtMessage *mp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the message object.
int X400mtMsgAddIntParam(struct X400mtMessage *mp, int paramtype, int value)
Add integer-valued parameter to the message.
int X400mtPSSGet(struct X400mtMessage *mp, int type, int entry, struct X400PSS **pss)
Get a new Printable String Syntax object for a message object.
int X400mtRecipAddIntParam(struct X400Recipient *rp, int paramtype, int value)
Add integer-valued parameter to the message.
int X400mtDistFieldNew(struct X400mtMessage *mp, struct X400DistField **distfield)
Create a new P772 Distribution Field object for a message object.
int X400mtMsgNew(struct X400mtSession *sp, int type, struct X400mtMessage **mpp)
Creates new message.
int X400mtInternalTraceInfoNew(struct X400mtMessage *mp, struct X400InternalTraceInfo **info)
Create a new Internal Trace Info object for a message object.
int X400mtMsgSend(struct X400mtMessage *mp)
Send message object to MTA.
int X400mtTraceInfoGet(struct X400mtMessage *mp, int entry, struct X400TraceInfo **info, int type)
Get a Trace Info object for a message object.
struct X400DLExpHist * X400mtDLExpHistDeepCopy(struct X400mtMessage *mp, struct X400DLExpHist *orig)
Copy a new DL Expansion History object, and associate it with the a message.
int X400mtALIGet(struct X400mtMessage *mp, int entry, struct X400ALI **ali)
Get a new Address List Indicator object for a message object.
int X400mtOtherRecipNew(struct X400mtMessage *mp, struct X400OtherRecip **otherrecip)
Create a new P772 Other Recipient object for a message object.
struct X400PSS * X400mtPSSDeepCopy(struct X400mtMessage *mp, struct X400PSS *orig, int type)
Copy a PrintableStringSequence object, and associate it with the a message.
int X400mtORandDLGet(struct X400mtMessage *msg, int entry, struct X400ORandDL **or_and_dl)
Get Originator and DL expansion history object.
int X400mtOpenVer(const char *credentials, struct X400mtSession **spp, int version)
Open X400 MT session.
int X400mtRecipGetStrParam(struct X400Recipient *rp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the recipient object.
int X400mtPSSNew(struct X400mtMessage *mp, int type, struct X400PSS **pss)
Create a new Printable String Syntax object for a message object.
int X400mtALINew(struct X400mtMessage *mp, struct X400ALI **ali)
Create a new Address List Indicator object for a message object.
int X400mtSetIntDefault(struct X400mtSession *sp, int paramtype, int value)
Set a default integer parameter value in a session.
int X400mtORandDLNew(struct X400mtMessage *msg, struct X400ORandDL **or_and_dl)
Create new Originator and DL expansion history object.
int X400mtMsgAddMessageBody(struct X400mtMessage *mp, struct X400Message *mbp)
int X400mtACP127RespGet(struct X400mtMessage *mp, struct X400ACP127Resp **respp)
Get the ACP127 Notification Response object from a message.
int X400mtTraceInfoNew(struct X400mtMessage *mp, struct X400TraceInfo **info, int type)
Create a new Trace Info object for a message object.
int X400mtMsgAddBodypart(struct X400mtMessage *mp, struct X400Bodypart *bp)
Add a body part object to a message.
int X400mtDLExpHistNew(struct X400mtMessage *mp, struct X400DLExpHist **histp)
Create a new DL Expansion History object, and associate it with the existing message.
int X400mtMsgGetAttachment(struct X400mtMessage *mp, int number, int *typep, char *buffer, size_t buflen, size_t *lengthp)
Return the data of an attachment (=bodypart) from the message object.

All rights reserved © 2002 - 2024 Isode Ltd.