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 
549 X400MT_CDECL int X400mtMsgGetAttachment (struct X400mtMessage *mp,
550  int number,
551  int *typep,
552  char *buffer,
553  size_t buflen,
554  size_t *lengthp);
555 
556 
565 X400MT_CDECL int X400mtMsgGetBodypart (struct X400mtMessage *mp,
566  int number,
567  int *typep,
568  struct X400Bodypart **bpp);
569 
570 
579 X400MT_CDECL int X400mtMsgGetMessageBody (struct X400mtMessage *mp,
580  int number,
581  struct X400Message **mpp);
582 
594 X400MT_CDECL int X400mtRecipGet (struct X400mtMessage *mp,
595  int type,
596  int number,
597  struct X400Recipient **rpp);
598 
599 
610 X400MT_CDECL int X400mtRecipGetStrParam (struct X400Recipient *rp,
611  int paramtype,
612  char *buffer,
613  size_t buflen,
614  size_t *paramlenp);
615 
624 X400MT_CDECL int X400mtRecipGetIntParam (struct X400Recipient *rp,
625  int paramtype,
626  int *valp);
627 
635 X400MT_CDECL int X400mtDLExpHistGet (struct X400mtMessage *mp,
636  int entry,
637  struct X400DLExpHist **hist);
638 
639 
640 struct X400DLExpHist;
641 
649 X400MT_CDECL int X400mtDLExpHistNew (
650  struct X400mtMessage *mp,
651  struct X400DLExpHist **histp
652 );
653 
654 
662 X400MT_CDECL struct X400DLExpHist *X400mtDLExpHistDeepCopy (struct X400mtMessage *mp,
663  struct X400DLExpHist *orig);
664 
673 X400MT_CDECL int X400mtTraceInfoGet (
674  struct X400mtMessage *mp,
675  int entry,
676  struct X400TraceInfo **info,
677  int type
678 );
679 struct X400TraceInfo;
680 
681 
689 X400MT_CDECL int X400mtTraceInfoNew(
690  struct X400mtMessage *mp,
691  struct X400TraceInfo **info,
692  int type
693 );
694 
703 X400MT_CDECL struct X400TraceInfo *X400mtTraceInfoDeepCopy (struct X400mtMessage *mp,
704  struct X400TraceInfo *orig,
705  int type);
706 
714 X400MT_CDECL int X400mtInternalTraceInfoGet (
715  struct X400mtMessage *mp,
716  int entry,
717  struct X400InternalTraceInfo **info
718 );
719 struct X400InternalTraceInfo;
720 
721 
728 X400MT_CDECL int X400mtInternalTraceInfoNew(
729  struct X400mtMessage *mp,
730  struct X400InternalTraceInfo **info
731 );
732 
740 X400MT_CDECL struct X400InternalTraceInfo *X400mtInternalTraceInfoDeepCopy (struct X400mtMessage *mp,
741  struct X400InternalTraceInfo *orig);
742 
743 struct X400ALI;
744 
745 
752 X400MT_CDECL int X400mtALINew(
753  struct X400mtMessage *mp,
754  struct X400ALI **ali
755 );
756 
764 X400MT_CDECL struct X400ALI *X400mtALIDeepCopy (struct X400mtMessage *mp,
765  struct X400ALI *orig);
766 
774 X400MT_CDECL int X400mtALIGet (
775  struct X400mtMessage *mp,
776  int entry,
777  struct X400ALI **ali
778 );
779 
780 
781 struct X400PSS;
782 
783 
791 X400MT_CDECL int X400mtPSSNew(
792  struct X400mtMessage *mp,
793  int type,
794  struct X400PSS **pss
795 );
796 
805 X400MT_CDECL struct X400PSS *X400mtPSSDeepCopy (struct X400mtMessage *mp,
806  struct X400PSS *orig,
807  int type);
808 
809 
818 X400MT_CDECL int X400mtPSSGet (
819  struct X400mtMessage *mp,
820  int type,
821  int entry,
822  struct X400PSS **pss
823 );
824 
825 struct X400DistField;
826 
827 
834 X400MT_CDECL int X400mtDistFieldNew(
835  struct X400mtMessage *mp,
836  struct X400DistField **distfield
837 );
838 
846 X400MT_CDECL struct X400DistField *X400mtDistFieldDeepCopy (struct X400mtMessage *mp,
847  struct X400DistField *orig);
848 
856 X400MT_CDECL int X400mtDistFieldGet (
857  struct X400mtMessage *mp,
858  int entry,
859  struct X400DistField **distfield
860 );
861 
862 
863 struct X400OtherRecip;
864 
865 
872 X400MT_CDECL int X400mtOtherRecipNew(
873  struct X400mtMessage *mp,
874  struct X400OtherRecip **otherrecip
875 );
876 
884 X400MT_CDECL struct X400OtherRecip *X400mtOtherRecipDeepCopy (struct X400mtMessage *mp,
885  struct X400OtherRecip *orig);
886 
894 X400MT_CDECL int X400mtOtherRecipGet (
895  struct X400mtMessage *mp,
896  int entry,
897  struct X400OtherRecip **otherrecip
898 );
899 
900 
901 
909 X400MT_CDECL int X400mtRediHistGetEnv(struct X400mtMessage *msg,
910  int entry,
911  struct X400RediHist **hist);
912 
919 X400MT_CDECL int X400mtRediHistNewEnv(
920  struct X400mtMessage *msg,
921  struct X400RediHist **hist
922 );
923 
931 X400MT_CDECL struct X400RediHist *X400mtRediHistDeepCopyEnv(struct X400mtMessage *mp,
932  struct X400RediHist *orig);
933 
940 X400MT_CDECL int X400mtORandDLNew(
941  struct X400mtMessage *msg,
942  struct X400ORandDL **or_and_dl
943 );
944 
952 X400MT_CDECL struct X400ORandDL *X400mtORandDLDeepCopy (struct X400mtMessage *mp,
953  struct X400ORandDL *orig);
954 
962 X400MT_CDECL int X400mtORandDLGet(struct X400mtMessage *msg,
963  int entry,
964  struct X400ORandDL **or_and_dl);
965 
966 struct X400ORandDL;
969 /* Here we add the API versioning into the API, so that it is hidden
970  * from the client
971  */
973 #define X400mtOpen(p1, p2) X400mtOpenVer(p1, p2, X400_API_VERSN)
974 
982 X400MT_CDECL int X400mtOpenVer (const char *credentials,
983  struct X400mtSession **spp, int version);
984 
985 
1002 X400MT_CDECL int X400mtMarkToFault(struct X400mtSession *sp, int attType, int fault);
1003 
1004 
1005 
1017 X400MT_CDECL int X400mtGetContentOctets(struct X400mtMessage *mp,
1018  char *buf,
1019  size_t buflen,
1020  size_t *lenp);
1021 
1022 
1033 X400MT_CDECL int X400mtSetContentOctets(struct X400mtMessage *mp,
1034  char *buf, size_t len);
1035 
1036 
1047 X400MT_CDECL int X400ReadArchive(char *filepath, struct X400Message **mpp);
1048 
1049 
1056 X400MT_CDECL int X400mtACP127RespGet (struct X400mtMessage *mp, struct X400ACP127Resp **respp);
1057 
1064 X400MT_CDECL int X400mtACP127RespNew(struct X400mtMessage *mp, struct X400ACP127Resp **respp);
1065 
1072 X400MT_CDECL struct X400ACP127Resp *X400mtACP127RespDeepCopy(struct X400mtMessage *mp,
1073  struct X400ACP127Resp *orig);
1074 
1075 #endif /* _X400_MTAPI_H */
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 X400mtMsgCountRecip(struct X400mtMessage *mp, int type, int *cp)
Returns count of addresses of given type in message 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 X400mtDLExpHistNew(struct X400mtMessage *mp, struct X400DLExpHist **histp)
Create a new DL Expansion History object, and associate it with the existing message.
int X400mtMsgGet(struct X400mtSession *sp, struct X400mtMessage **mpp, int *typep)
Transfer message object out from MTA completely.
int X400mtOpenVer(const char *credentials, struct X400mtSession **spp, int version)
Open X400 MT session.
int X400mtSetIntDefault(struct X400mtSession *sp, int paramtype, int value)
Set a default integer parameter value in a session.
struct X400ALI * X400mtALIDeepCopy(struct X400mtMessage *mp, struct X400ALI *orig)
Copy an AddressListIndicator object, and associate it with the a message.
struct X400TraceInfo * X400mtTraceInfoDeepCopy(struct X400mtMessage *mp, struct X400TraceInfo *orig, int type)
Copy a TraceInformation object, and associate it with the a message.
int X400mtOtherRecipNew(struct X400mtMessage *mp, struct X400OtherRecip **otherrecip)
Create a new P772 Other Recipient object for a message object.
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 X400mtOtherRecipGet(struct X400mtMessage *mp, int entry, struct X400OtherRecip **otherrecip)
Get a new P772 Other Recipient object for a message object.
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.
int X400mtMsgGetBodypart(struct X400mtMessage *mp, int number, int *typep, struct X400Bodypart **bpp)
Return a pointer to a body part object.
int X400mtMsgNew(struct X400mtSession *sp, int type, struct X400mtMessage **mpp)
Creates new message.
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 ...
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.
int X400mtMsgGetStart(struct X400mtSession *sp, struct X400mtMessage **mpp, int *typep)
Get message object for transfer out from MTA.
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 X400mtWait(struct X400mtSession *sp, int seconds, int *count)
Wait for messages to be transferred out.
struct X400RediHist * X400mtRediHistDeepCopyEnv(struct X400mtMessage *mp, struct X400RediHist *orig)
Copy a Redirection History object, and associate it with the a message.
#define X400mtOpen(p1, p2)
Definition: x400_mtapi.h:973
int X400mtMsgGetIntParam(struct X400mtMessage *mp, int paramtype, int *valp)
Return a integer-valued parameter from the message object.
int X400mtMsgGetStrParam(struct X400mtMessage *mp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the 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 X400mtPSSGet(struct X400mtMessage *mp, int type, int entry, struct X400PSS **pss)
Get a new Printable String Syntax object for a message object.
int X400mtRecipNew(struct X400mtMessage *mp, int type, struct X400Recipient **rpp)
Add new recipient to a message.
int X400mtSetStrDefault(struct X400mtSession *sp, int paramtype, const char *value, size_t length)
Set a default string parameter value in a session.
int X400mtMsgGetMessageBody(struct X400mtMessage *mp, int number, struct X400Message **mpp)
Return a pointer to a body part object.
struct X400DistField * X400mtDistFieldDeepCopy(struct X400mtMessage *mp, struct X400DistField *orig)
Copy a P772 DistributionField object, and associate it with the a message.
int X400mtRediHistNewEnv(struct X400mtMessage *msg, struct X400RediHist **hist)
Create a new Redirection History object for a message envelope this is represented by 8...
int X400mtMsgAddIntParam(struct X400mtMessage *mp, int paramtype, int value)
Add integer-valued parameter to the message.
int X400mtRecipAddStrParam(struct X400Recipient *rp, int paramtype, const char *value, size_t length)
Add string-valued parameter to the message.
int X400mtRecipAddIntParam(struct X400Recipient *rp, int paramtype, int value)
Add integer-valued parameter to the message.
int X400mtMsgAddAttachment(struct X400mtMessage *mp, int type, const char *string, size_t length)
Add an attachment to the message.
int X400mtDistFieldGet(struct X400mtMessage *mp, int entry, struct X400DistField **distfield)
Get a new P772 Distribution Field 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. .xar file) and returns an X.400 Message object containing the contents of the envelope an accompanying content if necessary.
const char * X400mtError(int error)
Return string for error code.
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.
int X400mtALIGet(struct X400mtMessage *mp, int entry, struct X400ALI **ali)
Get a new Address List Indicator object for a message object.
int X400mtInternalTraceInfoGet(struct X400mtMessage *mp, int entry, struct X400InternalTraceInfo **info)
Get an Internal Trace Info object for a message object.
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 X400mtPSSNew(struct X400mtMessage *mp, int type, struct X400PSS **pss)
Create a new Printable String Syntax object for a message object.
int X400mtMarkToFault(struct X400mtSession *sp, int attType, int fault)
Control how extension attributes in Envelopes and Envelope Recipient addresses are handled...
int X400mtORandDLNew(struct X400mtMessage *msg, struct X400ORandDL **or_and_dl)
Create new Originator and DL expansion history object.
int X400mtDistFieldNew(struct X400mtMessage *mp, struct X400DistField **distfield)
Create a new P772 Distribution Field object for a message object.
struct X400ACP127Resp * X400mtACP127RespDeepCopy(struct X400mtMessage *mp, struct X400ACP127Resp *orig)
Copy an ACP127 Notification Response object.
int X400mtMsgAddStrParam(struct X400mtMessage *mp, int paramtype, const char *value, size_t length)
Add string-valued parameter to the message.
struct X400DLExpHist * X400mtDLExpHistDeepCopy(struct X400mtMessage *mp, struct X400DLExpHist *orig)
Copy a new DL Expansion History object, and associate it with the a message.
int X400mtClose(struct X400mtSession *sp)
Close a X400 Session.
X400 Object Interface.
struct X400OtherRecip * X400mtOtherRecipDeepCopy(struct X400mtMessage *mp, struct X400OtherRecip *orig)
Copy a P772 Other Recipient object, and associate it with the 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 X400mtORandDLGet(struct X400mtMessage *msg, int entry, struct X400ORandDL **or_and_dl)
Get Originator and DL expansion history object.
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 X400mtRecipGet(struct X400mtMessage *mp, int type, int number, struct X400Recipient **rpp)
Get recipient object from message.
int X400mtMsgAddMessageBodyWType(struct X400mtMessage *mp, struct X400Message *mbp, int type)
Add a message body part object to a message.
int X400mtALINew(struct X400mtMessage *mp, struct X400ALI **ali)
Create a new Address List Indicator object for a message object.
int X400mtInternalTraceInfoNew(struct X400mtMessage *mp, struct X400InternalTraceInfo **info)
Create a new Internal Trace Info object for a message object.
int X400mtDLExpHistGet(struct X400mtMessage *mp, int entry, struct X400DLExpHist **hist)
Create a new DL Expansion History object from the message object.
int X400mtMsgDelete(struct X400mtMessage *mp)
Delete message object.
int X400mtACP127RespNew(struct X400mtMessage *mp, struct X400ACP127Resp **respp)
Create an ACP127 Notification Response object.