jingle/register.h
changeset 63 b56853071a09
parent 61 c7879aae9e1d
child 64 63d4f434abbc
equal deleted inserted replaced
62:e7915504da33 63:b56853071a09
     5 
     5 
     6 
     6 
     7 #define NS_JINGLE_APP_PREFIX       "urn:xmpp:jingle:apps:"
     7 #define NS_JINGLE_APP_PREFIX       "urn:xmpp:jingle:apps:"
     8 #define NS_JINGLE_TRANSPORT_PREFIX "urn:xmpp:jingle:transports:"
     8 #define NS_JINGLE_TRANSPORT_PREFIX "urn:xmpp:jingle:transports:"
     9 
     9 
    10 typedef enum {
       
    11   JINGLE_TRANS_IN_BAND,
       
    12   JINGLE_TRANS_OUT_BAND,
       
    13 } JingleTransType;
       
    14 
    10 
    15 typedef enum {
    11 typedef enum {
    16   JINGLE_TRANS_TCP,
    12   /* A datagram transport has one or more components with which to exchange
    17   JINGLE_TRANS_UDP,
    13    * packets with UDP-like behavior. Packets might be of arbitrary length,
    18 } JingleTransMethod;
    14    * might be received out of order, and might not be received at all
       
    15    * (i.e., the transport is lossy). */
       
    16   JINGLE_TRANSPORT_STREAMING,
       
    17   
       
    18   /* A streaming transport has one or more components with which to exchange
       
    19    * bidirectional bytestreams with TCP-like behavior. Bytes are received
       
    20    * reliably and in order, and applications MUST NOT rely on a stream being
       
    21    * chunked in any specific way. */
       
    22   JINGLE_TRANSPORT_DATAGRAM
       
    23 } JingleTransportType;
       
    24 
       
    25 /**
       
    26  * We need to rank transports to determine which one to choose.
       
    27  * With this system, In-Band Bytestreams could have a low priority, SOCKS5
       
    28  * Bytestream a normal priority, and some stream transport method that allow
       
    29  * direct connection would have a high priority, since it would be the fastest.
       
    30  */
       
    31 typedef enum {
       
    32   JINGLE_TRANSPORT_LOW,
       
    33   JINGLE_TRANSPORT_NORMAL,
       
    34   JINGLE_TRANSPORT_HIGH
       
    35 } JingleTransportPriority;
    19 
    36 
    20 typedef gconstpointer (*JingleAppCheck) (JingleContent *cn, GError **err);
    37 typedef gconstpointer (*JingleAppCheck) (JingleContent *cn, GError **err);
    21 typedef void (*JingleAppHandle) (gconstpointer data, LmMessageNode *node);
    38 typedef void (*JingleAppHandle) (gconstpointer data, LmMessageNode *node);
    22 typedef gboolean (*JingleAppHandleData) (gconstpointer data, const gchar *data2, guint len);
    39 typedef gboolean (*JingleAppHandleData) (gconstpointer data, const gchar *data2, guint len);
    23 
    40 
    47   
    64   
    48 } JingleTransportFuncs;
    65 } JingleTransportFuncs;
    49 
    66 
    50 
    67 
    51 void jingle_register_app(const gchar *xmlns, JingleAppFuncs *funcs,
    68 void jingle_register_app(const gchar *xmlns, JingleAppFuncs *funcs,
    52                          JingleTransMethod method);
    69                          JingleTransportType type);
    53 void jingle_register_transport(const gchar *xmlns, JingleTransportFuncs *funcs,
    70 void jingle_register_transport(const gchar *xmlns,
    54                                JingleTransType type, JingleTransMethod method);
    71                                JingleTransportFuncs *funcs,
       
    72                                JingleTransportType type,
       
    73                                JingleTransportPriority prio);
    55 JingleAppFuncs *jingle_get_appfuncs(const gchar *xmlns);
    74 JingleAppFuncs *jingle_get_appfuncs(const gchar *xmlns);
    56 JingleTransportFuncs *jingle_get_transportfuncs(const gchar *xmlns);
    75 JingleTransportFuncs *jingle_get_transportfuncs(const gchar *xmlns);
    57 void jingle_unregister_app(const gchar *xmlns);
    76 void jingle_unregister_app(const gchar *xmlns);
    58 void jingle_unregister_transport(const gchar *xmlns);
    77 void jingle_unregister_transport(const gchar *xmlns);
    59 
    78