]>
Commit | Line | Data |
---|---|---|
1b4f8140 | 1 | /* |
5e0de328 | 2 | * Copyright (C) 2009-2012 the libgit2 contributors |
bb742ede VM |
3 | * |
4 | * This file is part of libgit2, distributed under the GNU GPL v2 with | |
5 | * a Linking Exception. For full terms see the included COPYING file. | |
1b4f8140 CMN |
6 | */ |
7 | #ifndef INCLUDE_netops_h__ | |
8 | #define INCLUDE_netops_h__ | |
9 | ||
44ef8b1b | 10 | #include "posix.h" |
66024c7c | 11 | #include "transport.h" |
a6f24a5b | 12 | #include "common.h" |
74bd343a | 13 | |
ea7a5452 | 14 | typedef struct gitno_buffer { |
c7c787ce | 15 | char *data; |
0bd594b6 VM |
16 | size_t len; |
17 | size_t offset; | |
74bd343a | 18 | GIT_SOCKET fd; |
a6f24a5b | 19 | #ifdef GIT_SSL |
66024c7c CMN |
20 | struct gitno_ssl *ssl; |
21 | #endif | |
ea7a5452 CMN |
22 | } gitno_buffer; |
23 | ||
66024c7c | 24 | void gitno_buffer_setup(git_transport *t, gitno_buffer *buf, char *data, unsigned int len); |
ea7a5452 | 25 | int gitno_recv(gitno_buffer *buf); |
66024c7c | 26 | |
c7c787ce | 27 | void gitno_consume(gitno_buffer *buf, const char *ptr); |
0bd594b6 | 28 | void gitno_consume_n(gitno_buffer *buf, size_t cons); |
ea7a5452 | 29 | |
a6f24a5b | 30 | int gitno_connect(git_transport *t, const char *host, const char *port); |
66024c7c | 31 | int gitno_send(git_transport *t, const char *msg, size_t len, int flags); |
bad53552 | 32 | int gitno_close(GIT_SOCKET s); |
89460f3f | 33 | int gitno_ssl_teardown(git_transport *t); |
34bfb4b0 | 34 | int gitno_send_chunk_size(int s, size_t len); |
74bd343a | 35 | int gitno_select_in(gitno_buffer *buf, long int sec, long int usec); |
1b4f8140 | 36 | |
db84b798 CMN |
37 | int gitno_extract_host_and_port(char **host, char **port, const char *url, const char *default_port); |
38 | ||
1b4f8140 | 39 | #endif |