-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,972 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""Declarations from `mbedtls/net_sockets.h`.""" | ||
|
||
__author__ = "Mathias Laurin" | ||
__copyright__ = "Copyright 2018, Mathias Laurin" | ||
__license__ = "MIT License" | ||
|
||
|
||
cdef: | ||
enum: MBEDTLS_NET_PROTO_TCP = 0 | ||
enum: MBEDTLS_NET_PROTO_UDP = 1 | ||
|
||
|
||
cdef extern from "mbedtls/net_sockets.h": | ||
ctypedef struct mbedtls_net_context: | ||
int fd | ||
|
||
void mbedtls_net_init(mbedtls_net_context *ctx) | ||
void mbedtls_net_free(mbedtls_net_context *ctx) | ||
int mbedtls_net_connect( | ||
mbedtls_net_context *ctx, | ||
const char *host, const char *port, | ||
int proto) | ||
int mbedtls_net_bind( | ||
mbedtls_net_context *ctx, | ||
const char *bind_ip, | ||
const char *port, | ||
int proto) | ||
int mbedtls_net_accept( | ||
mbedtls_net_context *bind_ctx, | ||
mbedtls_net_context *client_ctx, | ||
void *client_ip, size_t buf_size, size_t *ip_len) | ||
int mbedtls_net_set_block(mbedtls_net_context *ctx) | ||
int mbedtls_net_set_nonblock(mbedtls_net_context *ctx) | ||
# mbedtls_net_usleep | ||
int mbedtls_net_recv(void *ctx, unsigned char *buf, size_t len) nogil | ||
int mbedtls_net_send(void *ctx, const unsigned char *buf, size_t len) nogil | ||
int mbedtls_net_recv_timeout( | ||
void *ctx, | ||
unsigned char *buf, size_t len, | ||
int timeout) |
Oops, something went wrong.