亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hello_plugs.c

?? 一款基于FPGA的對于VGA實現全彩控制的程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
			{
			printf("Lookup failed!\n");
			nr_plugs_print_error_message("[dns lookup test]",result);
			}
		else
			{
			printf("The IP address of %s is ",host);
			nr_plugs_print_ip_address_decimal(ip);
			printf(".\n");
			}
		}

	return 0;
	}

#endif // SMALL

// +--------------------------------------------------
// | Arp Scan plug handler and main routine
// |

int r_arp_plug_proc(int arp_plug,
		void *context,
		ns_plugs_packet *p,
		void *payload,
		int payload_length)
	{
	ns_plugs_arp_packet *ap = payload; // get payload in proper type

	if(ap->op == nm_n2h16(ne_plugs_arp_reply)) // is it a reply we want?
		{
		// is it a reply within our own subnet (where we care?)
		if(((ap->sender_ip_address ^ g.pns.settings.ip_address) & g.pns.settings.subnet_mask) == 0)
			{
			int x;

			x = (ap->sender_ip_address >> 24) & 0xff;

			printf("arp_proc: reply from ");
			nr_plugs_print_ip_address(ap->sender_ip_address);
			printf("\n");

			g.arp_scan_replies[x] = x + 0x1000;
			}
		}
	}

int r_arp_scan(int x)
	{
	int arp_plug;
	long i;
	ns_plugs_arp_packet a;
	int result;
    ns_plugs_network_settings settings;
    net_32 our_ip_address;
    net_32 base_ip_address;

	printf("\n\n About to send ARP requests\nfor 256 addresses in subnet.\n");

    // Get our current settings for ethernet and base ip address to scan

    result = nr_plugs_get_settings(0,&settings);
    if(result < 0)
        goto go_home;

	// Create the Plug for the arp protocol

	result = nr_plugs_create(&arp_plug,ne_plugs_arp,0,r_arp_plug_proc,0,ne_plugs_flag_ethernet_broadcast);
	if(result)
		goto go_home;

	// clear the scan reply table

	for(i = 0; i < 256; i++)
		g.arp_scan_replies[i] = 0;
	
	// set up an arp request to use over & over

	a.hardware_type = nm_h2n16(1);
	a.protocol_type = nm_h2n16(0x0800);
	a.hardware_size = 6;
	a.protocol_size = 4;
	a.op = nm_h2n16(ne_plugs_arp_request);
	a.sender_ethernet_address = settings.ethernet_address;
	a.sender_ip_address = settings.ip_address;
	a.target_ethernet_address.u32 = 0;
	a.target_ethernet_address.l16 = 0;

	// Send out all the requests

	for(i = 0; i < 256; i++)
        	{
        	a.target_ip_address =
                	(settings.ip_address & nm_h2n32(0xFFFFff00)) + nm_h2n32(i);
        	nr_plugs_send(arp_plug,&a,sizeof(a),0);
        	nr_delay(4);
        	nr_plugs_idle();
        	}

	// Wait some seconds
		{
		long t0 = nr_timer_milliseconds();
		while(nr_timer_milliseconds() - t0 < 2500)
			nr_plugs_idle(); // (in case we're in polled mode operation)
		}
	
	// ----------------------------------------
	// Print out the scan result, in a sort of pretty way
	printf("\n");
	for(i = 0; i < 256; i++)
		{
		if(g.arp_scan_replies[i])
			printf("%3d ",i);
		else
			printf(" .  ");
		if(i % 16 == 15)
			printf("\n");
		}
	printf("\n");

	// close down the plug
	nr_plugs_destroy(arp_plug);
go_home:
    if(result < 0)
		nr_plugs_print_error_message("[arp scan test]",result);
	return 0;
	}

// +--------------------------------------------------
// | Packet Sniffer handler and main routine
// |

