[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r19446 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r19446 - gnunet/src/transport |
Date: |
Thu, 26 Jan 2012 16:46:01 +0100 |
Author: wachs
Date: 2012-01-26 16:46:01 +0100 (Thu, 26 Jan 2012)
New Revision: 19446
Modified:
gnunet/src/transport/plugin_transport_wlan.c
Log:
- changes
Modified: gnunet/src/transport/plugin_transport_wlan.c
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.c 2012-01-26 15:43:25 UTC
(rev 19445)
+++ gnunet/src/transport/plugin_transport_wlan.c 2012-01-26 15:46:01 UTC
(rev 19446)
@@ -2191,8 +2191,70 @@
return GNUNET_SYSERR;
}
+
/**
+ * Creates a new outbound session the transport service will use to send data
to the
+ * peer
+ *
+ * @param cls the plugin
+ * @param address the address
+ * @return the session or NULL of max connections exceeded
+ */
+
+static struct Session *
+wlan_plugin_get_session (void *cls,
+ const struct GNUNET_HELLO_Address *address)
+{
+ struct Session * s = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "To be implemented\n");
+ GNUNET_break (0);
+ return s;
+}
+
+/**
* Function that can be used by the transport service to transmit
+ * a message using the plugin. Note that in the case of a
+ * peer disconnecting, the continuation MUST be called
+ * prior to the disconnect notification itself. This function
+ * will be called with this peer's HELLO message to initiate
+ * a fresh connection to another peer.
+ *
+ * @param cls closure
+ * @param session which session must be used
+ * @param msgbuf the message to transmit
+ * @param msgbuf_size number of bytes in 'msgbuf'
+ * @param priority how important is the message (most plugins will
+ * ignore message priority and just FIFO)
+ * @param to how long to wait at most for the transmission (does not
+ * require plugins to discard the message after the timeout,
+ * just advisory for the desired delay; most plugins will ignore
+ * this as well)
+ * @param cont continuation to call once the message has
+ * been transmitted (or if the transport is ready
+ * for the next transmission call; or if the
+ * peer disconnected...); can be NULL
+ * @param cont_cls closure for cont
+ * @return number of bytes used (on the physical network, with overheads);
+ * -1 on hard errors (i.e. address invalid); 0 is a legal value
+ * and does NOT mean that the message was not transmitted (DV)
+ */
+static ssize_t
+wlan_plugin_send (void *cls,
+ struct Session *session,
+ const char *msgbuf, size_t msgbuf_size,
+ unsigned int priority,
+ struct GNUNET_TIME_Relative to,
+ GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls)
+{
+ ssize_t sent = -1;
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "To be implemented\n");
+ GNUNET_break (0);
+ return sent;
+}
+
+
+/**
+ * Function that can be used by the transport service to transmit
* a message using the plugin.
*
* @param cls closure
@@ -2218,7 +2280,7 @@
* and does NOT mean that the message was not transmitted (DV)
*/
static ssize_t
-wlan_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target,
+wlan_plugin_send_old (void *cls, const struct GNUNET_PeerIdentity *target,
const char *msgbuf, size_t msgbuf_size, unsigned int
priority,
struct GNUNET_TIME_Relative timeout, struct Session *session,
const void *addr, size_t addrlen, int force_address,
@@ -3259,7 +3321,9 @@
api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions));
api->cls = plugin;
- api->send = &wlan_plugin_send;
+ api->send = &wlan_plugin_send_old;
+ api->send_with_session = &wlan_plugin_send;
+ api->get_session = &wlan_plugin_get_session;
api->disconnect = &wlan_plugin_disconnect;
api->address_pretty_printer = &wlan_plugin_address_pretty_printer;
api->check_address = &wlan_plugin_address_suggested;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r19446 - gnunet/src/transport,
gnunet <=