diff options
author | defanor <defanor@uberspace.net> | 2021-10-01 17:01:28 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2021-10-01 17:03:18 +0300 |
commit | 5a1db57c9a4e3a597400f4d49432fa63cbfaefd7 (patch) | |
tree | 1c1d7068ea4fb8c803c45cc08c5af5216e7c7425 /src/rexmpp_jingle.h | |
parent | c094b0163ab18f9bd40d4b0e76ab3ca26372d9e4 (diff) |
Add Jingle file transfer over IBB
Diffstat (limited to 'src/rexmpp_jingle.h')
-rw-r--r-- | src/rexmpp_jingle.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/rexmpp_jingle.h b/src/rexmpp_jingle.h new file mode 100644 index 0000000..c8a2822 --- /dev/null +++ b/src/rexmpp_jingle.h @@ -0,0 +1,55 @@ +/** + @file rexmpp_jingle.h + @brief Jingle routines + @author defanor <defanor@uberspace.net> + @date 2021 + @copyright MIT license. + +*/ + + +#ifndef REXMPP_JINGLE_H +#define REXMPP_JINGLE_H + +#include "rexmpp.h" + +/** @brief Processes incoming Jingle IQs. */ +int rexmpp_jingle_iq (rexmpp_t *s, xmlNodePtr elem); + +/** @brief Destroys Jingle sessions. */ +void rexmpp_jingle_stop (rexmpp_t *s); + +/** @brief Accepts a file, given a sid and a path to save it to. */ +rexmpp_err_t +rexmpp_jingle_accept_file_by_id (rexmpp_t *s, + const char *sid, + const char *path); + +/** @brief Sends a file to a given full JID. */ +rexmpp_err_t +rexmpp_jingle_send_file (rexmpp_t *s, + const char *jid, + char *path); + +/** @brief Terminates a Jingle session. */ +rexmpp_err_t +rexmpp_jingle_session_terminate (rexmpp_t *s, + const char *sid, + xmlNodePtr reason_node, + const char *reason_text); + +typedef struct rexmpp_jingle_session rexmpp_jingle_session_t; + +struct rexmpp_jingle_session { + char *jid; + char *sid; + char *ibb_sid; + uint16_t ibb_seq; + /* The most recent <jingle/> elmment in negotiation. */ + xmlNodePtr negotiation; + FILE *f; + rexmpp_jingle_session_t *next; +}; + + +#endif |