int r_eth_plug_proc(int plugHandle,
		void *context,
		ns_plugs_packet *p,
		void *payload,
		int payload_length)
	{
	g.sniff_count++;

	if(g.sniff_pause)
		printf(".");
	else
		{
		printf("------------------\n");
		printf("Packet Sniffer\n(Press <ESC> to finish sniffing, <SPACE> to pause)\n\n");

		// Use convenient packet-printing utility

		nr_plugs_print_ethernet_packet(payload,payload_length," [sniff] ");
		}

	return 0;
	}

int r_sniffer(int x)
	{
	int eth_plug;
	int i;
	ns_plugs_arp_packet a;
	int c;

	printf("\n\n About to begin displaying all\nethernet packets received.\n");

	// Create the Plug for the eth protocol

	nr_plugs_create(&eth_plug,
		ne_plugs_ethernet,
		0,
		r_eth_plug_proc,
		0,
		ne_plugs_flag_ethernet_all); // flag says, "anything the interface gets"
	
	// Wait for an escape key, and give the
	// plugs library lots of time to do its stuff.

	g.sniff_pause = 0;
	g.sniff_count = 0;

	while((c = nr_uart_rxchar(0)) != 27)
		{
		if(c == ' ')
			g.sniff_pause = !g.sniff_pause;
		nr_plugs_idle();
		}

	nr_plugs_destroy(eth_plug);

	printf("\nSniffed %d packets.\n\n",g.sniff_count);
	}

#if !SMALL
// +----------------------------------------------------
// | TCP Telnet routines
// |

typedef struct
	{
	int connected; // 0:waiting, 1:connected, 2:disconnected
	net_32 remote_ip_address;
	net_16 remote_port;

	long bytes_sent;
	long bytes_received;
	} s_telnet_status;

int tcp_listen_proc(int plug_handle,
		void *context,
		host_32 remote_ip_address,
		host_16 remote_port)
	{
	volatile s_telnet_status *status = context;

	status->connected = 1;
	status->remote_ip_address = remote_ip_address;
	status->remote_port = remote_port;

	status->bytes_sent = 0;
	status->bytes_received = 0;

	printf("[tcp_listen_proc] Accepted connection from ");
	nr_plugs_print_ip_address(nr_h2n32(remote_ip_address));
	printf(" port %d\n",remote_port);

	return 0;
	}

int tcp_proc(int plug_handle,
		void *context,
		ns_plugs_packet *p,
		void *payload,
		int payload_length)
	{
	volatile s_telnet_status *status = context;
	int i;

	if(payload)
		{
		unsigned char *s = payload;

		status->bytes_received += payload_length;

		for(i = 0; i < payload_length; i++)
			printf("%c",s[i]);

			{
			char reply[100];
			int reply_length = 0;
			// |
			// | Handle funny telnet requests
			// |

			for(i = 0; i < payload_length; i++)
				{
				if(s[i] == 255)
					{
					i++;
					if(s[i] == 253 || s[i] == 254)
						{
						reply[reply_length++] = 255;
						reply[reply_length++] = s[i++] - 2;
						reply[reply_length++] = s[i++];
						}
					}
				}

			if(reply_length)
				nr_plugs_send(plug_handle,reply,reply_length,0);
			}
		}
	else
		{
		status->connected = 2; // let them know we are disconnected
		}
	
	return 0;
	}

// +---------------------
// | Once a session is established, either by
// | listening or connecting, we can come
// | here and trade keystrokes until
// | either they disconnect or we get an
// | ESC key.
// |

int r_telnet_session(int tcp_plug, volatile s_telnet_status *status)
	{
	int still_running;
	int result = 0;

	still_running = 1;
	while(still_running)
		{
		int c;

		if((c = nr_uart_rxchar(0)) > 0)
			{
			if(c == 27)
				still_running = 0;
			else
				{
				nr_plugs_send(tcp_plug,&c,1,0);
				status->bytes_sent++;
				}
			}

		if(status->connected == 2)
			still_running = 0;

		nr_plugs_idle();
		}
	
	result = nr_plugs_connect(tcp_plug,0,0,0);
	
	printf("\nConnection closed.\n");
	printf("%d bytes sent, %d bytes received.\n\n",status->bytes_sent,status->bytes_received);

go_home:
	return result;
	}

