2021-07-03 05:07:57 +01:00
< ! DOCTYPE HTML >
< html >
< head >
< meta http - equiv = " Content-Type " content = " text/html;charset=US-ASCII " >
< meta name = " generator " content = " ZealOS V0.05 " >
< style type = " text/css " >
body { background - color : # 000000 ; }
. cF0 { color : # ffffff ; background - color : # 000000 ; }
. cF1 { color : # 3465 a4 ; background - color : # 000000 ; }
. cF2 { color : # 4e9 a06 ; background - color : # 000000 ; }
. cF3 { color : # 06 989 a ; background - color : # 000000 ; }
. cF4 { color : # a24444 ; background - color : # 000000 ; }
. cF5 { color : # 75507 b ; background - color : # 000000 ; }
. cF6 { color : # ce982f ; background - color : # 000000 ; }
. cF7 { color : # bcc0b9 ; background - color : # 000000 ; }
. cF8 { color : # 555753 ; background - color : # 000000 ; }
. cF9 { color : # 729f cf ; background - color : # 000000 ; }
. cFA { color : # 82 bc49 ; background - color : # 000000 ; }
. cFB { color : # 34e2 e2 ; background - color : # 000000 ; }
. cFC { color : # ac3535 ; background - color : # 000000 ; }
. cFD { color : # ad7fa8 ; background - color : # 000000 ; }
. cFE { color : # fce94f ; background - color : # 000000 ; }
. cFF { color : # 000000 ; background - color : # 000000 ; }
< / style >
< / head >
< body >
2021-07-05 01:12:38 +01:00
< pre style = " font-family:monospace;font-size:12pt " >
2021-07-03 05:07:57 +01:00
< a name = " l1 " > < / a > < span class = cF0 > # < / span > < span class = cF1 > define < / span > < span class = cF0 > UDP_MAX_PORT < / span > < span class = cFE > 65535 < / span > < span class = cF0 >
< a name = " l2 " > < / a >
< a name = " l3 " > < / a > < / span > < span class = cF1 > class < / span > < span class = cF0 > CUDPMessageQueue : < / span > < span class = cF9 > CQueue < / span > < span class = cF0 >
< a name = " l4 " > < / a > { < / span > < span class = cF2 > // each bound socket queues data. recv functions & handler use this.</span><span class=cF0>
2021-07-04 23:11:34 +01:00
< a name = " l5 " > < / a > < / span > < span class = cF1 > U8 < / span > < span class = cF0 > * data ; < / span > < span class = cF2 > // contains the UDP payload data.</span><span class=cF0>
< a name = " l6 " > < / a > < / span > < span class = cF9 > I64 < / span > < span class = cF0 > data_length ; < / span > < span class = cF2 > // size of payload data.</span><span class=cF0>
< a name = " l7 " > < / a > < / span > < span class = cF9 > I64 < / span > < span class = cF0 > received_length ; < / span > < span class = cF2 > // amount of the data received so far.</span><span class=cF0>
< a name = " l8 " > < / a > CSocketAddressStorage from_address ; < / span > < span class = cF2 > // when UDP Handler sees UDP packet, this is filled with where packet came from.</span><span class=cF0>
< a name = " l9 " > < / a > < / span > < span class = cF2 > // recvfrom uses this to fill its address_out parameter.</span><span class=cF0>
2021-07-03 05:07:57 +01:00
< a name = " l10 " > < / a > } ;
< a name = " l11 " > < / a >
< a name = " l12 " > < / a > < / span > < span class = cF1 > class < / span > < span class = cF0 > CUDPSocket
< a name = " l13 " > < / a > {
2021-07-04 23:11:34 +01:00
< a name = " l14 " > < / a > CSocket * socket ;
< a name = " l15 " > < / a > CUDPMessageQueue * receive_queue ;
< a name = " l16 " > < / a > CSocketAddressStorage receive_address ; < / span > < span class = cF2 > // based on ->family, cast or assign to a var as IPV4/IPV6 CSocketAddress</span><span class=cF0>
< a name = " l17 " > < / a > < / span > < span class = cF9 > I64 < / span > < span class = cF0 > receive_timeout_ms ;
< a name = " l18 " > < / a > < / span > < span class = cF9 > I64 < / span > < span class = cF0 > receive_max_timeout ;
< a name = " l19 " > < / a > < / span > < span class = cF9 > U16 < / span > < span class = cF0 > bound_to ; < / span > < span class = cF2 > // represents the currently bound port</span><span class=cF0>
2021-07-03 05:07:57 +01:00
< a name = " l20 " > < / a > } ;
< a name = " l21 " > < / a >
< a name = " l22 " > < / a > < / span > < span class = cF1 > class < / span > < span class = cF0 > CUDPTreeQueue : < / span > < span class = cF9 > CQueue < / span > < span class = cF0 >
< a name = " l23 " > < / a > {
2021-07-04 23:11:34 +01:00
< a name = " l24 " > < / a > CUDPSocket * socket ;
2021-07-03 05:07:57 +01:00
< a name = " l25 " > < / a > } ;
< a name = " l26 " > < / a >
< a name = " l27 " > < / a > < / span > < span class = cF1 > class < / span > < span class = cF0 > CUDPTreeNode : CBST
< a name = " l28 " > < / a > {
2021-07-04 23:11:34 +01:00
< a name = " l29 " > < / a > CUDPTreeQueue * queue ;
2021-07-03 05:07:57 +01:00
< a name = " l30 " > < / a > } ;
< a name = " l31 " > < / a >
< a name = " l32 " > < / a > < / span > < span class = cF1 > class < / span > < span class = cF0 > CUDPRepEntry : < / span > < span class = cF9 > CQueue < / span > < span class = cF0 >
< a name = " l33 " > < / a > {
2021-07-04 23:11:34 +01:00
< a name = " l34 " > < / a > CUDPTreeNode * node ;
2021-07-03 05:07:57 +01:00
< a name = " l35 " > < / a > } ;
< a name = " l36 " > < / a >
< a name = " l37 " > < / a > < / span > < span class = cF1 > class < / span > < span class = cF0 > CUDPHeader
< a name = " l38 " > < / a > {
2021-07-04 23:11:34 +01:00
< a name = " l39 " > < / a > < / span > < span class = cF9 > U16 < / span > < span class = cF0 > source_port ;
< a name = " l40 " > < / a > < / span > < span class = cF9 > U16 < / span > < span class = cF0 > destination_port ;
< a name = " l41 " > < / a > < / span > < span class = cF9 > U16 < / span > < span class = cF0 > length ;
< a name = " l42 " > < / a > < / span > < span class = cF9 > U16 < / span > < span class = cF0 > checksum ;
2021-07-03 05:07:57 +01:00
< a name = " l43 " > < / a > } ;
< a name = " l44 " > < / a >
< a name = " l45 " > < / a >
< a name = " l46 " > < / a > < / span > < span class = cF1 > class < / span > < span class = cF0 > CUDPGlobals
< a name = " l47 " > < / a > {
< a name = " l48 " > < / a >
2021-07-04 23:11:34 +01:00
< a name = " l49 " > < / a > CUDPTreeNode * bound_socket_tree ;
2021-07-03 05:07:57 +01:00
< a name = " l50 " > < / a >
< a name = " l51 " > < / a > } udp_globals ;
< a name = " l52 " > < / a >
< / span > < / pre > < / body >
< / html >