1/**
2 * \file
3 * \brief Network client of the block service
4 */
5
6/*
7 * Copyright (c) 2007, 2008, 2009, 2010, ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
13 */
14
15#ifndef BLOCK_NETWORK_CLIENT_H
16#define BLOCK_NETWORK_CLIENT_H
17
18#include <bulk_transfer/bulk_transfer.h>
19
20#include <lwip/tcp.h>
21
22#include "network_common.h"
23#include "block_server.h"
24
25/**
26 *
27 */
28errval_t block_net_connect(struct block_net_service *server,
29                           struct ip_addr *ip,
30                           uint16_t port);
31
32/**
33 *
34 */
35errval_t block_net_disconnect(struct block_net_service *server);
36
37/**
38 *
39 */
40errval_t block_net_read(struct block_net_service *server,
41                        size_t block_start,
42                        size_t count,
43                        uint32_t seqn,
44                        struct bulk_continuation cont);
45
46/**
47 *
48 */
49errval_t block_net_write(struct block_net_service *server,
50                         size_t count,
51                         struct bulk_buffer **buf,
52                         struct bs_meta_data *meta,
53                         struct bulk_continuation cont);
54
55errval_t block_net_pass(struct block_net_service *server,
56                        size_t count,
57                        struct bulk_buffer **buf,
58                        struct bs_meta_data *meta,
59                        struct bulk_continuation cont);
60
61errval_t block_net_release(struct block_net_service *server,
62                           size_t count,
63                           struct bulk_buffer **buf,
64                           struct bs_meta_data *meta,
65                           struct bulk_continuation cont);
66
67#endif /* BLOCK_NETWORK_CLIENT_H */
68