In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
# include "stdafx.h"
# include
# include
# include
Void main (int argc, char * * argv)
{
Pcap_t * fp
Char errbuf[PCAP _ ERRBUF_SIZE]
U_char packet [100]
Int i
Pcap_if_t * alldevs
Pcap_if_t * d
Int inum
Int jung0
/ * get the list of devices * /
If (pcap_findalldevs_ex (PCAP_SRC_IF_STRING, NULL, & alldevs, errbuf) =-1)
{
Fprintf (stderr, "Error in pcap_findalldevs:% s\ n", errbuf)
Exit (1)
}
/ * print list * /
For (dudes alldevs; d; dudes-> next)
{
Printf ("d. S", + + j, d-> name)
If (d-> description)
Printf ("(% s)\ n", d-> description)
Else
Printf ("(No description available)\ n")
}
If (jacks 0)
{
Printf ("\ nNo interfaces found! Make sure WinPcap is installed.\ n")
Return
}
Printf ("Enter the interface number (1M% d):", j)
Scanf ("d", & inum)
If (inum
< 1 || inum >j)
{
Printf ("\ nInterface number out of range.\ n")
/ * release device list * /
Pcap_freealldevs (alldevs)
Return
}
/ * Jump to selected device * /
For (d=alldevs, juni0; j
< inum-1 ;d=d->Next, jacks +)
/ * Open the output device * /
If ((fp= pcap_open (d-> name, / / device name)
100, / / part to be captured (only the first 100 bytes are captured)
PCAP_OPENFLAG_PROMISCUOUS, / / hybrid mode
1000, / / read timeout
NULL, / / remote machine verification
Errbuf / / error buffering
)) = = NULL)
{
Fprintf (stderr, "\ nUnable to open the adapter.% s is not supported by WinPcap\ n", argv [1])
Return
}
Pcap_freealldevs (alldevs)
/ * suppose that on Ethernet, the destination address of MAC is set to 1: 1 * /
Packet [0] = 255
Packet [1] = 255
Packet [2] = 255
Packet [3] = 255
Packet [4] = 255
Packet [5] = 255
/ * set the MAC source address to 2 * /
Packet [6] = 10
Packet [7] = 10
Packet [8] = 10
Packet [9] = 10
Packet [10] = 10
Packet [11] = 10
Packet [12] = 96
Packet [13] = 00
/ * fill in the rest * /
For (iTunes 14)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.