From 192b17751868b4aa9a95ad34bb90dcd54071e5df Mon Sep 17 00:00:00 2001 From: chenyong <1521761801@qq.com> Date: Fri, 24 Aug 2018 20:39:10 +0800 Subject: [at][sal] Add query and unregistered protocol family functions --- components/net/sal_socket/include/sal.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'components/net/sal_socket/include') diff --git a/components/net/sal_socket/include/sal.h b/components/net/sal_socket/include/sal.h index 8a9dd61b67..e1a6dbedba 100644 --- a/components/net/sal_socket/include/sal.h +++ b/components/net/sal_socket/include/sal.h @@ -82,8 +82,9 @@ struct sal_socket struct proto_family { - int family; /* primary protocol families type*/ - int sec_family; /* secondary protocol families type*/ + char name[RT_NAME_MAX]; + int family; /* primary protocol families type */ + int sec_family; /* secondary protocol families type */ int (*create)(struct sal_socket *sal_socket, int type, int protocol); /* register socket options */ struct hostent* (*gethostbyname) (const char *name); @@ -92,10 +93,14 @@ struct proto_family int (*getaddrinfo) (const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); }; -/* SAL socket initialization */ +/* SAL(Socket Abstraction Layer) initialize */ int sal_init(void); -int sal_proto_family_register(const struct proto_family *pf); struct sal_socket *sal_get_socket(int sock); +/* protocol family register and unregister operate */ +int sal_proto_family_register(const struct proto_family *pf); +int sal_proto_family_unregister(const struct proto_family *pf); +struct proto_family *sal_proto_family_find(const char *name); + #endif /* SAL_H__ */ -- cgit v1.3.1