Updated API for uiplib and resolv to use uip_ipaddr_t instead of uint16_t for compability with IPv6

This commit is contained in:
nifi 2010-05-31 15:22:08 +00:00
parent c13bb8666b
commit b54c6e673b
22 changed files with 194 additions and 106 deletions

View file

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: smtp-socket.c,v 1.3 2007/11/18 01:00:50 oliverschmidt Exp $
* $Id: smtp-socket.c,v 1.4 2010/05/31 15:22:08 nifi Exp $
*/
#include "smtp.h"
@ -60,7 +60,7 @@ struct smtp_state {
static struct smtp_state s;
static char *localhostname;
static u16_t smtpserver[2];
static uip_ipaddr_t smtpserver;
#define ISO_nl 0x0a
#define ISO_cr 0x0d
@ -201,11 +201,10 @@ smtp_appcall(void *state)
}
/*---------------------------------------------------------------------------*/
void
smtp_configure(char *lhostname, u16_t *server)
smtp_configure(char *lhostname, uip_ipaddr_t *server)
{
localhostname = lhostname;
smtpserver[0] = server[0];
smtpserver[1] = server[1];
uip_ipaddr_copy(&smtpserver, server);
}
/*---------------------------------------------------------------------------*/
unsigned char
@ -214,7 +213,7 @@ smtp_send(char *to, char *cc, char *from, char *subject,
{
struct uip_conn *conn;
conn = tcp_connect((uip_ipaddr_t *)smtpserver, HTONS(25), NULL);
conn = tcp_connect(&smtpserver, HTONS(25), NULL);
if(conn == NULL) {
return 0;
}