[at][sal] Add query and unregistered protocol family functions

This commit is contained in:
chenyong
2018-08-25 16:01:31 +08:00
parent 0d737de882
commit 192b177518
7 changed files with 159 additions and 32 deletions
+9 -4
View File
@@ -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__ */