Friday, May 14, 2010

Syntax Commands Used DNS Server Client gethostbyname() htonl htons in Linux C Language

#include<netdb.h>
Struct hostent *gethostbyname(const char *name);
Get network hsot entry.
inet_ntop:
Parse network address
Synopsis C Language Programing
#include<sys/types.h>
#include<sys/socket.h>
#include<arpa/inet.h>
Const char*inet_ntop(int of,const void *src,char *dst,socklen_t int);
Description
This function converts the network address structure src in the of address family into a character string, which is copied to a buffer dst, which is int bytes long.
htonl and htons in C Language Programing
Synopsis
#include<netinet/in.h>
unit32_t htonl(unit32_t hostlong);
Unit16_t htons(unit16_t hosthort);
Description
The htonl() converts the unsigned integer hostlong from host byte oreder to network byte order.
The htons() converts the unsigned short integer hostshort form host byte oreder to network byte order.

0 comments:

Flag counter

free counters