Line 58: |
Line 58: |
| === Dump === | | === Dump === |
| | | |
− | ; <code>int libsoccr_get_sk_data(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size)</code> | + | ; <code>int libsoccr_save(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size)</code> |
| : Fills in the <code>data</code> structure with the info get from paused socket. The <code>data_size</code> should be the size of the structure passed. The return code is the size of the structure really filled with data. | | : Fills in the <code>data</code> structure with the info get from paused socket. The <code>data_size</code> should be the size of the structure passed. The return code is the size of the structure really filled with data. |
| | | |
− | ; <code>char *libsoccr_get_queue_bytes(struct libsoccr_sk *sk, int queue_id, int steal)</code> | + | ; <code>char *libsoccr_get_queue_bytes(struct libsoccr_sk *sk, int queue_id, unsigned flags)</code> |
− | : Returns a malloc()-ed array with the contents of the queue. The queue can be TCP_RECV_QUEUE or TCP_SEND_QUEUE. The amount of bytes in each is <code>data.inq_len</code> and <code>data.outq_len</code> respectively. The <code>steal</code> is a boolean value specifying whether the caller would free() the buffers himself (1) or expects the <code>_resume()</code> to do it (0). | + | : Returns a malloc()-ed array with the contents of the queue. The queue can be TCP_RECV_QUEUE or TCP_SEND_QUEUE. The amount of bytes in each is <code>data.inq_len</code> and <code>data.outq_len</code> respectively. The <code>flags</code> may include <code>SOCCR_MEM_EXCL</code> bit (see below). |
| + | |
| + | ; <code>union libsoccr_addr *libsoccr_get_addr(struct libsoccr_sk *sk, int self, unsigned flags)</code> |
| + | : Returns address (self or peer) of the socket. The <code>flags</code> may include <code>SOCCR_MEM_EXCL</code> bit (see below) |
| + | (currently unimplemented) |
| | | |
| === Restore === | | === Restore === |
| | | |
− | ; <code>int libsoccr_set_sk_data_unbound(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size)</code> | + | ; <code>int libsoccr_restore(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size)</code> |
− | : Restores data on a socket from the <code>data</code> structure. Should be called before bind()-ing or connect()-ing the socket. | + | : Restores data on a socket from the <code>data</code> structure. Should be called after the calls below, but before the "resume" one. |
− | | |
− | ; <code>int libsoccr_set_sk_data_noq(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size)</code>
| |
− | : Continues restoration after bind() and/or connect(), but before the queue data restore (see below)
| |
| | | |
− | ; <code>int libsoccr_set_sk_data(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size)</code> | + | ; <code>int libsoccr_set_queue_bytes(struct libsoccr_sk *sk, int queue, char *buf, unsigned flags)</code> |
− | : Completes the restoration after queues, but doesn't resume the socket. | + | : Puts back the contents of the respective queue. The <code>flags</code> may contain <code>SOCCR_MEM_EXCL</code>. |
| | | |
− | ; <code>int libsoccr_set_queue_bytes(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size, int queue, char *buf)</code> | + | ; <code>int libsoccr_set_addr(struct libsoccr_sk *sk, int self, union libsoccr_addr *, unsigned flags)</code> |
− | : Puts back the contents of the respective queue. | + | : Sets address (self or peer) of the socket. The <code>flags</code> may contain <code>SOCCR_MEM_EXCL</code>. |
| | | |
| | | |
| [[Category: Sub-projects]] | | [[Category: Sub-projects]] |
| [[Category: Sockets]] | | [[Category: Sockets]] |