Skip to content

Commit

Permalink
lib.socket: removing __setsockopt & __getsockopt as
Browse files Browse the repository at this point in the history
`io_uring_prep_setsockopt` and `io_uring_prep_getsockopt` was created
  • Loading branch information
YoSTEALTH committed Jul 10, 2024
1 parent 34ced0c commit 361af20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/liburing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dynamic_import import importer


__version__ = '2024.6.4'
__version__ = '2024.7.10'


importer(exclude_dir=['lib', 'include'])
Expand Down
35 changes: 9 additions & 26 deletions src/liburing/lib/socket.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,14 @@ cdef extern from '<sys/socket.h>' nogil:
sa_family_t sa_family
char sa_data[14] # protocol-specific address

int __bind 'bind'(int sockfd, const __sockaddr *addr, socklen_t addrlen)
int __bind 'bind'(int sockfd, const __sockaddr* addr, socklen_t addrlen)
int __listen 'listen'(int sockfd, int backlog)

int __setsockopt 'setsockopt'(int sockfd,
int level,
int optname,
const void *optval,
socklen_t optlen)
int __getsockopt 'getsockopt'(int sockfd,
int level,
int optname,
void *optval,
socklen_t *optlen)

int __getpeername 'getpeername'(int sockfd,
__sockaddr *addr,
socklen_t *addrlen)
__sockaddr* addr,
socklen_t* addrlen)
int __getsockname 'getsockname'(int sockfd,
__sockaddr *addr,
socklen_t *addrlen)
__sockaddr* addr,
socklen_t* addrlen)


cdef extern from '<sys/un.h>' nogil:
Expand All @@ -49,7 +37,7 @@ cdef extern from '<netinet/in.h>' nogil:
# IPv4 - Internet address
# -----------------------
struct __in_addr 'in_addr':
in_addr_t s_addr # Address in network byte order */
in_addr_t s_addr # Address in network byte order

struct __sockaddr_in 'sockaddr_in':
sa_family_t sin_family # address family: AF_INET
Expand Down Expand Up @@ -106,7 +94,7 @@ cdef extern from '<netdb.h>' nogil:
char* serv,
socklen_t servlen,
int flags)
void __freeaddrinfo 'freeaddrinfo'(__addrinfo *ai) # free `addrinfo'
void __freeaddrinfo 'freeaddrinfo'(__addrinfo* ai) # free `addrinfo'
const char* __gai_strerror 'gai_strerror'(int ecode)

enum:
Expand Down Expand Up @@ -137,15 +125,10 @@ cdef extern from '<netdb.h>' nogil:

cdef extern from '<arpa/inet.h>' nogil:
# converts to network address
int __inet_pton 'inet_pton'(int af,
const char *src, # restrict
void *dst) # restrict
int __inet_pton 'inet_pton'(int af, const char* src, void* dst)

# converts network address to address family
const char *__inet_ntop 'inet_ntop'(int af,
const void *src, # restrict
char *dst, # restrict
socklen_t size)
const char* __inet_ntop 'inet_ntop'(int af, const void* src, char* dst, socklen_t size)

# converting host to network order.
uint16_t __htons 'htons'(uint16_t hostshort)
Expand Down

0 comments on commit 361af20

Please sign in to comment.