kernel: added struct sockaddr

git-svn-id: svn://kolibrios.org@9739 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2022-03-13 14:45:55 +00:00
parent c99afa0b60
commit d9a3ea763b
2 changed files with 13 additions and 3 deletions

View File

@ -169,6 +169,15 @@ struct STREAM_SOCKET TCP_SOCKET
ends
struct sockaddr
family dw ? ; Address family
port dw ? ; 16 bit TCP/UDP port number
ip dd ? ; 32 bit IP address
_zero rb 8 ; Not use, for align
ends
struct socket_queue_entry
data_ptr dd ?

View File

@ -305,6 +305,7 @@ udp_output:
; udp_connect ;
; ;
; IN: eax = socket pointer ;
; edx = pointer to sockaddr struct ;
; ;
; OUT: eax = 0 on success ;
; eax = -1 on error ;
@ -325,10 +326,10 @@ udp_connect:
pop edx eax
; Fill in remote port and IP
pushw [edx + 2]
pop [eax + UDP_SOCKET.RemotePort]
pushw [edx + sockaddr.port]
popw [eax + UDP_SOCKET.RemotePort]
pushd [edx + 4]
pushd [edx + sockaddr.ip]
pop [eax + UDP_SOCKET.RemoteIP]
; Find route to host