Updated API for uiplib and resolv to use uip_ipaddr_t instead of uint16_t for compability with IPv6
This commit is contained in:
parent
c13bb8666b
commit
b54c6e673b
22 changed files with 194 additions and 106 deletions
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: shell-irc.c,v 1.1 2008/11/28 00:16:15 adamdunkels Exp $
|
||||
* $Id: shell-irc.c,v 1.2 2010/05/31 15:22:08 nifi Exp $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -142,7 +142,7 @@ PROCESS_THREAD(shell_irc_process, ev, data)
|
|||
|
||||
running = 1;
|
||||
|
||||
uiplib_ipaddrconv(server, (u8_t *)&serveraddr);
|
||||
uiplib_ipaddrconv(server, &serveraddr);
|
||||
ircc_connect(&s, server, &serveraddr, nick);
|
||||
while(running) {
|
||||
PROCESS_WAIT_EVENT();
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: shell-ping.c,v 1.3 2010/03/17 12:27:52 joxe Exp $
|
||||
* $Id: shell-ping.c,v 1.4 2010/05/31 15:22:08 nifi Exp $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -142,7 +142,7 @@ PROCESS_THREAD(shell_ping_process, ev, data)
|
|||
"ping <server>: server as address", "");
|
||||
PROCESS_EXIT();
|
||||
}
|
||||
uiplib_ipaddrconv(data, (u8_t *)&remoteaddr);
|
||||
uiplib_ipaddrconv(data, &remoteaddr);
|
||||
|
||||
send_ping(&remoteaddr);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: shell-tcpsend.c,v 1.4 2009/03/17 21:49:44 adamdunkels Exp $
|
||||
* $Id: shell-tcpsend.c,v 1.5 2010/05/31 15:22:08 nifi Exp $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -154,7 +154,7 @@ PROCESS_THREAD(shell_tcpsend_process, ev, data)
|
|||
|
||||
running = 1;
|
||||
|
||||
uiplib_ipaddrconv(server, (u8_t *)&serveraddr);
|
||||
uiplib_ipaddrconv(server, &serveraddr);
|
||||
telnet_connect(&s, &serveraddr, port);
|
||||
while(running) {
|
||||
PROCESS_WAIT_EVENT();
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: shell-udpsend.c,v 1.5 2010/02/04 15:23:15 nifi Exp $
|
||||
* $Id: shell-udpsend.c,v 1.6 2010/05/31 15:22:08 nifi Exp $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -94,7 +94,7 @@ PROCESS_THREAD(shell_udpsend_process, ev, data)
|
|||
++next;
|
||||
port = shell_strtolong(next, &nextptr);
|
||||
|
||||
uiplib_ipaddrconv(server, (uint8_t *)&serveraddr);
|
||||
uiplib_ipaddrconv(server, &serveraddr);
|
||||
udpconn = udp_new(&serveraddr, htons(port), NULL);
|
||||
|
||||
if(next != nextptr) {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: shell-wget.c,v 1.1 2008/11/09 12:36:23 adamdunkels Exp $
|
||||
* $Id: shell-wget.c,v 1.2 2010/05/31 15:22:08 nifi Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -67,7 +67,7 @@ open_url(char *url)
|
|||
static char host[32];
|
||||
char *file;
|
||||
register char *urlptr;
|
||||
static u16_t addr[2];
|
||||
static uip_ipaddr_t addr;
|
||||
|
||||
/* Trim off any spaces in the end of the url. */
|
||||
urlptr = url + strlen(url) - 1;
|
||||
|
@ -120,7 +120,7 @@ open_url(char *url)
|
|||
|
||||
/* Try to lookup the hostname. If it fails, we initiate a hostname
|
||||
lookup and print out an informative message on the statusbar. */
|
||||
if(uiplib_ipaddrconv(host, (unsigned char *)addr) == 0) {
|
||||
if(uiplib_ipaddrconv(host, &addr) == 0) {
|
||||
shell_output_str(&wget_command, "Not an IP address", "");
|
||||
if(resolv_lookup(host) == NULL) {
|
||||
shell_output_str(&wget_command, "Not resolved", "");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue