f4ebe841a5
FossilOrigin-Name: 8a43dd9d05a4cb73210243ddd8df2a26f16c7ef2c4d4e36ab446de1f65d88223
23 lines
362 B
C
23 lines
362 B
C
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <arpa/inet.h>
|
|
#include <netinet/in.h>
|
|
|
|
void sock_addrinit(struct sockaddr *addr,int type)
|
|
{
|
|
switch (type){
|
|
case AF_INET:
|
|
memset(addr,0,sizeof(struct sockaddr_in));
|
|
addr->sa_family=type;
|
|
#ifdef HAVE_SIN_LEN
|
|
addr_sa_len=sizeof(struct sockaddr_in);
|
|
#endif
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
}
|