int r_telnet_accept(int x)
	{
	long local_port = 23;
	int result;
	int tcp_plug = 0;
	int still_running;
	s_telnet_status status = {0,0,0,0,0};

	result = r_input_long("Port to listen on",&local_port);
	if(result)
		goto go_home;

	result = nr_plugs_create
			(
			&tcp_plug,
			ne_plugs_tcp,
			local_port,
			tcp_proc,
			&status,
			0
			);

	result = nr_plugs_listen
			(
			tcp_plug,
			tcp_listen_proc,
			&status
			);
	
	still_running = 1;

	// |
	// | Wait for connection to be established, then
	// | go to the session routine. (Allow ESC to
	// | bail out.)
	// |

	while(status.connected == 0)
		{
		nr_plugs_idle();
		if(nr_uart_rxchar(0) == 27)
			{
			nr_plugs_idle();
			printf("\nAborted.\n");
			goto go_home;
			}
		}
	
	result = r_telnet_session(tcp_plug,&status);

go_home:
	if(tcp_plug)
		result = nr_plugs_destroy(tcp_plug);
	return 0;
	}

int r_telnet_connect(int x)
	{
	static char *default_host = "www.altera.com";
	char host[64];
	long remote_port = 23;
	int result;
	int tcp_plug = 0;
	int still_running;
	s_telnet_status status = {0,0,0,0,0};

	host[0] = 0;

	result = r_input_string("  Internet host to connect to",default_host,host);
	if(result)
		goto go_home;

	result = r_input_long("  Port to connect to",&remote_port);
	if(result)
		goto go_home;

	result = nr_plugs_create
			(
			&tcp_plug,
			ne_plugs_tcp,
			0, // let library choose a port number
			tcp_proc,
			&status,
			0
			);

	result = nr_plugs_connect
			(
			tcp_plug,
			host,
			0,
			remote_port
			);
	
	if(result)
		{
		printf("Error connecting to host %s.\n",host);
		nr_plugs_print_error_message("[tcp connect test]",result);
		goto go_home;
		}

	result = r_telnet_session(tcp_plug,&status);
go_home:
	if(tcp_plug)
		result = nr_plugs_destroy(tcp_plug);
	return 0;
	}

// +---------------------
// | Blink the Link LED for a bit,
// | then return.
// |

int r_blink_link_led(int x)
	{
	int i;
	
#ifdef na_lan91c111_0
	printf ("\n Link must be already active for the LAN91C111.\n");
#endif

	printf("\n\n  Blinking the LED...\n");
	for(i = 0; i < 10; i++)
		{
		nr_plugs_set_mac_led(0,0);
		nr_plugs_idle();
		nr_delay(100);
		nr_plugs_set_mac_led(0,1);
		nr_plugs_idle();
		nr_delay(100);
		}
	nr_plugs_set_mac_led(0,-1);
	printf("\n\n  Done blinking the LED.\n");
	}

// +---------------------
// | Guess what the next routine does
// |


#endif // SMALL

int r_exit_to_monitor(int x)
	{
	nr_plugs_terminate();

	// Disable timer1, in case nr_timer_milliseconds() got used
#ifdef na_timer1
	na_timer1->np_timercontrol = np_timercontrol_stop_mask;
	na_timer1->np_timerstatus = 0; // clear any last irq
#endif

	exit(0);
	return 0; // (never happens)
	}

