udp_genesis 1
udp_genesis 2
udp_genesis 3
udp_genesis 4
udp_genesis 5
udp_genesis 6
udp_genesis 7
udp_genesis 8
udp_genesis 9
udp_genesis 10
udp_genesis 11
udp_genesis 12
udp_genesis 13
udp_genesis 14
udp_genesis 15
udp_genesis 16
udp_genesis 17
udp_genesis 18
udp_genesis 19
udp_genesis 20 with Interfaces, Interfaces.C; use Interfaces, Interfaces.C;
udp_genesis 21 with System; use System;
udp_genesis 22
udp_tester 23 generic
udp_tester 24 Payload_Size : in Positive;
udp_genesis 25
udp_genesis 26 package UDP is
udp_genesis 27
udp_genesis 28 pragma Preelaborate;
udp_tester 29
udp_genesis 30 type Payload is array(1 .. Payload_Size) of Unsigned_8;
udp_genesis 31
udp_genesis 32 subtype IP_Address is Unsigned_32;
udp_genesis 33 subtype IP_Port is Unsigned_16;
udp_genesis 34
udp_genesis 35
udp_genesis 36 INADDR_ANY : constant Unsigned_32 := 0;
udp_tester 37
udp_tester 38
udp_tester 39 function Bit_Compare(A: in Payload; B: in Payload) return Natural;
udp_genesis 40
udp_genesis 41
udp_genesis 42 type Endpoint is
udp_genesis 43 record
udp_genesis 44 Address : IP_Address;
udp_genesis 45 Port : IP_Port;
udp_genesis 46 end record;
udp_genesis 47
udp_genesis 48
udp_genesis 49
udp_genesis 50 subtype IP_Address_Text is String(1 .. 15);
udp_genesis 51
udp_genesis 52
udp_genesis 53 type Socket is private;
udp_genesis 54
udp_genesis 55
udp_genesis 56
udp_genesis 57
udp_genesis 58 function IP_To_String(IP : in IP_Address) return IP_Address_Text;
udp_genesis 59
udp_genesis 60
udp_genesis 61 function IP_From_String(IP_Text : in String) return IP_Address;
udp_genesis 62
udp_genesis 63
udp_genesis 64 procedure Open_Socket(S : out Socket;
udp_genesis 65 Local_Endpoint : in Endpoint);
udp_genesis 66
udp_errata_asciil... 67
udp_genesis 68 procedure Close_Socket(S : in out Socket);
udp_genesis 69
udp_genesis 70
udp_genesis 71 procedure Transmit(S : in out Socket;
udp_genesis 72 Destination : in Endpoint;
udp_genesis 73 Payload_Buf : in Payload);
udp_genesis 74
udp_genesis 75
udp_genesis 76
udp_tester 77
udp_genesis 78 procedure Receive(S : in out Socket;
udp_genesis 79 Origin : out Endpoint;
udp_genesis 80 Payload_Buf : out Payload;
udp_tester 81 Recv_Len : out Unsigned_32);
udp_genesis 82
udp_genesis 83
udp_genesis 84 UDP_Invalid_Text_IP : exception;
udp_genesis 85 UDP_Failed_Open : exception;
udp_genesis 86 UDP_Failed_SetOpt : exception;
udp_genesis 87 UDP_Failed_Bind : exception;
udp_genesis 88 UDP_Failed_Transmit : exception;
udp_errata_asciil... 89 UDP_Truncated_Send : exception;
udp_genesis 90 UDP_Failed_Receive : exception;
udp_genesis 91
udp_genesis 92 private
udp_genesis 93
udp_genesis 94
udp_genesis 95
udp_genesis 96
udp_genesis 97 type sockaddr_in is record
udp_genesis 98 family : Unsigned_16;
udp_genesis 99 port : Unsigned_16;
udp_genesis 100 sin_addr : Unsigned_32;
udp_genesis 101 padding : Unsigned_64;
udp_genesis 102 end record;
udp_genesis 103 pragma Convention(C, sockaddr_in);
udp_genesis 104
udp_genesis 105
udp_genesis 106 type Socket is
udp_genesis 107 record
udp_genesis 108 SA : sockaddr_in;
udp_genesis 109 FD : Interfaces.C.int;
udp_genesis 110 end record;
udp_genesis 111 pragma Convention(C, Socket);
udp_genesis 112
udp_genesis 113
udp_genesis 114
udp_genesis 115 procedure Unix_UDP_IP_To_String
udp_genesis 116 (IP : Unsigned_32;
udp_genesis 117 Output_Buffer : System.Address;
udp_genesis 118 Output_Buffer_Size : Unsigned_32);
udp_genesis 119 pragma Import(C, Unix_UDP_IP_To_String, "unix_udp_ip_to_string");
udp_genesis 120
udp_genesis 121 function Unix_UDP_String_To_IP
udp_genesis 122 (Input_Buffer : System.Address;
udp_genesis 123 IP : not null access Unsigned_32) return Interfaces.C.int;
udp_genesis 124 pragma Import(C, Unix_UDP_String_To_IP, "unix_udp_string_to_ip");
udp_genesis 125
udp_genesis 126 function Unix_UDP_Socket_Open
udp_genesis 127 (Socket : System.Address;
udp_genesis 128 Local_IP : Unsigned_32;
udp_genesis 129 Local_Port : Unsigned_16) return Interfaces.C.int;
udp_genesis 130 pragma Import(C, Unix_UDP_Socket_Open, "unix_udp_socket_open");
udp_genesis 131
udp_genesis 132 procedure Unix_UDP_Socket_Close
udp_genesis 133 (Socket : System.Address);
udp_genesis 134 pragma Import(C, Unix_UDP_Socket_Close, "unix_udp_socket_close");
udp_genesis 135
udp_genesis 136 function Unix_UDP_Socket_Transmit
udp_genesis 137 (Socket : System.Address;
udp_genesis 138 Remote_IP : Unsigned_32;
udp_genesis 139 Remote_Port : Unsigned_16;
udp_genesis 140 Payload_Buf : System.Address;
udp_genesis 141 Payload_Len : Unsigned_32) return Interfaces.C.int;
udp_genesis 142 pragma Import(C, Unix_UDP_Socket_Transmit, "unix_udp_socket_transmit");
udp_genesis 143
udp_genesis 144 function Unix_UDP_Socket_Receive
udp_genesis 145 (Socket : System.Address;
udp_genesis 146 Origin_IP : not null access Unsigned_32;
udp_genesis 147 Origin_Port : not null access Unsigned_16;
udp_genesis 148 Payload_Buf : System.Address;
udp_genesis 149 Payload_Len : Unsigned_32) return Interfaces.C.int;
udp_genesis 150 pragma Import(C, Unix_UDP_Socket_Receive, "unix_udp_socket_receive");
udp_genesis 151
udp_genesis 152 end UDP;