⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcp.lst

📁 ENC28J60 System HTTP
💻 LST
📖 第 1 页 / 共 5 页
字号:
 519:net/tcp.c     **** 		#endif
 180               	ovw r24,r20
 181               		movw r22,r18
 182 0072 CA01      		call arp_search_by_ip
 183 0074 B901      		movw r18,r24
 185 007a 9C01      	.LM3:
 520:net/tcp.c     **** s[socketnum].source_ip);
 521:net/tcp.c     **** 		softuart_puts_progmem(" outside home net -> use gateway\r\n");
 186               	24,hi8(-1)
 187               		cpi r18,lo8(-1)
 188 007c 8FEF      		cpc r19,r24
 189 007e 2F3F      		brne .L3
 191 0082 01F4      	.LM4:
 522:net/tcp.c     **** tcp_sockets[socketnum].source_ip);
 523:net/tcp.c     **** 		softuart_puts_progmem(" outside home net -> use gateway\r\n");
 524:net/tcp.c     **** 		#endif
 525:net/tcp.c     **** 		ip = &nic_gateway_ip;
 526:net/tcp.c     **** 	}else{
 527:net/tcp.c     **** 		ip = &tcp_sockets[socketnum].source_ip;
 528:net/tcp.c     **** 	}
 529:net/tcp.c     **** 
 530:net/tcp.c     **** 	arp_idx = arp_search_by_ip(*ip);
 531:net/tcp.c     **** 
 532:net/tcp.c     **** 	if (arp_idx == -1){
 533:net/tcp.c     **** 		//target ip (gateway) unknown
 534:net/tcp.c     **** 		
 535:net/tcp.c     **** 		#if TCP_DEBUG
 536:net/tcp.c     **** 		softuart_puts_progmem("TCP : ERR ARP UKNWN: ");
 537:net/tcp.c     **** 		softuart_put_ip(tcp_sockets[socketnum].source_ip);
 538:net/tcp.c     **** 		#endif
 539:net/tcp.c     **** 		
 540:net/tcp.c     **** 		//normal solution:
 541:net/tcp.c     **** 		//arp_send_request(buffer, ip);
 542:net/tcp.c     **** 		//return; //<- must be called again !!!
 192               	24,lo8(19)
 193               		ldi r25,hi8(19)
 194 0084 83E1      		mul r16,r24
 195 0086 90E0      		movw r30,r0
 196 0088 089F      		mul r16,r25
 197 008a F001      		add r31,r0
 198 008c 099F      		mul r17,r24
 199 008e F00D      		add r31,r0
 200 0090 189F      		clr r1
 201 0092 F00D      		subi r30,lo8(-(tcp_sockets))
 202 0094 1124      		sbci r31,hi8(-(tcp_sockets))
 203 0096 E050      		ldd r20,Z+4
 204 0098 F040      		ldd r21,Z+5
 205 009a 4481      		ldd r22,Z+6
 206 009c 5581      		ldd r23,Z+7
 207 009e 6681      		movw r24,r28
 208 00a0 7781      		adiw r24,6
 209 00a2 CE01      		call arp_add_mac2ip
 210 00a4 0696      		movw r18,r24
 211 00a6 0E94 0000 	.L3:
 213               	.LM5:
 543:net/tcp.c     **** ion:
 544:net/tcp.c     **** 		//arp_send_request(buffer, ip);
 545:net/tcp.c     **** 		//return; //<- must be called again !!!
 546:net/tcp.c     **** 
 547:net/tcp.c     **** 		///FIXME
 548:net/tcp.c     **** 		#if TCP_DEBUG
 214               	r25,hi8(19)
 215               		mul r16,r24
 216 00ac 83E1      		movw r22,r0
 217 00ae 90E0      		mul r16,r25
 218 00b0 089F      		add r23,r0
 219 00b2 B001      		mul r17,r24
 220 00b4 099F      		add r23,r0
 221 00b6 700D      		clr r1
 222 00b8 189F      		movw r20,r18
 223 00ba 700D      		ldi r27,3
 224 00bc 1124      	1:	lsl r20
 225 00be A901      		rol r21
 226 00c0 B3E0      		dec r27
 227 00c2 440F      		brne 1b
 228 00c4 551F      		lsl r18
 229 00c6 BA95      		rol r19
 230 00c8 01F4      		add r20,r18
 231 00ca 220F      		adc r21,r19
 232 00cc 331F      		subi r20,lo8(-(arp_table+4))
 233 00ce 420F      		sbci r21,hi8(-(arp_table+4))
 234 00d0 531F      		ldi r31,lo8(tcp_sockets)
 235 00d2 4050      		mov r10,r31
 236 00d4 5040      		ldi r31,hi8(tcp_sockets)
 237 00d6 F0E0      		mov r11,r31
 238 00d8 AF2E      		add r10,r22
 239 00da F0E0      		adc r11,r23
 240 00dc BF2E      		movw r30,r10
 241 00de A60E      		ldd r18,Z+2
 242 00e0 B71E      		ldd r19,Z+3
 243 00e2 F501      		ld r16,Z
 244 00e4 2281      		ldd r17,Z+1
 245 00e6 3381      		ldi r24,lo8(20)
 246 00e8 0081      		ldi r25,hi8(20)
 247 00ea 1181      		add r8,r24
 248 00ec 84E1      		adc r9,r25
 249 00ee 90E0      		movw r24,r28
 250 00f0 880E      		subi r22,lo8(-(tcp_sockets+4))
 251 00f2 991E      		sbci r23,hi8(-(tcp_sockets+4))
 252 00f4 CE01      		ldi r30,lo8(6)
 253 00f6 6050      		mov r14,r30
 254 00f8 7040      		movw r12,r8
 255 00fa E6E0      		call ip_generate_packet
 256 00fc EE2E      		ldi r30,lo8(2)
 257 00fe 6401      		ldi r31,hi8(2)
 258 0100 0E94 0000 		add r10,r30
 259 0104 E2E0      		adc r11,r31
 261 0108 AE0E      	.LM6:
 262 010a BF1E      		movw r30,r10
 549:net/tcp.c     **** r, ip);
 550:net/tcp.c     **** 		//return; //<- must be called again !!!
 551:net/tcp.c     **** 
 552:net/tcp.c     **** 		///FIXME
 553:net/tcp.c     **** 		#if TCP_DEBUG
 554:net/tcp.c     **** 		softuart_puts_progmem("-> calling arp'hack to add mac<->ip mapping");
 555:net/tcp.c     **** 		softuart_putnewline();
 556:net/tcp.c     **** 		#endif
 557:net/tcp.c     **** 		
 558:net/tcp.c     **** 		//but we do not want to wait for arp request etc
 263               	dd r10,r18
 264               		adc r11,r19
 265 010c F501      		std Y+34,r24
 267 0110 2EEF      	.LM7:
 268 0112 3FEF      		movw r30,r10
 269 0114 A20E      		ldd r24,Z+2
 270 0116 B31E      		std Y+35,r24
 559:net/tcp.c     **** ewline();
 272               	d r24,Z+1
 273               		std Y+36,r24
 275 011c 8281      	.LM9:
 276 011e 8BA3      		ld r24,Z
 560:net/tcp.c     **** em("-> calling arp'hack to add mac<->ip mapping");
 561:net/tcp.c     **** 		softuart_putnewline();
 562:net/tcp.c     **** 		#endif
 277               	Y+37,r24
 279 0120 8181      	.LM10:
 280 0122 8CA3      		ldd r20,Z+8
 563:net/tcp.c     **** ling arp'hack to add mac<->ip mapping");
 281               	 r21,Z+9
 282               		ldd r22,Z+10
 283 0124 8081      		ldd r23,Z+11
 284 0126 8DA3      		movw r24,r28
 564:net/tcp.c     **** EBUG
 565:net/tcp.c     **** 		softuart_puts_progmem("-> calling arp'hack to add mac<->ip mapping");
 566:net/tcp.c     **** 		softuart_putnewline();
 285               	w r24,38
 286               		call nic_seq_to_buffer
 288 012a 5185      	.LM11:
 289 012c 6285      		movw r30,r10
 290 012e 7385      		ldd r20,Z+12
 291 0130 CE01      		ldd r21,Z+13
 292 0132 8696      		ldd r22,Z+14
 293 0134 0E94 0000 		ldd r23,Z+15
 567:net/tcp.c     **** em("-> calling arp'hack to add mac<->ip mapping");
 568:net/tcp.c     **** 		softuart_putnewline();
 569:net/tcp.c     **** 		#endif
 570:net/tcp.c     **** 		
 571:net/tcp.c     **** 		//but we do not want to wait for arp request etc
 572:net/tcp.c     **** 		//we received an ip packet and we did not touch the mac header etc yet!
 573:net/tcp.c     **** 		//-> the source mac is still in buffer! -> use this !
 294               	,r28
 295               		adiw r24,42
 296 0138 F501      		call nic_seq_to_buffer
 298 013c 5585      	.LM12:
 299 013e 6685      		ldi r24,lo8(80)
 300 0140 7785      		std Y+46,r24
 302 0144 8A96      	.LM13:
 303 0146 0E94 0000 		std Y+47,r15
 574:net/tcp.c     **** eader etc yet!
 575:net/tcp.c     **** 		//-> the source mac is still in buffer! -> use this !
 576:net/tcp.c     **** 		arp_idx = arp_add_mac2ip(&buffer[ETHERNET_POS_SRC_MAC], tcp_sockets[socketnum].source_ip);
 304               	,0,582,.LM14-.LFBB1
 305               	.LM14:
 306 014a 80E5      		ldi r24,lo8(3)
 307 014c 8EA7      		std Y+48,r24
 577:net/tcp.c     **** 2ip(&buffer[ETHERNET_POS_SRC_MAC], tcp_sockets[socketnum].source_ip);
 578:net/tcp.c     **** 	}
 579:net/tcp.c     **** 	///softuart_puts_progmem("<tcp packet sent> ");
 308               	abn	68,0,583,.LM15-.LFBB1
 309               	.LM15:
 310 014e FFA6      		ldi r24,lo8(-58)
 580:net/tcp.c     **** um].source_ip);
 581:net/tcp.c     **** 	}
 582:net/tcp.c     **** 	///softuart_puts_progmem("<tcp packet sent> ");
 311               	d Y+49,r24
 313 0150 83E0      	.LM16:
 314 0152 88AB      		std Y+50,__zero_reg__
 583:net/tcp.c     **** um].source_ip);
 315               	abn	68,0,587,.LM17-.LFBB1
 316               	.LM17:
 317 0154 86EC      		std Y+51,__zero_reg__
 584:net/tcp.c     **** 2ip(&buffer[ETHERNET_POS_SRC_MAC], tcp_sockets[socketnum].source_ip);
 585:net/tcp.c     **** 	}
 586:net/tcp.c     **** 	///softuart_puts_progmem("<tcp packet sent> ");
 319               	8:
 320               		std Y+52,__zero_reg__
 587:net/tcp.c     **** um].source_ip);
 322               	19:
 323               		std Y+53,__zero_reg__
 588:net/tcp.c     **** 2ip(&buffer[ETHERNET_POS_SRC_MAC], tcp_sockets[socketnum].source_ip);
 589:net/tcp.c     **** 	}
 590:net/tcp.c     **** 	///softuart_puts_progmem("<tcp packet sent> ");
 325               	20:
 326               		ldi r18,lo8(6)
 327 015c 1CAA      		ldi r19,hi8(6)
 591:net/tcp.c     **** um].source_ip);
 328               	d r8,r18
 329               		adc r9,r19
 330 015e 1DAA      		movw r18,r8
 592:net/tcp.c     **** 2ip(&buffer[ETHERNET_POS_SRC_MAC], tcp_sockets[socketnum].source_ip);
 593:net/tcp.c     **** 	}
 594:net/tcp.c     **** 	///softuart_puts_progmem("<tcp packet sent> ");
 595:net/tcp.c     **** 	
 596:net/tcp.c     **** 
 597:net/tcp.c     **** 	//generate ip packet:
 598:net/tcp.c     **** 	ip_generate_packet(buffer, 
 599:net/tcp.c     **** 		&(tcp_sockets[socketnum].source_ip), 
 600:net/tcp.c     **** 		(arp_table[arp_idx].mac),
 331               	i r20,lo8(0)
 332               		ldi r21,hi8(0)
 333 0160 26E0      		ldi r24,lo8(2)
 334 0162 30E0      		ldi r25,hi8(2)
 335 0164 820E      		add r8,r24
 336 0166 931E      		adc r9,r25
 337 0168 9401      		movw r24,r28
 338 016a 40E0      		adiw r24,26
 339 016c 50E0      		movw r22,r8
 340 016e 82E0      		call nethelp_checksum
 342 0172 880E      	.LM21:
 343 0174 991E      		std Y+50,r25
 345 0178 4A96      	.LM22:
 346 017a B401      		std Y+51,r24
 601:net/tcp.c     **** p_sockets[socketnum].source_ip), 
 602:net/tcp.c     **** 		(arp_table[arp_idx].mac),
 603:net/tcp.c     **** 		tcp_sockets[socketnum].dest_port,
 348               	o8(26)
 349               		ldi r31,hi8(26)
 350 0180 9AAB      		add r8,r30
 604:net/tcp.c     **** arp_table[arp_idx].mac),
 351               	c r9,r31
 352               		movw r24,r28
 353 0182 8BAB      		movw r22,r8
 605:net/tcp.c     **** p_sockets[socketnum].source_ip), 
 606:net/tcp.c     **** 		(arp_table[arp_idx].mac),
 607:net/tcp.c     **** 		tcp_sockets[socketnum].dest_port,
 354               	ll nic_send_packet
 355               	/* epilogue start */
 357 0186 F0E0      	.LM24:
 358 0188 8E0E      		pop r29
 359 018a 9F1E      		pop r28
 360 018c CE01      		pop r17
 361 018e B401      		pop r16
 362 0190 0E94 0000 		pop r15
 363               		pop r14
 608:net/tcp.c     **** arp_table[arp_idx].mac),
 609:net/tcp.c     **** 		tcp_sockets[socketnum].dest_port,
 364               	pop r12
 365               		pop r11
 366 0194 DF91      		pop r10
 367 0196 CF91      		pop r9
 368 0198 1F91      		pop r8
 369 019a 0F91      		ret
 374 01a4 BF90      	.Lscope1:
 377 01aa 8F90      	.global	tcp_close_socket
 379               	tcp_close_socket:
 381               	.LM25:
 382               	.LFBB2:
 383               	/* prologue: function */
 384               	/* frame size = 0 */
 386               	.LM26:
 387               		mov r20,r24
 388               		ldi r21,lo8(0)
 389               		ldi r18,lo8(19)
 390               		ldi r19,hi8(19)
 391               		mul r20,r18
 392               		movw r30,r0
 393               		mul r20,r19
 394               		add r31,r0
 395               		mul r21,r18
 396 01ae 482F      		add r31,r0
 397 01b0 50E0      		clr r1
 398 01b2 23E1      		subi r30,lo8(-(tcp_sockets))
 399 01b4 30E0      		sbci r31,hi8(-(tcp_sockets))
 400 01b6 429F      		std Z+16,__zero_reg__
 402 01ba 439F      	.LM27:
 403 01bc F00D      		call httpd_cleanup_conn
 404 01be 529F      	/* epilogue start */
 406 01c2 1124      	.LM28:
 407 01c4 E050      		ret
 409 01c8 108A      	.Lscope2:
 411               	.global	tcp_ttl_cleanup
 413               	tcp_ttl_cleanup:
 415               	.LM29:
 416 01ce 0895      	.LFBB3:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -