[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT LWIP PATCH v2 5/6] Provide ioctl for LWIP



Signed-off-by: Mihai Pogonaru <pogonarumihai@xxxxxxxxx>
Reviewed-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 exportsyms.uk        |  1 -
 include/sys/socket.h |  2 --
 sockets.c            | 20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/exportsyms.uk b/exportsyms.uk
index 375a789..10c1ab8 100644
--- a/exportsyms.uk
+++ b/exportsyms.uk
@@ -6,7 +6,6 @@ getsockname
 getsockopt
 liblwip_init
 listen
-lwip_ioctl
 lwip_htonl
 lwip_htons
 lwip_gethostbyname
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 42bad6c..7a8aca0 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -52,8 +52,6 @@
 #define SOCK_SEQPACKET 5
 #endif
 
-#define ioctl(s, cmd, argp) lwip_ioctl(s, cmd, argp)
-
 int socket(int domain, int type, int protocol);
 int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
 int bind(int s, const struct sockaddr *name, socklen_t namelen);
diff --git a/sockets.c b/sockets.c
index 38639f8..aa772da 100644
--- a/sockets.c
+++ b/sockets.c
@@ -57,6 +57,10 @@ static int sock_net_write(struct vnode *s_vnode,
 static int sock_net_read(struct vnode *s_vnode,
                        struct vfscore_file *vfscore_file __unused,
                        struct uio *buf, int ioflag __unused);
+static int sock_net_ioctl(struct vnode *s_vnode,
+                       struct vfscore_file *vfscore_file __unused,
+                       unsigned long request,
+                       void *buf);
 
 #define sock_net_inactive  ((vnop_inactive_t) vfscore_vop_nullop)
 
@@ -64,6 +68,7 @@ static struct vnops sock_net_vnops = {
        .vop_close = sock_net_close,
        .vop_write = sock_net_write,
        .vop_read  = sock_net_read,
+       .vop_ioctl = sock_net_ioctl,
        .vop_inactive = sock_net_inactive
 };
 
@@ -299,6 +304,21 @@ static int sock_net_read(struct vnode *s_vnode,
        return 0;
 }
 
+static int sock_net_ioctl(struct vnode *s_vnode,
+                       struct vfscore_file *vfscore_file __unused,
+                       unsigned long request,
+                       void *buf)
+{
+       struct sock_net_file *file = NULL;
+
+       file = s_vnode->v_data;
+       LWIP_DEBUGF(SOCKETS_DEBUG, ("%s fd:%d lwip_fd:%d\n",
+                                   __func__,
+                                   file->vfscore_file->fd,
+                                   file->sock_fd));
+       return lwip_ioctl(file->sock_fd, request, buf);
+}
+
 int socket(int domain, int type, int protocol)
 {
        int ret = 0;
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.