int main(void)
	{

    setbuf(stdout,0);
	// Call initialization routines

	r_initialize();


	// Set up the menus, and run them

	r_menu_set_idler((r_menu_proc)nr_plugs_idle);

	// Settings menu
	r_menu_add_item(k_menu_settings,"Network Settings",show_settings,0); // 1st item is title
	r_menu_add_item(k_menu_settings,"Reset All Settings, Attempt DHCP",r_reset_settings,0);
	r_menu_add_item(k_menu_settings,"Reinitialize",r_reinitialize,0);
	r_menu_add_item(k_menu_settings,"Enter New Settings",r_edit_settings,0);
	r_menu_add_item(k_menu_settings,"Save To Flash",r_save_settings,0);

	// Remote menu

	r_menu_add_item(k_menu_actions,"Network Actions",show_abbreviated_settings,0); // 1st item is title
#if !SMALL
	r_menu_add_item(k_menu_actions,"Ping Remote Host",r_ping_host,0);
	r_menu_add_item(k_menu_actions,"Ping Remote Host (Debug On)",r_ping_host,1);
	r_menu_add_item(k_menu_actions,"Look Up IP Address",r_dns_lookup,0);
#endif
	r_menu_add_item(k_menu_actions,"ARP Scan",r_arp_scan,0);
	r_menu_add_item(k_menu_actions,"Monitor All Traffic (Sniffer)",r_sniffer,0);
#if !SMALL
	r_menu_add_item(k_menu_actions,"Accept Telnet Connection",r_telnet_accept,0);
	r_menu_add_item(k_menu_actions,"Open Telnet Connection",r_telnet_connect,0);
	r_menu_add_item(k_menu_actions,"Blink Link LED",r_blink_link_led,0);
#endif

	// Main menu
	r_menu_add_item(0,"Main Menu",0,0);
	r_menu_add_link(0,k_menu_settings);
	r_menu_add_link(0,k_menu_actions);
	r_menu_add_item(0,"Exit to monitor",r_exit_to_monitor,0);

	r_menu_run();
	}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区三| 亚洲午夜久久久久久久久电影院| 精品一区二区三区影院在线午夜| 精品三级av在线| eeuss鲁片一区二区三区 | 丁香天五香天堂综合| 亚洲欧洲性图库| 91精品国产综合久久香蕉麻豆| 久久99精品久久只有精品| 国产精品视频在线看| 欧美日韩第一区日日骚| 福利91精品一区二区三区| 亚洲成人777| 国产欧美日韩激情| 欧美第一区第二区| 欧美日韩亚洲综合在线| 成人aa视频在线观看| 美脚の诱脚舐め脚责91| 亚洲国产另类av| 亚洲视频狠狠干| 欧美国产97人人爽人人喊| 欧美成人猛片aaaaaaa| 7777精品伊人久久久大香线蕉的 | 一个色在线综合| 中文字幕一区二区三区在线不卡 | 久久午夜色播影院免费高清| 在线观看一区二区精品视频| 一本久久综合亚洲鲁鲁五月天| 国产精品18久久久久久vr| 国产麻豆视频一区二区| 天天操天天色综合| 亚洲永久免费av| 亚洲国产精品久久不卡毛片| 亚洲综合激情小说| 亚洲成av人**亚洲成av**| 亚洲永久免费av| 久久成人精品无人区| 国产激情精品久久久第一区二区| 黄一区二区三区| 成人国产在线观看| 在线视频国内自拍亚洲视频| 欧美美女一区二区三区| 日韩亚洲欧美在线观看| 国产午夜亚洲精品理论片色戒| 亚洲免费观看高清完整版在线| 久久精品综合网| 国产最新精品免费| 国产99精品国产| 日本韩国欧美一区| 欧美精品一区二区久久久| 国产婷婷精品av在线| 亚洲成在人线免费| proumb性欧美在线观看| 日韩小视频在线观看专区| 久久―日本道色综合久久| 中文字幕一区二区三区av| 日韩国产欧美在线视频| 成人动漫精品一区二区| 日韩欧美成人一区二区| 一区二区三区在线免费观看| 高清免费成人av| 精品入口麻豆88视频| 亚洲.国产.中文慕字在线| 成人h动漫精品一区二区| 久久久久久久综合狠狠综合| 视频一区视频二区中文| 欧美视频中文字幕| 亚洲一区二区三区小说| 91在线免费看| 一区二区三区四区国产精品| 99精品久久久久久| 综合自拍亚洲综合图不卡区| 99久久精品情趣| 亚洲嫩草精品久久| 欧美三级三级三级爽爽爽| 亚洲自拍欧美精品| 91精品国产综合久久婷婷香蕉| 一个色在线综合| 日韩一区二区免费高清| 精品在线观看免费| 国产精品国产三级国产专播品爱网 | 欧美吞精做爰啪啪高潮| 午夜精品在线看| 欧美mv日韩mv亚洲| 国产a级毛片一区| 亚洲精品中文在线影院| 日韩一区二区三区四区五区六区| 日本不卡视频在线| 国产精品乱码一区二三区小蝌蚪| av一二三不卡影片| 久久99精品久久久| 亚洲欧美另类在线| 精品福利av导航| 91网上在线视频| 国内成人免费视频| 亚洲一区二区三区四区在线| 欧美变态凌虐bdsm| 欧美亚洲日本国产| 色综合久久综合| 粉嫩aⅴ一区二区三区四区| 亚洲妇女屁股眼交7| 国产精品久久久久久久久搜平片| 欧美精品丝袜中出| 在线视频国产一区| 91丝袜美腿高跟国产极品老师 | 国产又粗又猛又爽又黄91精品| 亚洲色图19p| 国产精品午夜免费| 久久精品亚洲麻豆av一区二区| 欧美顶级少妇做爰| 欧美色涩在线第一页| 欧美日韩免费观看一区三区| 成人aaaa免费全部观看| av亚洲精华国产精华| 成人免费看黄yyy456| 成人av网站在线| 不卡免费追剧大全电视剧网站| 国产综合色视频| 韩国一区二区在线观看| 国产九色sp调教91| 成人性生交大片免费| 91蜜桃网址入口| 制服丝袜成人动漫| 欧美精品一区二区三区蜜臀| 国产精品色眯眯| 亚洲一区二区欧美日韩| 免费观看91视频大全| 国产精品资源网| 一本久久a久久精品亚洲| 欧美视频日韩视频在线观看| 日韩一区二区三区视频在线| 精品国产乱码久久久久久闺蜜| 国产女人水真多18毛片18精品视频| 国产性天天综合网| 日韩中文字幕区一区有砖一区| 久99久精品视频免费观看| 91一区二区三区在线播放| 欧美一区二区三区在线| 国产精品色噜噜| 国产中文一区二区三区| 欧美日韩成人综合天天影院| 中文字幕不卡在线播放| 免费在线看一区| 99久久综合国产精品| 精品国产三级电影在线观看| 亚洲欧美电影院| 91在线你懂得| 中文字幕一区二区视频| 国产一区二区不卡| 久久久久国产精品免费免费搜索| 亚洲国产视频在线| 在线观看免费亚洲| 中文字幕在线视频一区| 国产999精品久久| 中文字幕免费观看一区| 国产成人h网站| 中文字幕在线不卡视频| 99精品桃花视频在线观看| 欧美国产精品久久| 色婷婷av一区| 婷婷开心激情综合| 久久久一区二区三区捆绑**| 国产不卡一区视频| 亚洲国产精品成人综合色在线婷婷| 国产精品主播直播| 亚洲视频免费在线| 6080亚洲精品一区二区| 毛片不卡一区二区| 国产精品传媒入口麻豆| 色婷婷国产精品| 免费成人你懂的| 日韩美女久久久| 91精品啪在线观看国产60岁| 精久久久久久久久久久| 亚洲视频综合在线| 日韩欧美第一区| 欧洲精品一区二区| 国产一区999| 日本在线播放一区二区三区| 国产欧美精品一区二区色综合朱莉| 成人高清av在线| 国产一区欧美日韩| 亚洲成av人片在线| 综合在线观看色| 2014亚洲片线观看视频免费| 欧美日韩在线不卡| 99精品桃花视频在线观看| 国产精品一二三四五| 日韩黄色在线观看| 亚洲综合一二区| 亚洲麻豆国产自偷在线| 国产精品传媒视频| 国产日韩欧美a| 久久久久国色av免费看影院| 精品久久久久久最新网址| 日韩丝袜美女视频| 日韩免费电影网站| 欧美一区二区三区四区高清| 欧美女孩性生活视频| 欧美日韩精品免费观看视频 |