📄 uip.lst
字号:
293:uip.c **** } else if(uip_conn->tcpstateflags != CLOSED) {
243 .stabn 68,0,293,.LM28-uip_process
244 .LM28:
245 00ea 8823 tst r24
246 00ec 09F4 brne .+2
247 00ee C1C4 rjmp .L58
294:uip.c **** /* If the connection has outstanding data, we increase the
295:uip.c **** connection's timer and see if it has reached the RTO value
296:uip.c **** in which case we retransmit. */
297:uip.c **** if(uip_conn->tcpstateflags & UIP_OUTSTANDING) {
248 .stabn 68,0,297,.LM29-uip_process
249 .LM29:
250 00f0 9927 clr r25
251 00f2 84FF sbrs r24,4
252 00f4 4EC0 rjmp .L37
298:uip.c **** --(uip_conn->timer);
253 .stabn 68,0,298,.LM30-uip_process
254 .LM30:
255 00f6 8689 ldd r24,Z+22
256 00f8 8150 subi r24,lo8(-(-1))
257 00fa 868B std Z+22,r24
299:uip.c **** if(uip_conn->timer == 0) {
258 .stabn 68,0,299,.LM31-uip_process
259 .LM31:
260 00fc E091 0000 lds r30,uip_conn
261 0100 F091 0000 lds r31,(uip_conn)+1
262 0104 8689 ldd r24,Z+22
263 0106 8823 tst r24
264 0108 09F0 breq .+2
265 010a B3C4 rjmp .L58
300:uip.c ****
301:uip.c **** if(uip_conn->nrtx == UIP_MAXRTX) {
266 .stabn 68,0,301,.LM32-uip_process
267 .LM32:
268 010c 2789 ldd r18,Z+23
269 010e 2830 cpi r18,lo8(8)
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s page 11
270 0110 39F4 brne .L39
302:uip.c **** uip_conn->tcpstateflags = CLOSED;
271 .stabn 68,0,302,.LM33-uip_process
272 .LM33:
273 0112 8083 st Z,r24
303:uip.c ****
304:uip.c **** /* We call UIP_APPCALL() with uip_flags set to
305:uip.c **** UIP_TIMEDOUT to inform the application that the
306:uip.c **** connection has timed out. */
307:uip.c **** uip_flags = UIP_TIMEDOUT;
274 .stabn 68,0,307,.LM34-uip_process
275 .LM34:
276 0114 80E8 ldi r24,lo8(-128)
277 0116 8093 0000 sts uip_flags,r24
308:uip.c **** UIP_APPCALL();
278 .stabn 68,0,308,.LM35-uip_process
279 .LM35:
280 011a 0E94 0000 call appEvent
309:uip.c ****
310:uip.c **** /* We also send a reset packet to the remote host. */
311:uip.c **** BUF->flags = TCP_RST | TCP_ACK;
281 .stabn 68,0,311,.LM36-uip_process
282 .LM36:
283 011e 7BC3 rjmp .L182
284 .L39:
312:uip.c **** goto tcp_send_nodata;
313:uip.c **** }
314:uip.c ****
315:uip.c **** /* Exponential backoff. */
316:uip.c **** uip_conn->timer = UIP_RTO << (uip_conn->nrtx > 4? 4: uip_conn->nrtx);
285 .stabn 68,0,316,.LM37-uip_process
286 .LM37:
287 0120 2530 cpi r18,lo8(5)
288 0122 40F4 brsh .L41
289 0124 83E0 ldi r24,lo8(3)
290 0126 90E0 ldi r25,hi8(3)
291 0128 02C0 rjmp 2f
292 012a 880F 1: lsl r24
293 012c 991F rol r25
294 012e 2A95 2: dec r18
295 0130 E2F7 brpl 1b
296 0132 01C0 rjmp .L42
297 .L41:
298 0134 80E3 ldi r24,lo8(48)
299 .L42:
300 0136 868B std Z+22,r24
317:uip.c ****
318:uip.c **** ++(uip_conn->nrtx);
301 .stabn 68,0,318,.LM38-uip_process
302 .LM38:
303 0138 E091 0000 lds r30,uip_conn
304 013c F091 0000 lds r31,(uip_conn)+1
305 0140 8789 ldd r24,Z+23
306 0142 8F5F subi r24,lo8(-(1))
307 0144 878B std Z+23,r24
319:uip.c ****
320:uip.c **** /* Ok, so we need to retransmit. We do this differently
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s page 12
321:uip.c **** depending on which state we are in. In ESTABLISHED, we
322:uip.c **** call upon the application so that it may prepare the
323:uip.c **** data for the retransmit. In SYN_RCVD, we resend the
324:uip.c **** SYNACK that we sent earlier and in LAST_ACK we have to
325:uip.c **** retransmit our FINACK. */
326:uip.c **** UIP_STAT(++uip_stat.tcp.rexmit);
327:uip.c **** switch(uip_conn->tcpstateflags & TS_MASK) {
308 .stabn 68,0,327,.LM39-uip_process
309 .LM39:
310 0146 E091 0000 lds r30,uip_conn
311 014a F091 0000 lds r31,(uip_conn)+1
312 014e 8081 ld r24,Z
313 0150 9927 clr r25
314 0152 8F70 andi r24,lo8(15)
315 0154 9070 andi r25,hi8(15)
316 0156 8430 cpi r24,4
317 0158 9105 cpc r25,__zero_reg__
318 015a 09F4 brne .+2
319 015c 70C3 rjmp .L183
320 015e 8530 cpi r24,5
321 0160 9105 cpc r25,__zero_reg__
322 0162 3CF4 brge .L54
323 0164 8130 cpi r24,1
324 0166 9105 cpc r25,__zero_reg__
325 0168 09F4 brne .+2
326 016a 60C2 rjmp .L45
327 016c 0397 sbiw r24,3
328 016e 49F0 breq .L46
329 0170 80C4 rjmp .L58
330 .L54:
331 0172 8630 cpi r24,6
332 0174 9105 cpc r25,__zero_reg__
333 0176 09F4 brne .+2
334 0178 62C3 rjmp .L183
335 017a 0897 sbiw r24,8
336 017c 09F4 brne .+2
337 017e 5FC3 rjmp .L183
338 0180 78C4 rjmp .L58
339 .L46:
328:uip.c **** case SYN_RCVD:
329:uip.c **** /* In the SYN_RCVD state, we should retransmit our
330:uip.c **** SYNACK. */
331:uip.c **** goto tcp_send_synack;
332:uip.c ****
333:uip.c **** #if UIP_ACTIVE_OPEN
334:uip.c **** case SYN_SENT:
335:uip.c **** /* In the SYN_SENT state, we retransmit out SYN. */
336:uip.c **** BUF->flags = 0;
337:uip.c **** goto tcp_send_syn;
338:uip.c **** #endif /* UIP_ACTIVE_OPEN */
339:uip.c ****
340:uip.c **** case ESTABLISHED:
341:uip.c **** /* In the ESTABLISHED state, we call upon the application
342:uip.c **** to do the actual retransmit after which we jump into
343:uip.c **** the code for sending out the packet (the apprexmit
344:uip.c **** label). */
345:uip.c **** uip_len = 0;
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s page 13
340 .stabn 68,0,345,.LM40-uip_process
341 .LM40:
342 0182 1092 0000 sts uip_len,__zero_reg__
346:uip.c **** uip_flags = UIP_REXMIT;
343 .stabn 68,0,346,.LM41-uip_process
344 .LM41:
345 0186 84E0 ldi r24,lo8(4)
346 0188 8093 0000 sts uip_flags,r24
347:uip.c **** UIP_APPCALL();
347 .stabn 68,0,347,.LM42-uip_process
348 .LM42:
349 018c 0E94 0000 call appEvent
348:uip.c **** goto apprexmit;
350 .stabn 68,0,348,.LM43-uip_process
351 .LM43:
352 0190 71C3 rjmp .L47
353 .L37:
349:uip.c ****
350:uip.c **** case FIN_WAIT_1:
351:uip.c **** case CLOSING:
352:uip.c **** case LAST_ACK:
353:uip.c **** /* In all these states we should retransmit a FINACK. */
354:uip.c **** goto tcp_send_finack;
355:uip.c ****
356:uip.c **** }
357:uip.c **** }
358:uip.c **** } else if((uip_conn->tcpstateflags & TS_MASK) == ESTABLISHED) {
354 .stabn 68,0,358,.LM44-uip_process
355 .LM44:
356 0192 8F70 andi r24,lo8(15)
357 0194 9070 andi r25,hi8(15)
358 0196 0397 sbiw r24,3
359 0198 09F0 breq .+2
360 019a 6BC4 rjmp .L58
359:uip.c **** /* If there was no need for a retransmission, we poll the
360:uip.c **** application for new data. */
361:uip.c **** uip_len = 0;
361 .stabn 68,0,361,.LM45-uip_process
362 .LM45:
363 019c 1092 0000 sts uip_len,__zero_reg__
362:uip.c **** uip_flags = UIP_POLL;
364 .stabn 68,0,362,.LM46-uip_process
365 .LM46:
366 01a0 88E0 ldi r24,lo8(8)
367 01a2 8093 0000 sts uip_flags,r24
363:uip.c **** UIP_APPCALL();
368 .stabn 68,0,363,.LM47-uip_process
369 .LM47:
370 01a6 2CC3 rjmp .L176
371 .L28:
364:uip.c **** goto appsend;
365:uip.c **** }
366:uip.c **** }
367:uip.c **** goto drop;
368:uip.c **** }
369:uip.c ****
370:uip.c **** /* This is where the input processing starts. */
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s page 14
371:uip.c **** UIP_STAT(++uip_stat.ip.recv);
372:uip.c ****
373:uip.c **** /* Check validity of the IP header. */
374:uip.c **** if(BUF->vhl != 0x45) { /* IP version and header length. */
372 .stabn 68,0,374,.LM48-uip_process
373 .LM48:
374 01a8 8091 0000 lds r24,uip_buf+14
375 01ac 8534 cpi r24,lo8(69)
376 01ae 09F0 breq .+2
377 01b0 60C4 rjmp .L58
375:uip.c **** UIP_STAT(++uip_stat.ip.drop);
376:uip.c **** UIP_STAT(++uip_stat.ip.vhlerr);
377:uip.c **** UIP_LOG("ip:vhl");
378:uip.c **** goto drop;
379:uip.c **** }
380:uip.c ****
381:uip.c **** /* Check the size of the packet. If the size reported to us in
382:uip.c **** uip_len doesn't match the size reported in the IP header, there
383:uip.c **** has been a transmission error and we drop the packet. */
384:uip.c ****
385:uip.c **** #if UIP_BUFSIZE > 255
386:uip.c **** if(BUF->len[0] != (uip_len >> 8)) {
387:uip.c **** UIP_STAT(++uip_stat.ip.drop);
388:uip.c **** UIP_STAT(++uip_stat.ip.hblenerr);
389:uip.c **** UIP_LOG("ip:len");
390:uip.c **** /* IP length, high byte. */
391:uip.c **** goto drop;
392:uip.c **** }
393:uip.c **** if(BUF->len[1] != (uip_len & 0xff)) {
394:uip.c **** UIP_STAT(++uip_stat.ip.drop);
395:uip.c **** UIP_STAT(++uip_stat.ip.lblenerr);
396:uip.c **** UIP_LOG("ip:len");
397:uip.c **** /* IP length, low byte. */
398:uip.c **** goto drop;
399:uip.c **** }
400:uip.c **** #else
401:uip.c **** if(BUF->len[0] != 0) { /* IP length, high byte. */
378 .stabn 68,0,401,.LM49-uip_process
379 .LM49:
380 01b2 C091 0000 lds r28,uip_buf+16
381 01b6 CC23 tst r28
382 01b8 09F0 breq .+2
383 01ba 5BC4 rjmp .L58
402:uip.c **** UIP_STAT(++uip_stat.ip.drop);
403:uip.c **** UIP_STAT(++uip_stat.ip.hblenerr);
404:uip.c **** UIP_LOG("ip:len");
405:uip.c **** goto drop;
406:uip.c **** }
407:uip.c **** if(BUF->len[1] != uip_len) { /* IP length, low byte. */
384 .stabn 68,0,407,.LM50-uip_process
385 .LM50:
386 01bc 9091 0000 lds r25,uip_buf+17
387 01c0 8091 0000 lds r24,uip_len
388 01c4 9817 cp r25,r24
389 01c6 09F0 breq .+2
390 01c8 54C4 rjmp .L58
408:uip.c **** UIP_STAT(++uip_stat.ip.drop);
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s page 15
409:uip.c **** UIP_STAT(++uip_stat.ip.lblenerr);
410:uip.c **** UIP_LOG("ip:len");
411:uip.c **** goto drop;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -