易截截图软件、单文件、免安装、纯绿色、仅160KB

linux获取IP地址

 #include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
int sock_fd;
struct  my_addr;
struct ifreq ifr;
    unsigned char * addr;
#define ETH_INTERFACE_NAME    "eth0"
    /**//* Get socket file descriptor */
    if ((sock_fd = socket(PF_INET, SOCK_DGRAM, 0)) == -1)...{
        perror("socket");
        exit(1);
    }
    /**//* Get IP Address */
    strncpy(ifr.ifr_name, ETH_INTERFACE_NAME, IF_NAMESIZE);
    ifr.ifr_name[IFNAMSIZ-1]='\0';
    if (ioctl(sock_fd, SIOCGIFADDR, &ifr) < 0)...{
        perror("ioctl");
        exit(1);
    }
    memcpy(&my_addr, &ifr.ifr_addr, sizeof(my_addr));
    addr=inet_ntoa(my_addr.sin_addr);


相关文档:

实战Linux Bluetooth编程(三) HCI层编程

1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI)  就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......

【Linux桌面应用】Linux服务配置过程

1)关闭防火墙
#service iptables stop<enter> \\关闭防火墙
#chkconfig iptables off<enter> \\关闭开机启动
2)IP地址的配置
①命令方式
#netconfig<enter>  \\设置IP地址、子网掩码、网关、DNS
#vi /etc/sysconfig/network \\主机名
#hostname XXX   \\设置主机名称
#exit  ......

linux设备驱动程序——网络设备驱动程序

Linux的网络系统主要是基于BSD Unix 的socket机制, 访问网络设备的驱动程序不需要使用设备节点。在系统和驱动程序之间定义有专门的数据结构(sk_buff)进行数据的传递。系统内部支持对发送数据和接收数据的缓存,提供流量控制机制,提供对多协议的支持。因此,选择哪个驱动程序是基于内核内部的其他决定,而不是调用open() ......

How to: Linux flush or remove all iptables rules

 
Here is small script that does this. Debian or Ubuntu GNU/Linux does
not comes with any SYS V init script (located in /etc/init.d directory)
.
You create a script as follows and use it to stop or flush the iptables rules.
Please don't type rules at command prompt. Use the script to sp ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号