Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚlinuxϲéѯ·ÓÉ

ÔÚlinux²éѯ·Óɵķ½·¨ÓкܶàÖÖ¡£ÏÂÃæ½éÉÜÒ»ÖÖ´Óiproute¿ªÔ´Èí¼þÖÐÌáÈ¡³öÀ´µÄÒ»ÖÖ·½·¨¡£ÔÚubuntu904ϱàÒ룬ÔËÐÐͨ¹ý¡£
±àÒë: gcc -o reqroute iproute_linux.c
ʹÓÃ: ./reqroute 1.2.3.4
½á¹û:source:1.3.4.5
       Gateway:192.168.1.3
       Dev:eth0
Ô´´úÂëÈçÏ£º
iproute_linux.h
typedef unsigned char __u8;
typedef short __s16;
typedef unsigned int __u32;
typedef struct{
 __u8 family;
 __u8 bytelen;
 __s16 bitlen;
 __u32 flags;
 __u32 data[8];
} inet_prefix;
static struct{
 int tb;
 int cloned;
 int flushed;
 char *flushb;
 int flushp;
 int flushe;
 struct rtnl_handle *rth;
 int protocol, protocolmask;
 int scope, scopemask;
 int type, typemask;
 int tos, tosmask;
 int iif, iifmask;
 int oif, oifmask;
 int realm, realmmask;
 inet_prefix rprefsrc;
 inet_prefix rvia;
 inet_prefix rdst;
 inet_prefix mdst;
 inet_prefix rsrc;
 inet_prefix msrc;
} filter;
struct dn_naddr{
        unsigned short a_len;
        unsigned char a_addr[20];
};
struct ipx_addr {
 u_int32_t ipx_net;
 u_int8_t  ipx_node[6];
};
struct idxmap{
 struct idxmap * next;
 unsigned index;
 int  type;
 int  alen;
 unsigned flags;
 unsigned char addr[20];
 char  name[16];
};
struct rtnl_handle{
 int   fd;
 struct sockaddr_nl local;
 struct sockaddr_nl peer;
 __u32   seq;
 __u32   dump;
};
ÁíÒ»¸öÎļþ£º
iproute_linux.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <syslog.h>
#include <fcntl.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#includ


Ïà¹ØÎĵµ£º

/etc/hosts file in linux configure manual

Name
hosts - The static table lookup for host names
Synopsis
/etc/hosts
Description
This manual page describes the format of the /etc/hosts
file. This file is a simple text file that
associates IP addresses with hostnames, one line per IP address. For
each host a single line should be presen ......

linux ³£ÓõĻù±¾ÏµÍ³Êý¾ÝÀàÐÍ

       caddr_t //ºËÐĵØÖ·
clock_t //ʱÖӵδð¼ÆÊýÆ÷
compt_t //ѹËõµÄʱÖӵδð
dev_t //É豸ºÅ£¨Ö÷ºÍ´Î£©
fd_set //ÎļþÃèÊö·û¼¯
fpos_t //ÎļþλÖÃ
gid_t //ÊýÖµ×éID
ino_t //i½Úµã±àºÅ
mode_t //ÎļþÀ ......

linuxѧϰ±Ê¼Ç 1.linux³õ²½½éÉÜ

Ò».linuxµÄÌØµã
1£©Ãâ·ÑµÄ/¿ªÔ´µÄ
2£©Ö§³Ö¶àÏß³Ì/¶àÓû§
3£©°²È«ÐÔºÃ
4£©¶ÔÄÚ´æºÍÎļþ¹ÜÀíÓÅÔ½
¶þ.Ë­ÔÚͦlinux
IBM/Compaq/Novell/Oracle/Sun/NEC....
Èý.linux ×îСֻҪ4MÄÚ´æ -¡·Ç¶Èëʽ¿ª·¢
ËÄ.linux µÄ¹ÊÊÂ
1973£¬unix³öÏÖ¡£´ËʱwindowsÉÐδ³öÉú
Ô´ÂëÄں˹²Ïí -¡·IBMÍÆ³öaix£¬SUNÍÆ³ösolaris£¬HPÍÆ³öHP unix£¬ ......

Linux ÏÂÐéÄâ»ú——Virtual Box½Ì³Ì

    VirtualBox¹Ù·½ÍøÕ¾£ºhttp://www.virtualbox.org/
    ÒÔÏÂΪubuntu Ϊƽ̨µÄ°²×°¡¢ÅäÖá¢Ê¹Óã¬ÆäʵÔÚ¸÷¸ö·¢ÐаæÖеÄʹÓö¼²î²»¶à£¬Ö»ÊÇÔÚÏÂÔØµÄʱºòÐèÒªÏÂÔØÏà¶ÔÓ¦Ö÷ϵͳƽ̨µÄ°²×°°ü¼´¿É¡£
    »·¾³ÐèÇó£º
       VirtualBoxÐèÒªker ......

LinuxÍøÂç±à³Ì ¿Í»§¶ËÓë·þÎñÆ÷¶ËÒ첽ͨÐÅ

#include <sys/select.h>
#include <sys/time.h>
#include
<sys/types.h>
#include <unistd.h>
int select(int
nfds,fd_set *readfds,fd_set *writefds, fd_set *except fds,struct timeval
*timeout)
void FD_SET(int fd,fd_set *fdset)
void FD_CLR(int fd,fd_set
*fdset)
void F ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