Rev 330 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 330 | Rev 379 | ||
---|---|---|---|
Line 213... | Line 213... | ||
213 | cmp al, [last_1sTick] |
213 | cmp al, [last_1sTick] |
214 | je sh_exit |
214 | je sh_exit |
Line 215... | Line 215... | ||
215 | 215 | ||
Line 216... | Line 216... | ||
216 | mov [last_1sTick], al |
216 | mov [last_1sTick], al |
217 | 217 | ||
Line 218... | Line 218... | ||
218 | stdcall arp_table_manager, ARP_TABLE_TIMER, 0, 0 |
218 | stdcall arp_table_manager, ARP_TABLE_TIMER, 0, 0 |
219 | call tcp_tcb_handler |
219 | call tcp_tcb_handler |
Line 483... | Line 483... | ||
483 | jnz not14 |
483 | jnz not14 |
Line 484... | Line 484... | ||
484 | 484 | ||
485 | ; write the dns IP Address |
485 | ; write the dns IP Address |
Line 486... | Line 486... | ||
486 | mov [dns_ip], ebx |
486 | mov [dns_ip], ebx |
487 | 487 | ||
488 | ret |
488 | ret |
489 | 489 | ||
490 | ; |
490 | ; |
491 | not14: |
491 | not14: |
Line 492... | Line 492... | ||
492 | cmp eax, 15 |
492 | cmp eax, 15 |
493 | jnz not15 |
493 | jnz not15 |
494 | 494 | ||
495 | ; in ebx we need 4 to read the last 2 bytes |
495 | ; in ebx we need 4 to read the last 2 bytes |
496 | cmp ebx, dword 4 |
496 | cmp ebx, dword 4 |
497 | je read |
497 | je read |
498 | 498 | ||
Line 499... | Line 499... | ||
499 | ; or we need 0 to read the first 4 bytes |
499 | ; or we need 0 to read the first 4 bytes |
500 | cmp ebx, dword 0 |
500 | cmp ebx, dword 0 |
501 | jnz param_error |
501 | jnz param_error |
502 | 502 | ||
503 | ; read MAC, returned (in mirrored byte order) in eax |
503 | ; read MAC, returned (in mirrored byte order) in eax |
504 | read: |
504 | read: |
505 | mov eax, [node_addr + ebx] |
505 | mov eax, [node_addr + ebx] |
506 | jmp @f |
506 | jmp @f |
507 | 507 | ||
Line 508... | Line 508... | ||
508 | param_error: |
508 | param_error: |
509 | mov eax, -1 ; params not accepted |
509 | mov eax, -1 ; params not accepted |
510 | @@: |
510 | @@: |
511 | ret |
511 | ret |
Line 512... | Line 512... | ||
512 | 512 | ||
513 | 513 | ||
514 | ; 0 -> arp_probe |
514 | ; 0 -> arp_probe |
515 | ; 1 -> arp_announce |
515 | ; 1 -> arp_announce |
516 | ; 2 -> arp_responce (not supported yet) |
516 | ; 2 -> arp_responce (not supported yet) |
517 | 517 | ||
518 | not15: ; ARP stuff |
518 | not15: ; ARP stuff |
519 | cmp eax, 16 |
519 | cmp eax, 16 |
520 | jnz not16 |
520 | jnz not16 |
521 | 521 | ||
522 | cmp ebx, 0 |
522 | cmp ebx, 0 |
523 | je a_probe |
523 | je a_probe |
Line 524... | Line 524... | ||
524 | 524 | ||
525 | cmp ebx, 1 |
525 | cmp ebx, 1 |
526 | je a_ann ; arp announce |
526 | je a_ann ; arp announce |
527 | 527 | ||
528 | ; cmp ebx,2 |
528 | ; cmp ebx,2 |
529 | ; jne a_resp ; arp response |
529 | ; jne a_resp ; arp response |
530 | 530 | ||
531 | jmp param15_error |
531 | jmp param15_error |
532 | 532 | ||
533 | 533 | ||
534 | ; arp probe, sender IP must be set to 0.0.0.0, target IP is set to address being probed |
534 | ; arp probe, sender IP must be set to 0.0.0.0, target IP is set to address being probed |
535 | ; ecx: pointer to target MAC, MAC should set to 0 by application |
535 | ; ecx: pointer to target MAC, MAC should set to 0 by application |
536 | ; edx: target IP |
536 | ; edx: target IP |
537 | a_probe: |
537 | a_probe: |
538 | push dword [stack_ip] |
538 | push dword [stack_ip] |
539 | 539 | ||
540 | mov edx, [stack_ip] |
540 | mov edx, [stack_ip] |
541 | mov [stack_ip], dword 0 |
541 | mov [stack_ip], dword 0 |
542 | mov esi, ecx ; pointer to target MAC address |
542 | mov esi, ecx ; pointer to target MAC address |
543 | call arp_request |
543 | call arp_request |
544 | 544 | ||
545 | pop dword [stack_ip] |
545 | pop dword [stack_ip] |
546 | jmp @f |
546 | jmp @f |
547 | 547 | ||
548 | ; arp announce, sender IP must be set to target IP |
548 | ; arp announce, sender IP must be set to target IP |
549 | ; ecx: pointer to target MAC |
549 | ; ecx: pointer to target MAC |
550 | a_ann: |
550 | a_ann: |
551 | mov edx, [stack_ip] |
551 | mov edx, [stack_ip] |
552 | mov esi, ecx ; pointer to target MAC address |
552 | mov esi, ecx ; pointer to target MAC address |
553 | call arp_request |
553 | call arp_request |
554 | jmp @f |
554 | jmp @f |
555 | 555 | ||
Line 927... | Line 927... | ||
927 | pop edx |
927 | pop edx |
Line 928... | Line 928... | ||
928 | 928 | ||
Line 929... | Line 929... | ||
929 | push eax ; save address of IP data |
929 | push eax ; save address of IP data |
930 | 930 | ||
931 | ; Get the address of the callers data |
931 | ; Get the address of the callers data |
932 | mov edi,[0x3010] |
932 | mov edi,[TASK_BASE] |
933 | add edi,TASKDATA.mem_start |
933 | add edi,TASKDATA.mem_start |
Line 934... | Line 934... | ||
934 | add edx,[edi] |
934 | add edx,[edi] |
Line 990... | Line 990... | ||
990 | pop ecx ; count of bytes to send |
990 | pop ecx ; count of bytes to send |
991 | mov ebx, ecx ; need the length later |
991 | mov ebx, ecx ; need the length later |
992 | pop eax ; get callers ptr to data to send |
992 | pop eax ; get callers ptr to data to send |
Line 993... | Line 993... | ||
993 | 993 | ||
994 | ; Get the address of the callers data |
994 | ; Get the address of the callers data |
995 | mov edi,[0x3010] |
995 | mov edi,[TASK_BASE] |
996 | add edi,TASKDATA.mem_start |
996 | add edi,TASKDATA.mem_start |
997 | add eax,[edi] |
997 | add eax,[edi] |
Line 998... | Line 998... | ||
998 | mov esi, eax |
998 | mov esi, eax |