[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
+40
View File
@@ -0,0 +1,40 @@
/*
* File : af_inet.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2018-08-25 ChenYong First version
*/
#ifndef __AF_INET_H__
#define __AF_INET_H__
#include <rtthread.h>
#ifdef SAL_USING_LWIP
/* lwIP protocol family register */
int lwip_inet_init(void);
#endif
#ifdef SAL_USING_AT
/* AT protocol family register */
int at_inet_init(void);
#endif
#endif /* __AF_INET_H__ */
@@ -26,6 +26,7 @@
#include <sal.h>
#include <at_socket.h>
#include <af_inet.h>
#ifdef SAL_USING_POSIX
#include <dfs_poll.h>
@@ -107,6 +108,7 @@ static int at_create(struct sal_socket *socket, int type, int protocol)
}
static const struct proto_family at_inet_family_ops = {
"at",
AF_AT,
AF_INET,
at_create,
@@ -34,6 +34,7 @@
#endif
#include <sal.h>
#include <af_inet.h>
#if LWIP_VERSION < 0x2000000
#define SELWAIT_T int
@@ -284,6 +285,7 @@ static int inet_create(struct sal_socket *socket, int type, int protocol)
}
static const struct proto_family lwip_inet_family_ops = {
"lwip",
AF_INET,
AF_INET,
inet_create,