ioLibrary for Cortex M series
Macros | Functions
sockutil.c File Reference

Socket Utility Source File. More...

#include "common/common.h"
Include dependency graph for sockutil.c:

Go to the source code of this file.

Macros

#define NETINIT_ADDR_SET(name_p)
 
#define WCF_HANDLE(item_v, ret_v)
 

Functions

int8_t network_init (uint8_t dhcp_sock, void_func ip_update, void_func ip_conflict)
 
void network_disp (wiz_NetInfo *netinfo)
 
int8_t sockwatch_open (uint8_t sock, watch_cbfunc cb)
 
int8_t sockwatch_close (uint8_t sock)
 
int8_t sockwatch_set (uint8_t sock, uint8_t item)
 
int8_t sockwatch_clr (uint8_t sock, uint8_t item)
 
int8_t sockwatch_chk (uint8_t sock, uint8_t item)
 
void sockwatch_run (void)
 
int8_t ip_check (int8_t *str, uint8_t *ip)
 
int8_t port_check (int8_t *str, uint16_t *port)
 
int8_t mac_check (int8_t *str, uint8_t *mac)
 
int8_t * inet_ntoa (uint32_t addr)
 
int8_t * inet_ntoa_pad (uint32_t addr)
 
uint32_t inet_addr (uint8_t *addr)
 
uint16_t swaps (uint16_t i)
 
uint32_t swapl (uint32_t l)
 
uint16_t htons (uint16_t hostshort)
 
uint32_t htonl (uint32_t hostlong)
 
uint32_t ntohs (uint16_t netshort)
 
uint32_t ntohl (uint32_t netlong)
 

Detailed Description

Socket Utility Source File.

Version
1.0
Date
2013/02/22
Revision
2013/02/22 - 1.0 Release
Author
modified by Mike Jeong

Copyright (C) 2013 WIZnet. All rights reserved.

Definition in file sockutil.c.

Macro Definition Documentation

#define NETINIT_ADDR_SET (   name_p)
Value:
do { \
if(ip_check(DEFAULT_IP_ADDR, netinfo.ip) != RET_OK) { \
printf("Default IP Addr set fail"); return RET_NOK; \
} else DBGA(name_p" IP Addr(%d.%d.%d.%d)", \
netinfo.ip[0], netinfo.ip[1], netinfo.ip[2], netinfo.ip[3]); \
if(ip_check(DEFAULT_SN_MASK, netinfo.sn) != RET_OK) { \
printf("Default SN Mask set fail"); return RET_NOK; \
} else DBGA(name_p" SN Mask(%d.%d.%d.%d)", \
netinfo.sn[0], netinfo.sn[1], netinfo.sn[2], netinfo.sn[3]); \
if(ip_check(DEFAULT_GW_ADDR, netinfo.gw) != RET_OK) { \
printf("Default GW Addr set fail"); return RET_NOK; \
} else DBGA(name_p" GW Addr(%d.%d.%d.%d)", netinfo.gw[0], \
netinfo.gw[1], netinfo.gw[2], netinfo.gw[3]); \
if(ip_check(DEFAULT_DNS_ADDR, netinfo.dns) != RET_OK) { \
printf("Default DNS Addr set fail"); return RET_NOK; \
} else DBGA(name_p" DNS Addr(%d.%d.%d.%d)", netinfo.dns[0], \
netinfo.dns[1], netinfo.dns[2], netinfo.dns[3]); \
} while(0)

Referenced by network_init().

#define WCF_HANDLE (   item_v,
  ret_v 
)
Value:
do { \
BITCLR(watch_sock[i], item_v); \
watch_cb[i](i, item_v, ret_v); \
} while(0)

Referenced by sockwatch_run().