Networking: Replace all references to net_ipaddr_t with either in_addr_t on net_ipv6addr_t. The goal is to support both IPv4 and IPv6 simultaneously. This requires that the two types be distinct and not conditionally typedef'ed to net_ipaddr_t.
This commit is contained in:
parent
d6c8d11909
commit
36118a1b76
@ -2,7 +2,7 @@
|
||||
* apps/include/netutils/smtp.h
|
||||
* SMTP header file
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Heavily leveraged from uIP 1.0 which also has a BSD-like license:
|
||||
@ -69,7 +69,7 @@ extern "C"
|
||||
|
||||
void *smtp_open(void);
|
||||
void smtp_configure(FAR void *handle, FAR const char *localhostname,
|
||||
FAR const net_ipaddr_t *paddr);
|
||||
FAR const in_addr_t *paddr);
|
||||
int smtp_send(FAR void *handle, FAR const char *to, FAR const char *cc,
|
||||
FAR const char *from, FAR const char *subject,
|
||||
FAR const char *msg, int msglen);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* apps/netutitls/smtp/smtp.c
|
||||
* smtp SMTP E-mail sender
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Heavily leveraged from uIP 1.0 which also has a BSD-like license:
|
||||
@ -63,7 +63,7 @@
|
||||
#include <apps/netutils/smtp.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define SMTP_INPUT_BUFFER_SIZE 512
|
||||
@ -89,7 +89,7 @@ struct smtp_state
|
||||
uint8_t state;
|
||||
bool connected;
|
||||
sem_t sem;
|
||||
net_ipaddr_t smtpserver;
|
||||
in_addr_t smtpserver;
|
||||
const char *localhostname;
|
||||
const char *to;
|
||||
const char *cc;
|
||||
@ -286,7 +286,7 @@ static inline int smtp_send_message(int sockfd, struct smtp_state *psmtp)
|
||||
*/
|
||||
|
||||
void smtp_configure(FAR void *handle, FAR const char *lhostname,
|
||||
FAR const net_ipaddr_t *paddr)
|
||||
FAR const in_addr_t *paddr)
|
||||
{
|
||||
FAR struct smtp_state *psmtp = (FAR struct smtp_state *)handle;
|
||||
psmtp->localhostname = lhostname;
|
||||
@ -364,6 +364,7 @@ void *smtp_open(void)
|
||||
memset(psmtp, 0, sizeof(struct smtp_state));
|
||||
(void)sem_init(&psmtp->sem, 0, 0);
|
||||
}
|
||||
|
||||
return (void*)psmtp;
|
||||
}
|
||||
|
||||
|
@ -455,6 +455,7 @@ int tftpc_parseargs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
|
||||
{
|
||||
goto errout;
|
||||
}
|
||||
|
||||
args->allocated = true;
|
||||
}
|
||||
|
||||
@ -797,8 +798,9 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
|
||||
handle = dhcpc_open(&mac, IFHWADDRLEN);
|
||||
|
||||
/* Get an IP address. Note that there is no logic for renewing the IP address in this
|
||||
* example. The address should be renewed in ds.lease_time/2 seconds.
|
||||
/* Get an IP address. Note that there is no logic for renewing the IP
|
||||
* address in this example. The address should be renewed in
|
||||
* ds.lease_time/2 seconds.
|
||||
*/
|
||||
|
||||
if (handle)
|
||||
@ -843,7 +845,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
FAR const char *fmt = g_fmtarginvalid;
|
||||
const char *staddr;
|
||||
net_ipaddr_t ipaddr;
|
||||
in_addr_t ipaddr;
|
||||
uint32_t start;
|
||||
uint32_t next;
|
||||
uint32_t dsec = 10;
|
||||
@ -899,7 +901,9 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* If a bad argument was encountered, then return without processing the command */
|
||||
/* If a bad argument was encountered, then return without processing the
|
||||
* command
|
||||
*/
|
||||
|
||||
if (badarg)
|
||||
{
|
||||
@ -931,8 +935,8 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
|
||||
id = ping_newid();
|
||||
|
||||
/* The maximum wait for a response will be the larger of the inter-ping time and
|
||||
* the configured maximum round-trip time.
|
||||
/* The maximum wait for a response will be the larger of the inter-ping
|
||||
* time and the configured maximum round-trip time.
|
||||
*/
|
||||
|
||||
maxwait = MAX(dsec, CONFIG_NSH_MAX_ROUNDTRIP);
|
||||
@ -960,7 +964,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
/* Get the elapsed time from the time that the request was
|
||||
* sent until the response was received. If we got a response
|
||||
* to an earlier request, then fudge the elpased time.
|
||||
* to an earlier request, then fudge the elapsed time.
|
||||
*/
|
||||
|
||||
elapsed = TICK2MSEC(clock_systimer() - next);
|
||||
@ -1091,7 +1095,9 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* If a bad argument was encountered, then return without processing the command */
|
||||
/* If a bad argument was encountered, then return without processing the
|
||||
* command
|
||||
*/
|
||||
|
||||
if (badarg)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user