在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
相关文档:
就是在已有的数据库实例上创建一个新的帐号,访问一些新的表
操作步骤如下:
1、登录linux,以oracle用户登录(如果是root用户登录的,登录后用 su - oracle命令切换成oracle用户)
2、以sysdba方式来打开sqlplus,命令如下: sqlplus "/as sysdba"
3、查看我们常规将用户表空间放置位置 ......
按以下步骤来,先写这么多来提醒下自己:
1.熟悉linux的基本环境,熟悉linux的基本命令.
2.熟悉linux的交叉编译环境的的配置.
3.复习基本的C语言知识.
&nbs ......
分类:操作系统技巧
windows
系统通过
GRUB
for dos 硬盘安装
FC6
Fedora
Core 6
这里给个grub for
dos 的下载地址:
http://nchc.dl.sourceforge.net/sourceforge/grub4dos/grub_for_dos-0.4.1.zip
解压放入C:盘
其中两个文件最重要,把他们都放在C:根目录下:
1.C:\boot\grub
2.把 grldr 放入 C: ......
VirtualBox官方网站:http://www.virtualbox.org/
以下为ubuntu 为平台的安装、配置、使用,其实在各个发行版中的使用都差不多,只是在下载的时候需要下载相对应主系统平台的安装包即可。
环境需求:
VirtualBox需要ker ......