2013-12-27 13:57:56 +00:00
|
|
|
; ICMP implementation
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
.include "../inc/common.i"
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
.ifndef KPR_API_VERSION_NUMBER
|
2013-12-27 13:57:56 +00:00
|
|
|
.define EQU =
|
2013-12-13 21:24:03 +00:00
|
|
|
.include "../inc/kipper_constants.i"
|
|
|
|
.endif
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.export icmp_init
|
|
|
|
.export icmp_process
|
|
|
|
.export icmp_add_listener
|
|
|
|
.export icmp_remove_listener
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.export icmp_callback
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.export icmp_inp
|
|
|
|
.export icmp_outp
|
|
|
|
.exportzp icmp_type
|
|
|
|
.exportzp icmp_code
|
|
|
|
.exportzp icmp_cksum
|
|
|
|
.exportzp icmp_data
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
.ifdef TCP
|
|
|
|
.export icmp_echo_ip
|
|
|
|
.export icmp_send_echo
|
|
|
|
.export icmp_ping
|
|
|
|
.endif
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.import ip65_process
|
|
|
|
.import ip65_error
|
|
|
|
|
|
|
|
.import ip_calc_cksum
|
|
|
|
.import ip_inp
|
|
|
|
.import ip_outp
|
|
|
|
.import ip_broadcast
|
|
|
|
.import ip_send
|
|
|
|
.import ip_create_packet
|
|
|
|
.importzp ip_proto
|
|
|
|
.importzp ip_proto_icmp
|
|
|
|
|
|
|
|
.importzp ip_cksum_ptr
|
|
|
|
.importzp ip_header_cksum
|
|
|
|
.importzp ip_src
|
|
|
|
.importzp ip_dest
|
|
|
|
.importzp ip_data
|
|
|
|
.importzp ip_len
|
|
|
|
|
|
|
|
.import eth_tx
|
|
|
|
.import eth_inp
|
|
|
|
.import eth_inp_len
|
|
|
|
.import eth_outp
|
|
|
|
.import eth_outp_len
|
|
|
|
.import timer_read
|
|
|
|
.import timer_timeout
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
.data
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
icmp_cbtmp: jmp $0000 ; temporary vector - address filled in later
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.bss
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; argument for icmp_add_listener
|
|
|
|
icmp_callback: .res 2
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
; icmp callbacks
|
2013-12-27 13:57:56 +00:00
|
|
|
icmp_cbmax = 2
|
|
|
|
icmp_cbveclo: .res icmp_cbmax ; table of listener vectors (lsb)
|
|
|
|
icmp_cbvechi: .res icmp_cbmax ; table of listener vectors (msb)
|
|
|
|
icmp_cbtype: .res icmp_cbmax ; table of listener types
|
|
|
|
icmp_cbcount: .res 1 ; number of active listeners
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
; icmp packet offsets
|
2013-12-27 13:57:56 +00:00
|
|
|
icmp_inp = ip_inp + ip_data ; pointer to inbound icmp packet
|
|
|
|
icmp_outp = ip_outp + ip_data ; pointer to outbound icmp packet
|
|
|
|
icmp_type = 0 ; offset of 'type' field in icmp packet
|
|
|
|
icmp_code = 1 ; offset of 'code' field in icmp packet
|
|
|
|
icmp_cksum = 2 ; offset of 'checksum' field in icmp packet
|
|
|
|
icmp_data = 4 ; offset of 'data' field in icmp packet
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
; icmp echo packet offsets
|
2013-12-27 13:57:56 +00:00
|
|
|
icmp_echo_id = 4 ; offset of 'id' field in icmp echo request/echo response
|
|
|
|
icmp_echo_seq = 6 ; offset of 'sequence' field in icmp echo request/echo response
|
|
|
|
icmp_echo_data = 8 ; offset of 'data' field in icmp echo request/echo response
|
|
|
|
|
|
|
|
; icmp type codes
|
|
|
|
icmp_msg_type_echo_reply = 0
|
|
|
|
icmp_msg_type_destination_unreachable = 3
|
|
|
|
icmp_msg_type_source_quench = 4
|
|
|
|
icmp_msg_type_redirect = 5
|
|
|
|
icmp_msg_type_echo_request = 8
|
|
|
|
icmp_msg_type_time_exceeded = 11
|
|
|
|
icmp_msg_type_paramater_problem = 12
|
|
|
|
icmp_msg_type_timestamp = 13
|
|
|
|
icmp_msg_type_timestamp_reply = 14
|
|
|
|
icmp_msg_type_information_request = 15
|
|
|
|
icmp_msg_type_information_reply = 16
|
|
|
|
|
|
|
|
; ping states
|
|
|
|
ping_state_request_sent = 0
|
|
|
|
ping_state_response_received = 1
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2014-04-27 16:59:58 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
.ifdef TCP
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2014-04-27 16:59:58 +00:00
|
|
|
.bss
|
2013-12-27 13:57:56 +00:00
|
|
|
|
|
|
|
icmp_echo_ip: .res 4 ; destination IP address for echo request ("ping")
|
|
|
|
icmp_echo_cnt: .res 1 ; ping sequence counter
|
|
|
|
ping_state: .res 1
|
|
|
|
ping_timer: .res 2
|
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
.endif
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
|
|
|
|
.code
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
; initialize icmp
|
|
|
|
; inputs: none
|
|
|
|
; outputs: none
|
|
|
|
icmp_init:
|
2013-12-27 13:57:56 +00:00
|
|
|
lda #0
|
|
|
|
sta icmp_cbcount
|
|
|
|
rts
|
|
|
|
|
|
|
|
; process incoming icmp packet
|
|
|
|
; inputs:
|
|
|
|
; eth_inp points to an ethernet frame containing an icmp packet
|
|
|
|
; outputs:
|
|
|
|
; carry flag - set on any error, clear if OK
|
|
|
|
; if inbound packet is a request (e.g. 'echo request') and an icmp listener
|
|
|
|
; has been installed, then an appropriate response message will be
|
|
|
|
; generated and sent out (overwriting the eth_outp buffer)
|
2013-12-13 21:24:03 +00:00
|
|
|
icmp_process:
|
2013-12-27 13:57:56 +00:00
|
|
|
lda icmp_inp + icmp_type
|
|
|
|
cmp #icmp_msg_type_echo_request ; ping
|
|
|
|
beq @echo
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
lda icmp_cbcount ; any installed icmp listeners?
|
|
|
|
beq @drop
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
ldx icmp_cbcount ; check listened types
|
|
|
|
dex
|
|
|
|
: lda icmp_cbtype,x
|
|
|
|
cmp icmp_inp + icmp_type
|
|
|
|
beq @handle ; found a match
|
|
|
|
dex
|
|
|
|
bpl :-
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
@drop:
|
2013-12-27 13:57:56 +00:00
|
|
|
sec
|
|
|
|
rts
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
@handle:
|
2013-12-27 13:57:56 +00:00
|
|
|
lda icmp_cbveclo,x ; copy vector
|
|
|
|
sta icmp_cbtmp + 1
|
|
|
|
lda icmp_cbvechi,x
|
|
|
|
sta icmp_cbtmp + 2
|
|
|
|
jsr icmp_cbtmp ; call listener
|
|
|
|
clc
|
|
|
|
rts
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
@echo:
|
2013-12-27 13:57:56 +00:00
|
|
|
lda ip_broadcast ; check if packet is broadcast
|
|
|
|
beq @notbc
|
|
|
|
sec ; don't reply to broadcast pings
|
|
|
|
rts
|
2013-12-13 21:24:03 +00:00
|
|
|
@notbc:
|
2013-12-27 13:57:56 +00:00
|
|
|
ldx #5
|
|
|
|
: lda eth_inp,x ; swap dest and src mac
|
|
|
|
sta eth_outp + 6,x
|
|
|
|
lda eth_inp + 6,x
|
|
|
|
sta eth_outp,x
|
|
|
|
dex
|
|
|
|
bpl :-
|
|
|
|
|
|
|
|
ldx #12 ; copy the packet
|
|
|
|
: lda eth_inp,x
|
|
|
|
sta eth_outp,x
|
|
|
|
inx
|
|
|
|
cpx eth_inp_len
|
|
|
|
bne :-
|
|
|
|
|
|
|
|
ldx #3
|
|
|
|
: lda ip_inp + ip_src,x ; swap dest and src ip
|
|
|
|
sta ip_outp + ip_dest,x
|
|
|
|
lda ip_inp + ip_dest,x
|
|
|
|
sta ip_outp + ip_src,x
|
|
|
|
dex
|
|
|
|
bpl :-
|
|
|
|
|
|
|
|
lda #0 ; change type to reply
|
|
|
|
sta icmp_outp + icmp_type
|
|
|
|
|
|
|
|
lda icmp_inp + icmp_cksum ; recalc checksum
|
|
|
|
clc
|
|
|
|
adc #8
|
|
|
|
sta icmp_outp + icmp_cksum
|
|
|
|
bcc :+
|
|
|
|
inc icmp_outp + icmp_cksum + 1
|
|
|
|
: lda eth_inp_len ; copy length
|
|
|
|
sta eth_outp_len
|
|
|
|
lda eth_inp_len + 1
|
|
|
|
sta eth_outp_len + 1
|
|
|
|
|
|
|
|
lda #0 ; clear checksum
|
|
|
|
sta ip_outp + ip_header_cksum
|
|
|
|
sta ip_outp + ip_header_cksum + 1
|
|
|
|
ldax #ip_outp ; calculate ip header checksum
|
|
|
|
stax ip_cksum_ptr
|
|
|
|
ldax #20
|
|
|
|
jsr ip_calc_cksum
|
|
|
|
stax ip_outp + ip_header_cksum
|
|
|
|
|
|
|
|
jsr eth_tx ; send packet
|
|
|
|
clc
|
|
|
|
rts
|
|
|
|
|
|
|
|
; add an icmp listener
|
|
|
|
; inputs:
|
2013-12-13 21:24:03 +00:00
|
|
|
; A = icmp type
|
|
|
|
; icmp_callback: vector to call when an icmp packet of specified type arrives
|
2013-12-27 13:57:56 +00:00
|
|
|
; outputs:
|
2013-12-13 21:24:03 +00:00
|
|
|
; carry flag - set if error, clear if no error
|
|
|
|
icmp_add_listener:
|
2013-12-27 13:57:56 +00:00
|
|
|
ldx icmp_cbcount ; any listeners at all?
|
|
|
|
beq @add
|
|
|
|
cpx #icmp_cbmax ; max?
|
|
|
|
beq @full
|
|
|
|
ldx #0
|
|
|
|
: cmp icmp_cbtype,x ; check if type is already listened
|
|
|
|
beq @busy
|
|
|
|
inx
|
|
|
|
cpx icmp_cbcount
|
|
|
|
bne :-
|
2013-12-13 21:24:03 +00:00
|
|
|
@add:
|
2013-12-27 13:57:56 +00:00
|
|
|
inc icmp_cbcount ; increase counter
|
|
|
|
sta icmp_cbtype,x ; add type
|
|
|
|
lda icmp_callback ; and vector
|
|
|
|
sta icmp_cbveclo,x
|
|
|
|
lda icmp_callback + 1
|
|
|
|
sta icmp_cbvechi,x
|
|
|
|
clc
|
|
|
|
rts
|
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
@full:
|
|
|
|
@busy:
|
2013-12-27 13:57:56 +00:00
|
|
|
sec
|
|
|
|
rts
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; remove an icmp listener
|
|
|
|
; inputs:
|
2013-12-13 21:24:03 +00:00
|
|
|
; A = icmp type
|
2013-12-27 13:57:56 +00:00
|
|
|
; outputs:
|
|
|
|
; carry flag - set if error (i.e. no listner for this type exists),
|
|
|
|
; clear if no error
|
2013-12-13 21:24:03 +00:00
|
|
|
icmp_remove_listener:
|
2013-12-27 13:57:56 +00:00
|
|
|
ldx icmp_cbcount ; any listeners installed?
|
|
|
|
beq @notfound
|
2013-12-13 21:24:03 +00:00
|
|
|
dex
|
2013-12-27 13:57:56 +00:00
|
|
|
: cmp icmp_cbtype,x ; check if type is listened
|
|
|
|
beq @remove
|
|
|
|
dex
|
|
|
|
bpl :-
|
2013-12-13 21:24:03 +00:00
|
|
|
@notfound:
|
2013-12-27 13:57:56 +00:00
|
|
|
sec
|
|
|
|
rts
|
2013-12-13 21:24:03 +00:00
|
|
|
@remove:
|
2013-12-27 13:57:56 +00:00
|
|
|
txa ; number of listeners below
|
|
|
|
eor #$ff
|
|
|
|
clc
|
|
|
|
adc icmp_cbcount
|
|
|
|
beq @done
|
2013-12-13 21:24:03 +00:00
|
|
|
@move:
|
2013-12-27 13:57:56 +00:00
|
|
|
tay ; number of items to move
|
|
|
|
: lda icmp_cbtype + 1,x ; move type
|
|
|
|
sta icmp_cbtype,x
|
|
|
|
lda icmp_cbveclo + 1,x ; move vector lsb
|
|
|
|
sta icmp_cbveclo,x
|
|
|
|
lda icmp_cbvechi + 1,x ; move vector msb
|
|
|
|
sta icmp_cbvechi,x
|
|
|
|
inx
|
|
|
|
dey
|
|
|
|
bne :-
|
2013-12-13 21:24:03 +00:00
|
|
|
@done:
|
2013-12-27 13:57:56 +00:00
|
|
|
dec icmp_cbcount ; decrement counter
|
|
|
|
clc
|
|
|
|
rts
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
.ifdef TCP
|
|
|
|
|
|
|
|
; icmp_send_echo was contributed by Glenn Holmer (ShadowM)
|
2013-12-27 13:57:56 +00:00
|
|
|
; send an ICMP echo ("ping") request
|
|
|
|
; inputs:
|
2013-12-13 21:24:03 +00:00
|
|
|
; icmp_echo_ip: destination IP address
|
2013-12-27 13:57:56 +00:00
|
|
|
; outputs:
|
2013-12-13 21:24:03 +00:00
|
|
|
; carry flag - set if error, clear if no error
|
|
|
|
icmp_send_echo:
|
|
|
|
ldy #3
|
2013-12-27 13:57:56 +00:00
|
|
|
: lda icmp_echo_ip,y
|
2013-12-13 21:24:03 +00:00
|
|
|
sta ip_outp + ip_dest,y
|
|
|
|
dey
|
|
|
|
bpl :-
|
|
|
|
|
|
|
|
lda #icmp_msg_type_echo_request
|
|
|
|
sta icmp_outp + icmp_type
|
2013-12-27 13:57:56 +00:00
|
|
|
lda #0 ; not used for echo packets
|
2013-12-13 21:24:03 +00:00
|
|
|
sta icmp_outp + icmp_code
|
2013-12-27 13:57:56 +00:00
|
|
|
sta icmp_outp + icmp_cksum ; clear checksum
|
2013-12-13 21:24:03 +00:00
|
|
|
sta icmp_outp + icmp_cksum + 1
|
2013-12-27 13:57:56 +00:00
|
|
|
sta icmp_outp + icmp_echo_id ; set id to 0
|
2013-12-13 21:24:03 +00:00
|
|
|
sta icmp_outp + icmp_echo_id + 1
|
2013-12-27 13:57:56 +00:00
|
|
|
inc icmp_echo_cnt + 1 ; big-endian
|
2013-12-13 21:24:03 +00:00
|
|
|
bne :+
|
|
|
|
inc icmp_echo_cnt
|
2013-12-27 13:57:56 +00:00
|
|
|
: ldax icmp_echo_cnt
|
2013-12-13 21:24:03 +00:00
|
|
|
stax icmp_outp + icmp_echo_seq
|
|
|
|
|
|
|
|
ldy #0
|
2013-12-27 13:57:56 +00:00
|
|
|
: lda ip65_msg,y
|
2013-12-13 21:24:03 +00:00
|
|
|
beq @set_ip_len
|
|
|
|
sta icmp_outp + icmp_echo_data,y
|
|
|
|
iny
|
|
|
|
bne :-
|
|
|
|
@set_ip_len:
|
|
|
|
tya
|
|
|
|
clc
|
2013-12-27 13:57:56 +00:00
|
|
|
adc #28 ; IP header + ICMP type, code, cksum, id, seq
|
|
|
|
sta ip_outp + ip_len + 1 ; high byte first
|
|
|
|
lda #0 ; will never be >256
|
2013-12-13 21:24:03 +00:00
|
|
|
sta ip_outp + ip_len
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
ldax #icmp_outp ; start of ICMP packet
|
2013-12-13 21:24:03 +00:00
|
|
|
stax ip_cksum_ptr
|
|
|
|
tya
|
|
|
|
clc
|
2013-12-27 13:57:56 +00:00
|
|
|
adc #8 ; ICMP type, code, cksum, id, seq
|
|
|
|
ldx #0 ; AX = length of ICMP data
|
2013-12-13 21:24:03 +00:00
|
|
|
jsr ip_calc_cksum
|
|
|
|
stax icmp_outp + icmp_cksum
|
|
|
|
lda #ip_proto_icmp
|
|
|
|
sta ip_outp + ip_proto
|
|
|
|
jsr ip_create_packet
|
|
|
|
jmp ip_send
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; send a ping (ICMP echo request) to a remote host, and wait for a response
|
|
|
|
; inputs:
|
2013-12-13 21:24:03 +00:00
|
|
|
; icmp_echo_ip: destination IP address
|
2013-12-27 13:57:56 +00:00
|
|
|
; outputs:
|
2013-12-13 21:24:03 +00:00
|
|
|
; carry flag - set if no response, otherwise AX is time (in miliseconds) for host to respond
|
|
|
|
icmp_ping:
|
2013-12-27 13:57:56 +00:00
|
|
|
lda #0 ; reset the "packet sent" counter
|
2013-12-13 21:24:03 +00:00
|
|
|
sta icmp_echo_cnt
|
|
|
|
@send_one_message:
|
|
|
|
jsr icmp_send_echo
|
|
|
|
bcc @message_sent_ok
|
2013-12-27 13:57:56 +00:00
|
|
|
; we couldn't send the message - most likely we needed to do an ARP lookup.
|
|
|
|
; so wait a bit, and retry
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
jsr timer_read ; read current timer value
|
|
|
|
stax ping_timer
|
2013-12-13 21:24:03 +00:00
|
|
|
@loop_during_arp_lookup:
|
|
|
|
jsr ip65_process
|
|
|
|
ldax ping_timer
|
2013-12-27 13:57:56 +00:00
|
|
|
adc #50 ; set timeout to now + 50 ms
|
2013-12-13 21:24:03 +00:00
|
|
|
bcc :+
|
|
|
|
inx
|
2013-12-27 13:57:56 +00:00
|
|
|
: jsr timer_timeout
|
2013-12-13 21:24:03 +00:00
|
|
|
bcs @loop_during_arp_lookup
|
2013-12-27 13:57:56 +00:00
|
|
|
jsr icmp_send_echo
|
2013-12-13 21:24:03 +00:00
|
|
|
bcc @message_sent_ok
|
2013-12-27 13:57:56 +00:00
|
|
|
; still can't send? then give up
|
2013-12-13 21:24:03 +00:00
|
|
|
lda #KPR_ERROR_TRANSMIT_FAILED
|
|
|
|
sta ip65_error
|
2013-12-27 13:57:56 +00:00
|
|
|
rts
|
2013-12-13 21:24:03 +00:00
|
|
|
@message_sent_ok:
|
2013-12-27 13:57:56 +00:00
|
|
|
jsr timer_read ; read current timer value
|
|
|
|
stax ping_timer
|
|
|
|
ldax #icmp_ping_callback
|
2013-12-13 21:24:03 +00:00
|
|
|
stax icmp_callback
|
|
|
|
lda #icmp_msg_type_echo_reply
|
|
|
|
jsr icmp_add_listener
|
|
|
|
lda #ping_state_request_sent
|
|
|
|
sta ping_state
|
|
|
|
@loop_till_get_ping_response:
|
|
|
|
jsr ip65_process
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
lda ping_state
|
|
|
|
cmp #ping_state_response_received
|
|
|
|
beq @got_reply
|
|
|
|
ldax ping_timer
|
2013-12-27 13:57:56 +00:00
|
|
|
inx ; x rolls over about 4 times per second
|
|
|
|
inx ; so we will timeout after about 2 seconds
|
2013-12-13 21:24:03 +00:00
|
|
|
inx
|
|
|
|
inx
|
|
|
|
inx
|
|
|
|
inx
|
|
|
|
inx
|
|
|
|
inx
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
jsr timer_timeout
|
2013-12-27 13:57:56 +00:00
|
|
|
bcs @loop_till_get_ping_response
|
2013-12-13 21:24:03 +00:00
|
|
|
lda #KPR_ERROR_TIMEOUT_ON_RECEIVE
|
|
|
|
sta ip65_error
|
|
|
|
lda #icmp_msg_type_echo_reply
|
|
|
|
jsr icmp_remove_listener
|
|
|
|
sec
|
|
|
|
rts
|
|
|
|
@got_reply:
|
|
|
|
lda #icmp_msg_type_echo_reply
|
|
|
|
jsr icmp_remove_listener
|
|
|
|
jsr timer_read
|
|
|
|
sec
|
|
|
|
sbc ping_timer
|
|
|
|
pha
|
|
|
|
txa
|
2013-12-27 13:57:56 +00:00
|
|
|
sbc ping_timer+1
|
2013-12-13 21:24:03 +00:00
|
|
|
tax
|
|
|
|
pla
|
|
|
|
clc
|
|
|
|
rts
|
|
|
|
|
|
|
|
icmp_ping_callback:
|
|
|
|
lda icmp_inp + icmp_echo_seq
|
|
|
|
cmp icmp_echo_cnt
|
|
|
|
bne @not_what_we_were_waiting_for
|
|
|
|
lda #ping_state_response_received
|
|
|
|
sta ping_state
|
|
|
|
@not_what_we_were_waiting_for:
|
|
|
|
rts
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
ip65_msg:
|
|
|
|
.byte "ip65 - the 6502 IP stack",0
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
|
|
|
|
; -- LICENSE FOR icmp.s --
|
2013-12-13 21:24:03 +00:00
|
|
|
; The contents of this file are subject to the Mozilla Public License
|
|
|
|
; Version 1.1 (the "License"); you may not use this file except in
|
|
|
|
; compliance with the License. You may obtain a copy of the License at
|
|
|
|
; http://www.mozilla.org/MPL/
|
2013-12-27 13:57:56 +00:00
|
|
|
;
|
2013-12-13 21:24:03 +00:00
|
|
|
; Software distributed under the License is distributed on an "AS IS"
|
|
|
|
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
; License for the specific language governing rights and limitations
|
|
|
|
; under the License.
|
2013-12-27 13:57:56 +00:00
|
|
|
;
|
2013-12-13 21:24:03 +00:00
|
|
|
; The Original Code is ip65.
|
2013-12-27 13:57:56 +00:00
|
|
|
;
|
2013-12-13 21:24:03 +00:00
|
|
|
; The Initial Developer of the Original Code is Per Olofsson,
|
|
|
|
; MagerValp@gmail.com.
|
|
|
|
; Portions created by the Initial Developer are Copyright (C) 2009
|
2013-12-27 13:57:56 +00:00
|
|
|
; Per Olofsson. All Rights Reserved.
|
2013-12-13 21:24:03 +00:00
|
|
|
;
|
2013-12-27 13:57:56 +00:00
|
|
|
; Contributor(s): Jonno Downes, Glenn Holmer
|
2013-12-13 21:24:03 +00:00
|
|
|
; -- LICENSE END --
|