- 41D0512D8759CBCB10D753A22A86B6BDAF96FCCF779E2BBDABF4A1C7EFCA7A4F8F9047984D6CC2350B7625715AAC26C0CCD49C7BACA765811E0C0BCC0ABABF22
+ A7E2A069125E5476D4EAFA10C4B674A1776325568DA5700B2E8ADF626F9BB3AA07C28B1435DFF4BE3C085AEF3C963DD90A22C91F3D47ABF4A5B205B0B84AB842
udp/libudp/udp.ads
(20 . 14)(20 . 13)
126 with Interfaces, Interfaces.C; use Interfaces, Interfaces.C;
127 with System; use System;
128
129 generic
130 Payload_Size : in Positive; -- to allow for diff sizes at runtime
131
132 package UDP is
133
134 pragma Preelaborate;
135
136 -- This is subject to debate:
137 Payload_Size : constant Positive := 512;
138
139
140 type Payload is array(1 .. Payload_Size) of Unsigned_8;
141
142 subtype IP_Address is Unsigned_32;
(35 . 6)(34 . 9)
144
145 -- Magic that puts emitter on 'any' local interface
146 INADDR_ANY : constant Unsigned_32 := 0;
147
148 -- Bit-level compare of 2 payloads, returns number of different bits
149 function Bit_Compare(A: in Payload; B: in Payload) return Natural;
150
151 -- An local or remote address:port
152 type Endpoint is
(72 . 10)(74 . 11)
154
155 -- Wait (potentially forever!) for a Payload, via Socket; save its Origin,
156 -- and whether the received Payload was valid (i.e. expected length):
157 -- replaced Valid with actual received length for testing purpose
158 procedure Receive(S : in out Socket;
159 Origin : out Endpoint;
160 Payload_Buf : out Payload;
161 Valid : out Boolean);
162 Recv_Len : out Unsigned_32);
163
164 -- Eggogology:
165 UDP_Invalid_Text_IP : exception;