Explorar o código

Merge pull request #14 from Lawlieta/master

【修改】适配 SAL 组件改动
朱天龙 (Armink) %!s(int64=7) %!d(string=hai) anos
pai
achega
f0ff96fc20
Modificáronse 1 ficheiros con 15 adicións e 10 borrados
  1. 15 10
      src/wiz_af_inet.c

+ 15 - 10
src/wiz_af_inet.c

@@ -61,7 +61,7 @@ static int wiz_poll(struct dfs_fd *file, struct rt_pollreq *req)
 }
 #endif
 
-static const struct proto_ops wiz_inet_stream_ops =
+static const struct sal_socket_ops wiz_socket_ops =
 {
     wiz_socket,
     wiz_closesocket,
@@ -83,31 +83,36 @@ static const struct proto_ops wiz_inet_stream_ops =
 #endif /* SAL_USING_POSIX */
 };
 
+static struct sal_proto_ops wiz_proto_ops = 
+{
+    wiz_gethostbyname,
+    NULL,
+    wiz_getaddrinfo,
+    wiz_freeaddrinfo,
+};
+
 static int wiz_create(struct sal_socket *socket, int type, int protocol)
 {
     RT_ASSERT(socket);
 
     //TODO Check type & protocol
 
-    socket->ops = &wiz_inet_stream_ops;
+    socket->ops = &wiz_socket_ops;
 
     return 0;
 }
 
-static const struct proto_family wiz_inet_family_ops = {
-    "wiz",
+static const struct sal_proto_family wiz_inet_famils =
+{
     AF_WIZ,
     AF_INET,
-    wiz_create,
-    wiz_gethostbyname,
-    NULL,
-    wiz_freeaddrinfo,
-    wiz_getaddrinfo,
+    wiz_create,  
+    &wiz_proto_ops,
 };
 
 int wiz_inet_init(void)
 {
-    sal_proto_family_register(&wiz_inet_family_ops);
+    sal_proto_family_register(&wiz_inet_famils);
 
     return 0;
 }