Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
icsetsrc.c,v
Package: icmp.rar [view]
Upload User: lywr2008
Upload Date: 2022-05-26
Package Size: 9k
Code Size: 1k
Category:
Linux Network
Development Platform:
Unix_Linux
- head 1.1;
- access;
- symbols;
- locks
- dls:1.1; strict;
- comment @ * @;
- 1.1
- date 97.09.21.19.26.41; author dls; state Dist;
- branches;
- next ;
- desc
- @@
- 1.1
- log
- @pre-3e code
- @
- text
- @/* icsetsrc.c - icsetsrc */
- #include <conf.h>
- #include <kernel.h>
- #include <network.h>
- /*------------------------------------------------------------------------
- * icsetsrc - set the source address on an ICMP packet
- *------------------------------------------------------------------------
- */
- void icsetsrc(pip)
- struct ip *pip;
- {
- int i;
- for (i=0; i<Net.nif; ++i) {
- if (i == NI_LOCAL)
- continue;
- if (netmatch(pip->ip_dst,nif[i].ni_ip,nif[i].ni_mask,0))
- break;
- }
- if (i == Net.nif)
- pip->ip_src = ip_anyaddr;
- else
- pip->ip_src = nif[i].ni_ip;
- }
- @