change for ds6 calls

This commit is contained in:
dak664 2010-03-17 20:19:33 +00:00
parent 115b3a7c5c
commit de2f5aaddc
2 changed files with 23 additions and 19 deletions

View File

@ -28,7 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: raven-lcd.c,v 1.6 2010/02/28 21:29:20 dak664 Exp $ * $Id: raven-lcd.c,v 1.7 2010/03/17 20:19:33 dak664 Exp $
*/ */
/** /**
@ -71,7 +71,6 @@
#include <stdio.h> #include <stdio.h>
static u16_t addr[8];
static u8_t count = 0; static u8_t count = 0;
static u8_t seqno; static u8_t seqno;
uip_ipaddr_t dest_addr; uip_ipaddr_t dest_addr;
@ -106,7 +105,10 @@ void
raven_ping6(void) raven_ping6(void)
{ {
/* ping the router */ /* ping the router */
#if THEOLDWAY
// Setup destination address. // Setup destination address.
static u16_t addr[8];
struct uip_nd6_defrouter *defrouter; struct uip_nd6_defrouter *defrouter;
uint8_t i,tmp; uint8_t i,tmp;
@ -130,6 +132,17 @@ raven_ping6(void)
UIP_IP_BUF->ttl = uip_netif_physical_if.cur_hop_limit; UIP_IP_BUF->ttl = uip_netif_physical_if.cur_hop_limit;
uip_ipaddr_copy(&UIP_IP_BUF->destipaddr, &dest_addr); uip_ipaddr_copy(&UIP_IP_BUF->destipaddr, &dest_addr);
uip_netif_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr); uip_netif_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr);
#else
/* Get address from default router */
UIP_IP_BUF->vtc = 0x60;
UIP_IP_BUF->tcflow = 1;
UIP_IP_BUF->flow = 0;
UIP_IP_BUF->proto = UIP_PROTO_ICMP6;
UIP_IP_BUF->ttl = uip_ds6_if.cur_hop_limit;
uip_ipaddr_copy(&UIP_IP_BUF->destipaddr, uip_ds6_defrt_choose());
uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr);
#endif
UIP_ICMP_BUF->type = ICMP6_ECHO_REQUEST; UIP_ICMP_BUF->type = ICMP6_ECHO_REQUEST;
UIP_ICMP_BUF->icode = 0; UIP_ICMP_BUF->icode = 0;

View File

@ -227,21 +227,13 @@ void initialize(void)
} }
#endif /* COFFEE_FILES */ #endif /* COFFEE_FILES */
/* Add prefixes for testing */ /* Add addresses for testing */
#if 0 #if 0
{ {
uip_ip6addr_t ipaddr; uip_ip6addr_t ipaddr;
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_netif_addr_autoconf_set(&ipaddr, &uip_lladdr); uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
uip_netif_addr_add(&ipaddr, 16, 0, TENTATIVE); // uip_ds6_prefix_add(&ipaddr,64,0);
}
#endif
#if 0
{
uip_ip6addr_t ipaddr;
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_netif_addr_add(&ipaddr, UIP_DEFAULT_PREFIX_LEN, 0, AUTOCONF);
uip_nd6_prefix_add(&ipaddr, UIP_DEFAULT_PREFIX_LEN, 0);
} }
#endif #endif
@ -253,13 +245,12 @@ void initialize(void)
char buf[80]; char buf[80];
unsigned int size; unsigned int size;
for(i = 0; i < UIP_CONF_NETIF_MAX_ADDRESSES; i ++) { for (i=0;i<UIP_DS6_ADDR_NB;i++) {
if(uip_netif_physical_if.addresses[i].state != NOT_USED) { if (uip_ds6_if.addr_list[i].isused) {
httpd_cgi_sprint_ip6(*(uip_ipaddr_t*)&uip_netif_physical_if.addresses[i],buf); httpd_cgi_sprint_ip6(uip_ds6_if.addr_list[i].ipaddr,buf);
printf_P(PSTR("IPv6 Address: %s\n"),buf); printf_P(PSTR("IPv6 Address: %s\n"),buf);
} }
} }
eeprom_read_block (buf,server_name, sizeof(server_name)); eeprom_read_block (buf,server_name, sizeof(server_name));
buf[sizeof(server_name)]=0; buf[sizeof(server_name)]=0;
printf_P(PSTR("%s"),buf); printf_P(PSTR("%s"),buf);