1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115 | ------------------------------------------------------------------------------
-- --
-- POSIX.5c VALIDATION TEST SUITE --
-- --
-- P 1 8 0 4 0 2 A --
-- --
-- B o d y --
-- --
-- --
-- Copyright (c) 1995-1999 Florida State University (FSU). All Rights --
-- Reserved. --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. This software is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. You should have received a --
-- copy of the GNU General Public License distributed with GNARL; see --
-- file COPYING. If not, write to the Free Software Foundation, 59 --
-- Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- Under contract GS-35F-4506G, the U. S. Government obtained unlimited --
-- rights in the software and documentation contained herein. Unlimited --
-- rights are defined in DFAR 252,227-7013(a)(19). By making this public --
-- release, the Government intends to confer upon all recipients --
-- unlimited rights equal to those held by the Government. These rights --
-- include rights to use, duplicate, release or disclose the released --
-- data an computer software in whole or in part, in any manner and for --
-- any purpose whatsoever, and to have or permit others to do so. --
-- --
-- DISCLAIMER -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE --
-- AVAILABLE OR DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR --
-- IMPLIED WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS --
-- OF THE SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE --
-- AVAILABLE OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS --
-- FOR A PARTICULAR PURPOSE OF SAID MATERIAL. --
-- --
------------------------------------------------------------------------------
-- Multiprocess integrated test for package POSIX_Sockets
-- in IEEE Std 1003.5c Section 18.4 with package
-- POSIX_Sockets_Interent.
-- This test covers only features that depend only on
-- the packages (POSIX_Sockets/_Interent) and features from
-- other packages that are required to be supported.
with POSIX,
POSIX_Sockets,
POSIX_Sockets_Internet,
POSIX_Report,
POSIX_Process_Environment,
POSIX_IO;
-- Unchecked_Conversion,
-- Test_Parameters,
-- System;
-- with Ada.Integer_Text_IO;
-- with Ada.Text_IO;
procedure p180402a is
use POSIX,
POSIX_Sockets,
POSIX_Sockets_Internet,
POSIX_IO,
POSIX_Process_Environment,
-- Test_Parameters,
POSIX_Report;
-- These are declared in Posix.C but not intended to be used from there
PF_MAX : constant := 25;
PF_UNSPEC : constant := 0;
PF_LOCAL : constant := 1;
PF_UNIX : constant := 1;
PF_INET : constant := 2;
PF_OSI : constant := 19;
-- *** MISSING: PF_ISO *** --
PF_ISO : constant := 0;
IPPROTO_IP : constant := 0;
IPPROTO_ICMP : constant := 1;
IPPROTO_TCP : constant := 6;
IPPROTO_UDP : constant := 17;
IPPROTO_RAW : constant := 255;
Socket : POSIX_IO.File_Descriptor := 0;
Int_Add : aliased Internet_Socket_Address;
Name : Internet_Socket_Address_Pointer :=
Int_Add'Unchecked_Access;
Port : Internet_Port;
--------------------------------------------------------------------------
-- Begin Tests
begin
-----------------------------------------------------------------------
-- Make a connection
Comment ("p180402a");
Socket := Create (PF_INET, Stream_Socket, IPPROTO_TCP);
Port := Internet_Port (Integer'Value
(To_String (Value (Argument_List, 3))));
Set_Internet_Port (Int_Add, Port);
Set_Internet_Address (Int_Add,
String_To_Internet_Address ("127.0.0.1"));
Connect (Socket, +Name);
Close (Socket);
exception when E : others => Fatal_Exception (E, "A666");
end p180402a;
|