Added "usual" comments.
This commit is contained in:
parent
cd261f3121
commit
b96c9deebc
5 changed files with 28 additions and 28 deletions
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Oliver Schmidt <ol.sc@web.de>
|
||||
*
|
||||
* $Id: wpcap.c,v 1.12 2007/11/27 20:57:18 oliverschmidt Exp $
|
||||
* $Id: wpcap.c,v 1.13 2008/01/04 21:53:32 oliverschmidt Exp $
|
||||
*/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
@ -43,9 +43,9 @@
|
|||
#include <stdlib.h>
|
||||
#ifdef __CYGWIN__
|
||||
#include <alloca.h>
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
/* Avoid 'conflicting types' errors. */
|
||||
#define htonl
|
||||
|
@ -58,7 +58,7 @@
|
|||
|
||||
#ifdef __CYGWIN__
|
||||
__attribute__((dllimport)) extern char **__argv[];
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
struct pcap;
|
||||
|
||||
|
@ -203,9 +203,9 @@ wpcap_init(void)
|
|||
|
||||
#ifdef __CYGWIN__
|
||||
addr.s_addr = inet_addr((*__argv)[1]);
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
addr.s_addr = inet_addr(__argv[1]);
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
if(addr.s_addr == INADDR_NONE) {
|
||||
error_exit("usage: <program> <ip addr of ethernet card to share>\n");
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*
|
||||
* This file is part of the Contiki OS
|
||||
*
|
||||
* $Id: contiki-main.c,v 1.13 2007/11/28 14:16:12 adamdunkels Exp $
|
||||
* $Id: contiki-main.c,v 1.14 2008/01/04 21:55:18 oliverschmidt Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -43,15 +43,15 @@
|
|||
#include "net/uip.h"
|
||||
#ifdef __CYGWIN__
|
||||
#include "net/wpcap-drv.h"
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
#include "net/tapdev-drv.h"
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
PROCINIT(&etimer_process, &tcpip_process, &wpcap_process);
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
PROCINIT(&etimer_process, &tcpip_process, &tapdev_process);
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
|
@ -65,7 +65,7 @@ main(void)
|
|||
|
||||
autostart_start((struct process **)autostart_processes);
|
||||
|
||||
uip_ipaddr(&addr, 192,168,2,2);
|
||||
uip_ipaddr(&addr, 10,10,0,11);
|
||||
printf("IP Address: %d.%d.%d.%d\n", uip_ipaddr_to_quad(&addr));
|
||||
uip_sethostaddr(&addr);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: contiki-main.c,v 1.22 2007/12/17 01:12:09 oliverschmidt Exp $
|
||||
* $Id: contiki-main.c,v 1.23 2008/01/04 21:58:40 oliverschmidt Exp $
|
||||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
|
@ -41,9 +41,9 @@
|
|||
|
||||
#ifdef __CYGWIN__
|
||||
#include "net/wpcap-drv.h"
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
#include "net/tapdev-drv.h"
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
#include "net/ethernode-uip.h"
|
||||
#include "net/ethernode-rime.h"
|
||||
#include "net/ethernode.h"
|
||||
|
@ -67,10 +67,10 @@
|
|||
#ifdef __CYGWIN__
|
||||
static struct uip_fw_netif extif =
|
||||
{UIP_FW_NETIF(0,0,0,0, 0,0,0,0, wpcap_output)};
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
static struct uip_fw_netif extif =
|
||||
{UIP_FW_NETIF(0,0,0,0, 0,0,0,0, tapdev_output)};
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
static struct uip_fw_netif meshif =
|
||||
{UIP_FW_NETIF(172,16,0,0, 255,255,0,0, uip_over_mesh_send)};
|
||||
/*static struct uip_fw_netif ethernodeif =
|
||||
|
@ -97,7 +97,7 @@ remove_route(int s)
|
|||
system(buf);
|
||||
_exit(0);
|
||||
}
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
contiki_main(int flag)
|
||||
|
@ -132,9 +132,9 @@ contiki_main(int flag)
|
|||
system(buf);
|
||||
signal(SIGTERM, remove_route);
|
||||
}
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
process_start(&tapdev_process, NULL);
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
uip_fw_register(&meshif);
|
||||
uip_fw_default(&extif);
|
||||
printf("uip_hostaddr %02x%02x\n", uip_hostaddr.u16[0], uip_hostaddr.u16[1]);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: ethernode-uip.c,v 1.5 2007/04/01 21:05:17 oliverschmidt Exp $
|
||||
* $Id: ethernode-uip.c,v 1.6 2008/01/04 21:59:13 oliverschmidt Exp $
|
||||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
|
@ -41,9 +41,9 @@
|
|||
#include "net/hc.h"
|
||||
#ifdef __CYGWIN__
|
||||
#include "net/wpcap.h"
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
#include "net/tapdev.h"
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
#include "node-id.h"
|
||||
|
||||
|
@ -82,9 +82,9 @@ PROCESS_THREAD(ethernode_uip_process, ev, data)
|
|||
|
||||
#ifdef __CYGWIN__
|
||||
wpcap_send();
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
tapdev_send();
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
/* if(uip_fw_forward() == UIP_FW_LOCAL)*/ {
|
||||
/* A frame was avaliable (and is now read into the uip_buf), so
|
||||
we process it. */
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Oliver Schmidt <ol.sc@web.de>
|
||||
*
|
||||
* $Id: cfs-win32.c,v 1.4 2007/11/22 12:03:54 oliverschmidt Exp $
|
||||
* $Id: cfs-win32.c,v 1.5 2008/01/04 21:59:59 oliverschmidt Exp $
|
||||
*/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
@ -41,13 +41,13 @@
|
|||
#include <fcntl.h>
|
||||
#ifdef __CYGWIN__
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#else /* __CYGWIN__ */
|
||||
#define open _open
|
||||
#define close _close
|
||||
#define read _read
|
||||
#define write _write
|
||||
#define lseek _lseek
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
#include "contiki.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue