91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 137KB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-05
  • 語(yǔ)言: C/C++
  • 標(biāo)簽:

資源簡(jiǎn)介

libnet是一個(gè)小型的接口函數(shù)庫(kù),主要用C語(yǔ)言寫成,提供了低層網(wǎng)絡(luò)數(shù)據(jù)包的構(gòu)造、處理和發(fā)送功能。libnet的開(kāi)發(fā)目的是:建立一個(gè)簡(jiǎn)單統(tǒng)一的網(wǎng)絡(luò)編程接口以屏蔽不同操作系統(tǒng)底層網(wǎng)絡(luò)編程的差別,使得程序員將精力集中在解決關(guān)鍵問(wèn)題上。 該源碼包已經(jīng)經(jīng)過(guò)測(cè)試,可正常使用!

資源截圖

代碼片段和文件信息

/*
?*??$Id:?libnet-example-1.cv?1.1.1.1?2000/05/25?00:28:49?route?Exp?$
?*
?*??libnet?example?code
?*??example?1:??raw?socket?api?/?TCP?packet
?*
?*??Copyright?(c)?1998?-?2001?Mike?D.?Schiffman?
?*??All?rights?reserved.
?*
?*?Redistribution?and?use?in?source?and?binary?forms?with?or?without
?*?modification?are?permitted?provided?that?the?following?conditions
?*?are?met:
?*?1.?Redistributions?of?source?code?must?retain?the?above?copyright
?*????notice?this?list?of?conditions?and?the?following?disclaimer.
?*?2.?Redistributions?in?binary?form?must?reproduce?the?above?copyright
?*????notice?this?list?of?conditions?and?the?following?disclaimer?in?the
?*????documentation?and/or?other?materials?provided?with?the?distribution.
?*
?*?THIS?SOFTWARE?IS?PROVIDED?BY?THE?AUTHOR?AND?CONTRIBUTORS?‘‘AS?IS‘‘?AND
?*?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT?LIMITED?TO?THE
?*?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR?A?PARTICULAR?PURPOSE
?*?ARE?DISCLAIMED.??IN?NO?EVENT?SHALL?THE?AUTHOR?OR?CONTRIBUTORS?BE?LIABLE
?*?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL?SPECIAL?EXEMPLARY?OR?CONSEQUENTIAL
?*?DAMAGES?(INCLUDING?BUT?NOT?LIMITED?TO?PROCUREMENT?OF?SUBSTITUTE?GOODS
?*?OR?SERVICES;?LOSS?OF?USE?DATA?OR?PROFITS;?OR?BUSINESS?INTERRUPTION)
?*?HOWEVER?CAUSED?AND?ON?ANY?THEORY?OF?LIABILITY?WHETHER?IN?CONTRACT?STRICT
?*?LIABILITY?OR?TORT?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)?ARISING?IN?ANY?WAY
?*?OUT?OF?THE?USE?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE?POSSIBILITY?OF
?*?SUCH?DAMAGE.
?*
?*/

#include?

void?usage(char?*);

int
main(int?argc?char?**argv)
{
????int?network?packet_size?c;
????u_long?src_ip?dst_ip;
????u_short?src_prt?dst_prt;
????u_char?*cp?*packet;

????printf(“l(fā)ibnet?example?code:\tmodule?1\n\n“);
????printf(“packet?injection?interface:\traw?socket\n“);
????printf(“packet?type:\t\t\tTCP?[no?payload]\n“);

????src_ip??=?0;
????dst_ip??=?0;
????src_prt?=?0;
????dst_prt?=?0;

????while((c?=?getopt(argc?argv?“d:s:“))?!=?EOF)
????{??????
????????switch?(c)
????????{
????????????/*
?????????????*??We?expect?the?input?to?be?of?the?form?‘ip.ip.ip.ip.port‘.??We
?????????????*??point?cp?to?the?last?dot?of?the?IP?address/port?string?and
?????????????*??then?seperate?them?with?a?NULL?byte.??The?optarg?now?points?to
?????????????*??just?the?IP?address?and?cp?points?to?the?port.
?????????????*/
????????????case?‘d‘:
????????????????if?(!(cp?=?strrchr(optarg?‘.‘)))
????????????????{
????????????????????usage(argv[0]);
????????????????}
????????????????*cp++?=?0;
????????????????dst_prt?=?(u_short)atoi(cp);
????????????????if?(!(dst_ip?=?libnet_name_resolve(optarg?LIBNET_RESOLVE)))
????????????????{
????????????????????libnet_error(LIBNET_ERR_FATAL?“Bad?destination?IP?address:?%s\n“?optarg);
????????????????}
????????????????break;
????????????case?‘s‘:
????????????????if?(!(cp?=?strrchr(optarg?‘.‘)))
????????????????{
????????????????????usage(argv[0]);
????????????????}
????????????????*cp++?=?0;
?????

評(píng)論

共有 條評(píng)論

相關(guān)資源