diff options
Diffstat (limited to 'c/src/lib/libbsp/i386/ts_386ex/tools/network_ada')
24 files changed, 0 insertions, 3020 deletions
diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/README b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/README deleted file mode 100644 index f13242d945..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/README +++ /dev/null @@ -1,8 +0,0 @@ -The code and examples in this sub-directory have been adapted from -Samuel Tardieu's adasockets-0.1.3 library to work with RTEMS and -FreeBSD sockets. - -The Ada source files which were modified are sockets-multicast.adb, -sockets-thin.ads, sockets-constants.ads, and sockets-naming.adb - -Tony Ambardar, 8/8/99
\ No newline at end of file diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/AUTHORS b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/AUTHORS deleted file mode 100644 index 29e6e9ba7c..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/AUTHORS +++ /dev/null @@ -1,7 +0,0 @@ -Samuel Tardieu -ENST -- Département Informatique -46, rue Barrault -75634 Paris Cedex 13 -E-mail: sam@inf.enst.fr -URL: http://www.inf.enst.fr/~tardieu/ - diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/COPYING b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/COPYING deleted file mode 100644 index 60549be514..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) 19yy <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/NEWS b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/NEWS deleted file mode 100644 index 6990e32019..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/NEWS +++ /dev/null @@ -1,44 +0,0 @@ --*- outline -*- - -* New in AdaSockets 0.1.3 - -** Support for IP multicast - -The package Sockets.Multicast can be used to create Multicast -interfaces on machine that support it. - -** Interface changes - -Some functions have been transformed into procedures to ease the -addition of multicast sockets. - -** New example - -The multi example can be used as both a multicast sender and receiver. - -* New in AdaSockets 0.1.2 - -** Warning suppressed - -Some versions of GNAT were detecting incorrectly a missing raise in -some cases. Signaled by Nicolas Ollinger <Nicolas.Ollinger@ens-lyon.fr>. - -** New example - -A listener example which is only a server has been added to avoid any -confusion between clients and servers. Suggestion by Scott Moody -<scott@plato.ds.boeing.com>. - -* New in AdaSockets 0.1.1 - -** `aux' -> `support' - -The subdirectory `aux' in the distribution has been renamed into -`support' to avoid a name clash on Windows NT with the standard -peripherical `aux'. Suggestion from Juanma Barranquero -<barranquero@laley-actualidad.es>. - -** Better error messages - -Exception raised during the connection now have messages in many cases -explaining why the connexion could not be made. diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/README b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/README deleted file mode 100644 index 2192f8d334..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/README +++ /dev/null @@ -1,35 +0,0 @@ -README file for adasockets version 0.1.3 (beta) - -AdaSockets is a medium binding (it is not a thin binding because it uses Ada -types and not a thick binding because you have the same subprogram names as -in C) for using BSD-style sockets in Ada. - -This package is in no way complete! This is a half-day work that will be -extended in the future. If there is an extension that you would like to see in, -drop a note to the author (Samuel Tardieu <sam@inf.enst.fr>). - -As you may have noticed, the name is not really original. If you have a better -name, send me a note with your suggestion. - -AdaSockets 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. AdaSockets 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 AdaSockets; -see file COPYING. If not, write to the Free Software Foundation, 59 -Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -As a special exception, if other files instantiate generics from this -unit, or you link this unit with other files to produce an executable, -this unit does not by itself cause the resulting executable to be -covered by the GNU General Public License. This exception does not -however invalidate any other reasons why the executable file might be -covered by the GNU Public License. - -The main repository for this software is located at: - http://www-inf.enst.fr/ANC/ - -The author, Samuel Tardieu <sam@inf.enst.fr> diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-constants.ads b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-constants.ads deleted file mode 100644 index b5c07b79c5..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-constants.ads +++ /dev/null @@ -1,50 +0,0 @@ --- This package has been generated automatically on: --- Linux wasp 2.0.36 #1 Tue Dec 29 13:11:13 EST 1998 i586 --- unknown --- Generation date: Fri Mar 5 00:03:14 PST 1999 --- Any change you make here is likely to be lost ! -package Sockets.Constants is - Tcp_Nodelay : constant := 16#0001#; - Af_Inet : constant := 16#0002#; - Sock_Stream : constant := 16#0001#; - Sock_Dgram : constant := 16#0002#; - Eintr : constant := 16#0004#; - Eagain : constant := 16#000B#; - Ewouldblock : constant := 16#000B#; - Einprogress : constant := 16#0077#; - Ealready : constant := 16#0078#; - Eisconn : constant := 16#007F#; - Econnrefused : constant := 16#006F#; - Fndelay : constant := 16#0004#; - Fasync : constant := 16#0040#; - F_Getfl : constant := 16#0003#; - F_Setfl : constant := 16#0004#; - F_Setown : constant := 16#0006#; - So_Rcvbuf : constant := 16#1002#; - So_Reuseaddr : constant := 16#0004#; - Sol_Socket : constant := 16#FFFF#; - Sigterm : constant := 16#000F#; - Sigkill : constant := 16#0009#; - O_Rdonly : constant := 16#0000#; - O_Wronly : constant := 16#0001#; - O_Rdwr : constant := 16#0002#; - Host_Not_Found : constant := 16#0001#; - Try_Again : constant := 16#0002#; - No_Recovery : constant := 16#0003#; - No_Data : constant := 16#0004#; - No_Address : constant := 16#0004#; - Pollin : constant := 16#0001#; - Pollpri : constant := 16#0002#; - Pollout : constant := 16#0004#; - Pollerr : constant := 16#0008#; - Pollhup : constant := 16#0010#; - Pollnval : constant := 16#0020#; - I_Setsig : constant := -1; - S_Rdnorm : constant := -1; - S_Wrnorm : constant := -1; - Ipproto_Ip : constant := 16#0000#; - Ip_Add_Membership : constant := 16#000C#; - Ip_Multicast_Loop : constant := 16#000B#; - Ip_Multicast_Ttl : constant := 16#000A#; - Ip_Drop_Membership : constant := 16#000D#; -end Sockets.Constants; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-link.ads b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-link.ads deleted file mode 100644 index 6572e48f71..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-link.ads +++ /dev/null @@ -1,42 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S . L I N K -- --- -- --- S p e c -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -private package Sockets.Link is - - -- pragma Linker_Options ("-lnsl"); - -- pragma Linker_Options ("-lsocket"); - -end Sockets.Link; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-multicast.adb b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-multicast.adb deleted file mode 100644 index f34bcb6720..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-multicast.adb +++ /dev/null @@ -1,130 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S . M U L T I C A S T -- --- -- --- B o d y -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Ada.Exceptions; use Ada.Exceptions; -with Interfaces.C; use Interfaces.C; -with Sockets.Constants; use Sockets.Constants; -with Sockets.Naming; use Sockets.Naming; -with Sockets.Thin; use Sockets.Thin; -with Sockets.Utils; use Sockets.Utils; - -package body Sockets.Multicast is - - use Ada.Streams; - - procedure Setsockopt_Add_Membership is - new Customized_Setsockopt (IPPROTO_IP, IP_ADD_MEMBERSHIP, Ip_Mreq); - - ----------------------------- - -- Create_Multicast_Socket -- - ----------------------------- - - function Create_Multicast_Socket - (Group : String; - Port : Positive; - TTL : Positive := 16; - Self_Loop : Boolean := True) - return Multicast_Socket_FD - is - Result : Multicast_Socket_FD; - Mreq : aliased Ip_Mreq; - C_Self_Loop : Integer; - begin - Socket (Socket_FD (Result), AF_INET, SOCK_DGRAM); - if Self_Loop then - C_Self_Loop := 1; - else - C_Self_Loop := 0; - end if; - Setsockopt (Result, SOL_SOCKET, SO_REUSEADDR, 1); - Bind (Result, Port); - Mreq.Imr_Multiaddr := To_In_Addr (Address_Of (Group)); - Setsockopt_Add_Membership (Result, Mreq); - Setsockopt (Result, IPPROTO_IP, IP_MULTICAST_TTL, TTL); - Setsockopt (Result, IPPROTO_IP, IP_MULTICAST_LOOP, C_Self_Loop); - Result.Target := (Result.Target'Size / 8, - Constants.Af_Inet, - Port_To_Network (unsigned_short (Port)), - To_In_Addr (Address_Of (Group)), - (others => char'Val (0))); - return Result; - end Create_Multicast_Socket; - - ---------- - -- Send -- - ---------- - - procedure Send (Socket : in Multicast_Socket_FD; - Data : in Stream_Element_Array) - is - Sin : aliased Sockaddr_In := Socket.Target; - Index : Stream_Element_Offset := Data'First; - Rest : Stream_Element_Count := Data'Length; - Count : int; - begin - while Rest > 0 loop - Count := C_Sendto (Socket.FD, - Data (Index) 'Address, - int (Rest), - 0, - Sin'Address, - Sin'Size / 8); - if Count < 0 then - Raise_With_Message ("Send failed"); - elsif Count = 0 then - raise Connection_Closed; - end if; - Index := Index + Stream_Element_Count (Count); - Rest := Rest - Stream_Element_Count (Count); - end loop; - end Send; - - ------------ - -- Socket -- - ------------ - - procedure Socket - (Sock : out Multicast_Socket_FD; - Domain : in Socket_Domain := AF_INET; - Typ : in Socket_Type := SOCK_STREAM) - is - begin - Raise_Exception (Program_Error'Identity, - "Use Create_Multicast_Socket instead"); - Sock := Sock; -- To keep the compiler happy - end Socket; - -end Sockets.Multicast; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-multicast.ads b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-multicast.ads deleted file mode 100644 index 3942ed0547..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-multicast.ads +++ /dev/null @@ -1,71 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S . M U L T I C A S T -- --- -- --- S p e c -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Sockets.Thin; - -package Sockets.Multicast is - - pragma Elaborate_Body; - - -- This package aims at helping the creation of multicast sockets - - type Multicast_Socket_FD is new Socket_FD with private; - - function Create_Multicast_Socket - (Group : String; - Port : Positive; - TTL : Positive := 16; - Self_Loop : Boolean := True) - return Multicast_Socket_FD; - -- Create a multicast socket - - procedure Send (Socket : in Multicast_Socket_FD; - Data : in Ada.Streams.Stream_Element_Array); - -- Send data over a multicast socket - -private - - procedure Socket - (Sock : out Multicast_Socket_FD; - Domain : in Socket_Domain := AF_INET; - Typ : in Socket_Type := SOCK_STREAM); - -- Do not call this one, it will raise Program_Error - - type Multicast_Socket_FD is new Socket_FD with record - Target : Sockets.Thin.Sockaddr_In; - end record; - -end Sockets.Multicast; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-naming.adb b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-naming.adb deleted file mode 100644 index 4faa989138..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-naming.adb +++ /dev/null @@ -1,411 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S . N A M I N G -- --- -- --- B o d y -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1996-1998 Free Software Foundation -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Ada.Exceptions; -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Sockets.Constants; use Sockets.Constants; -with Ada.Unchecked_Conversion; -with Ada.Unchecked_Deallocation; - -package body Sockets.Naming is - - use Sockets.Constants, Sockets.Thin; - - Default_Buffer_Size : constant := 16384; - - procedure Free is - new Ada.Unchecked_Deallocation (String, String_Access); - - procedure Free is - new Ada.Unchecked_Deallocation (char_array, char_array_access); - - function Allocate (Size : Positive := Default_Buffer_Size) - return char_array_access; - -- Allocate a buffer - - function Parse_Entry (Host : Hostent) - return Host_Entry; - -- Parse an entry - - procedure Raise_Naming_Error - (Errno : in C.int; - Message : in String); - -- Raise the exception Naming_Error with an appropriate error message - - C_Errno : C.int; - pragma Import (C, C_Errno, "h_errno"); - - ---------------- - -- Address_Of -- - ---------------- - - function Address_Of (Something : String) - return Address - is - begin - if Is_IP_Address (Something) then - return Value (Something); - else - return Info_Of (Something) .Addresses (1); - end if; - end Address_Of; - - ------------ - -- Adjust -- - ------------ - - procedure Adjust (Object : in out Host_Entry) - is - Aliases : String_Array renames Object.Aliases; - begin - Object.Name := new String'(Object.Name.all); - for I in Aliases'Range loop - Aliases (I) := new String'(Aliases (I) .all); - end loop; - end Adjust; - - -------------- - -- Allocate -- - -------------- - - function Allocate - (Size : Positive := Default_Buffer_Size) - return char_array_access - is - begin - return new char_array (1 .. size_t (Size)); - end Allocate; - - ----------------- - -- Any_Address -- - ----------------- - - function Any_Address return Address - is - begin - return To_Address (Inaddr_Any); - end Any_Address; - - -------------- - -- Finalize -- - -------------- - - procedure Finalize (Object : in out Host_Entry) - is - Aliases : String_Array renames Object.Aliases; - begin - Free (Object.Name); - for I in Aliases'Range loop - Free (Aliases (I)); - end loop; - end Finalize; - - --------------- - -- Host_Name -- - --------------- - - function Host_Name return String - is - Buff : char_array_access := Allocate; - Buffer : constant chars_ptr := To_Chars_Ptr (Buff); - Res : constant int := C_Gethostname (Buffer, Buff'Length); - begin - if Res = Failure then - Free (Buff); - Raise_Naming_Error (C_Errno, ""); - end if; - declare - Result : constant String := Value (Buffer); - begin - Free (Buff); - return Result; - end; - end Host_Name; - - ----------- - -- Image -- - ----------- - - function Image (Add : Address) return String - is - - function Image (A : Address_Component) return String; - -- Return the string corresponding to its argument without - -- the leading space. - - ----------- - -- Image -- - ----------- - - function Image (A : Address_Component) - return String - is - Im : constant String := Address_Component'Image (A); - begin - return Im (Im'First + 1 .. Im'Last); - end Image; - - begin - return Image (Add.H1) & "." & Image (Add.H2) & "." & - Image (Add.H3) & "." & Image (Add.H4); - end Image; - - ----------- - -- Image -- - ----------- - - function Image (Add : Thin.In_Addr) return String is - begin - return Image (To_Address (Add)); - end Image; - - ------------- - -- Info_Of -- - ------------- - - function Info_Of (Name : String) - return Host_Entry - is - Res : Hostent_Access; - C_Name : chars_ptr := New_String (Name); - begin - Res := C_Gethostbyname (C_Name); - Free (C_Name); - if Res = null then - Raise_Naming_Error (C_Errno, Name); - end if; - declare - Result : constant Host_Entry := Parse_Entry (Res.all); - begin - return Result; - end; - end Info_Of; - - ------------- - -- Info_Of -- - ------------- - - function Info_Of (Addr : Address) - return Host_Entry - is - function Convert is - new Ada.Unchecked_Conversion (Source => In_Addr_Access, - Target => chars_ptr); - Temp : aliased In_Addr := To_In_Addr (Addr); - C_Addr : constant chars_ptr := Convert (Temp'Unchecked_Access); - Res : Hostent_Access; - begin - Res := C_Gethostbyaddr (C_Addr, - C.int (Temp'Size / CHAR_BIT), - Constants.Af_Inet); - if Res = null then - Raise_Naming_Error (C_Errno, Image (Addr)); - end if; - declare - Result : constant Host_Entry := Parse_Entry (Res.all); - begin - return Result; - end; - end Info_Of; - - ------------------------ - -- Info_Of_Name_Or_IP -- - ------------------------ - - function Info_Of_Name_Or_IP (Something : String) - return Host_Entry - is - begin - if Is_IP_Address (Something) then - return Info_Of (Value (Something)); - else - return Info_Of (Something); - end if; - end Info_Of_Name_Or_IP; - - ------------------- - -- Is_Ip_Address -- - ------------------- - - function Is_IP_Address (Something : String) - return Boolean - is - begin - for Index in Something'Range loop - declare - Current : Character renames Something (Index); - begin - if (Current < '0' - or else Current > '9') - and then Current /= '.' then - return False; - end if; - end; - end loop; - return True; - end Is_IP_Address; - - ------------- - -- Name_Of -- - ------------- - - function Name_Of (Something : String) - return String - is - Hostent : constant Host_Entry := Info_Of_Name_Or_IP (Something); - begin - if Hostent.Name = null then - Ada.Exceptions.Raise_Exception (Naming_Error'Identity, - "No name for " & Something); - end if; - return Hostent.Name.all; - end Name_Of; - - ----------------- - -- Parse_Entry -- - ----------------- - - function Parse_Entry (Host : Hostent) - return Host_Entry - is - C_Aliases : constant Thin.Chars_Ptr_Array := - Chars_Ptr_Pointers.Value (Host.H_Aliases); - C_Addr : constant In_Addr_Access_Array := - In_Addr_Access_Pointers.Value - (Host.H_Addr_List); - Result : Host_Entry (N_Aliases => C_Aliases'Length - 1, - N_Addresses => C_Addr'Length - 1); - begin - Result.Name := new String'(Value (Host.H_Name)); - for I in 1 .. Result.Aliases'Last loop - declare - Index : Natural := I - 1 + Natural (C_Aliases'First); - Current : chars_ptr renames C_Aliases (size_t (Index)); - begin - Result.Aliases (I) := new String'(Value (Current)); - end; - end loop; - for I in Result.Addresses'Range loop - declare - Index : Natural := I - 1 + Natural (C_Addr'First); - Current : In_Addr_Access renames C_Addr (Index); - begin - Result.Addresses (I) := To_Address (Current.all); - end; - end loop; - return Result; - end Parse_Entry; - - ------------------------ - -- Raise_Naming_Error -- - ------------------------ - - procedure Raise_Naming_Error - (Errno : in C.int; - Message : in String) - is - - function Error_Message return String; - -- Return the message according to Errno. - - ------------------- - -- Error_Message -- - ------------------- - - function Error_Message return String is - begin - case Errno is - when Host_Not_Found => return "Host not found"; - when Try_Again => return "Try again"; - when No_Recovery => return "No recovery"; - when No_Address => return "No address"; - when others => return "Unknown error" & - C.int'Image (Errno); - end case; - end Error_Message; - - begin - Ada.Exceptions.Raise_Exception (Naming_Error'Identity, - Error_Message & ": " & Message); - end Raise_Naming_Error; - - ---------------- - -- To_Address -- - ---------------- - - function To_Address (Addr : In_Addr) return Address - is - begin - return (H1 => Address_Component (Addr.S_B1), - H2 => Address_Component (Addr.S_B2), - H3 => Address_Component (Addr.S_B3), - H4 => Address_Component (Addr.S_B4)); - end To_Address; - - ---------------- - -- To_In_Addr -- - ---------------- - - function To_In_Addr (Addr : Address) return In_Addr - is - begin - return (S_B1 => unsigned_char (Addr.H1), - S_B2 => unsigned_char (Addr.H2), - S_B3 => unsigned_char (Addr.H3), - S_B4 => unsigned_char (Addr.H4)); - end To_In_Addr; - - ----------- - -- Value -- - ----------- - - function Value (Add : String) return Address - is - function Convert is - new Ada.Unchecked_Conversion (Source => Interfaces.Unsigned_32, - Target => In_Addr); - C_Add : chars_ptr := New_String (Add); - Converted : constant In_Addr := Convert (C_Inet_Addr (C_Add)); - begin - Free (C_Add); - return (H1 => Address_Component (Converted.S_B1), - H2 => Address_Component (Converted.S_B2), - H3 => Address_Component (Converted.S_B3), - H4 => Address_Component (Converted.S_B4)); - end Value; - -end Sockets.Naming; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-naming.ads b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-naming.ads deleted file mode 100644 index e66927172e..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-naming.ads +++ /dev/null @@ -1,113 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S . N A M I N G -- --- -- --- S p e c -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1996-1998 Free Software Foundation -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Ada.Finalization; -with Sockets.Thin; - -package Sockets.Naming is - - type String_Access is access String; - - type String_Array is array (Positive range <>) of String_Access; - - subtype Address_Component is Natural range 0 .. 255; - - type Address is record - H1, H2, H3, H4 : Address_Component; - end record; - -- An IPv4 address such as 137.194.160.12 - - type Address_Array is array (Positive range <>) of Address; - - type Host_Entry (N_Aliases, N_Addresses : Natural) is - new Ada.Finalization.Controlled with record - Name : String_Access; - Aliases : String_Array (1 .. N_Aliases); - Addresses : Address_Array (1 .. N_Addresses); - end record; - -- A complete host structure. A host may have several IP addresses as - -- well as several aliases. - - procedure Adjust (Object : in out Host_Entry); - procedure Finalize (Object : in out Host_Entry); - - Naming_Error : exception; - -- This exception is raised when a name cannot be resolved - - function Image (Add : Address) return String; - -- The dotted form corresponding to an IP address - - function Image (Add : Thin.In_Addr) return String; - -- The dotted form corresponding to the packed form of an IP address - - function Value (Add : String) return Address; - -- The IP address corresponding to a dotted form - - function Info_Of (Name : String) - return Host_Entry; - -- Host entry of an IP name - - function Info_Of (Addr : Address) - return Host_Entry; - -- Host entry of an IP address - - function Is_IP_Address (Something : String) - return Boolean; - -- Return True if the name looks like an IP address, False otherwise - - function Info_Of_Name_Or_IP (Something : String) - return Host_Entry; - -- Host entry of an IP name or a dotted form - - function Address_Of (Something : String) return Address; - -- Address of an IP name or a dotted form - - function Host_Name return String; - -- Return the name of the current host - - function Name_Of (Something : String) return String; - -- Return the official name of an IP name or a dotted form - - function To_In_Addr (Addr : Address) return Thin.In_Addr; - -- Convert an IP address to a In_Addr structure - - function To_Address (Addr : Thin.In_Addr) return Address; - -- Convert a In_Addr structure to an IP address - - function Any_Address return Address; - -- Return the value of inaddr_any - -end Sockets.Naming; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-thin.ads b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-thin.ads deleted file mode 100644 index cb0b006dd8..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-thin.ads +++ /dev/null @@ -1,440 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S . T H I N -- --- -- --- S p e c -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1996-1998 Free Software Foundation -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Interfaces.C.Pointers; -with Interfaces.C.Strings; -with System; - -package Sockets.Thin is - - package C renames Interfaces.C; - package Strings renames C.Strings; - generic package Pointers renames C.Pointers; - - use type C.int; - -- This is an ugly hack to be able to declare the Failure constant - -- below. - - Success : constant C.int := 0; - Failure : constant C.int := -1; - - type Int_Access is access all C.int; - pragma Convention (C, Int_Access); - -- Access to C integers - - type pid_t is new C.int; - pragma Convention (C, pid_t); - - type mode_t is new C.int; - pragma Convention (C, mode_t); - - type key_t is new C.int; - pragma Convention (C, key_t); - - type Chars_Ptr_Array is array (C.size_t range <>) of - aliased Strings.chars_ptr; - - package Chars_Ptr_Pointers is - new Pointers (C.size_t, Strings.chars_ptr, Chars_Ptr_Array, - Strings.Null_Ptr); - -- Arrays of C (char *) - - type In_Addr is record - S_B1, S_B2, S_B3, S_B4 : C.unsigned_char; - end record; - pragma Convention (C, In_Addr); - -- Internet address - - type In_Addr_Access is access all In_Addr; - pragma Convention (C, In_Addr_Access); - -- Access to internet address - - Inaddr_Any : aliased constant In_Addr := (others => 0); - -- Any internet address (all the interfaces) - - type In_Addr_Access_Array is array (Positive range <>) - of aliased In_Addr_Access; - pragma Convention (C, In_Addr_Access_Array); - package In_Addr_Access_Pointers is - new Pointers (Positive, In_Addr_Access, In_Addr_Access_Array, - null); - -- Array of internet addresses - - type Sockaddr is record - Sa_Len : C.unsigned_char; - Sa_Family : C.unsigned_char; - Sa_Data : C.char_array (1 .. 14); - end record; - pragma Convention (C, Sockaddr); - -- Socket address - - type Sockaddr_Access is access all Sockaddr; - pragma Convention (C, Sockaddr_Access); - -- Access to socket address - - type Sockaddr_In is record - Sin_Len : C.unsigned_char; - Sin_Family : C.unsigned_char; - Sin_Port : C.unsigned_short := 0; - Sin_Addr : In_Addr := Inaddr_Any; - Sin_Zero : C.char_array (1 .. 8) := (others => C.char'Val (0)); - end record; - pragma Convention (C, Sockaddr_In); - -- Internet socket address - - type Sockaddr_In_Access is access all Sockaddr_In; - pragma Convention (C, Sockaddr_In_Access); - -- Access to internet socket address - - type Ip_Mreq is record - Imr_Multiaddr : In_Addr; - Imr_Interface : In_Addr := Inaddr_Any; - end record; - pragma Convention (C, Ip_Mreq); - -- Multicast structure - - type Hostent is record - H_Name : Strings.chars_ptr; - H_Aliases : Chars_Ptr_Pointers.Pointer; - H_Addrtype : C.int; - H_Length : C.int; - H_Addr_List : In_Addr_Access_Pointers.Pointer; - end record; - pragma Convention (C, Hostent); - -- Host entry - - type Hostent_Access is access all Hostent; - pragma Convention (C, Hostent_Access); - -- Access to host entry - - type Caddr_T is new Strings.chars_ptr; - -- Type Caddr_T is in fact a (char *) - - type Iovec is record - Iov_Base : Caddr_T; - Iov_Len : C.int; - end record; - pragma Convention (C, Iovec); - -- Iovec C type - - type Iovec_Access is access all Iovec; - pragma Convention (C, Iovec_Access); - -- Access to Iovec structure - - type Msghdr is record - Msg_Name : Caddr_T; - Msg_Namelen : C.int; - Msg_Iov : Iovec_Access; - Msg_Iovlen : C.int; - Msg_Accrights : Caddr_T; - Msg_Accrightslen : C.int; - end record; - pragma Convention (C, Msghdr); - -- Message header - - type Msghdr_Access is access all Msghdr; - pragma Convention (C, Msghdr_Access); - -- Access to message header. - - type Two_Int is array (0 .. 1) of C.int; - pragma Convention (C, Two_Int); - -- Used with pipe() - - type Pollfd is record - Fd : C.int; - Events : C.short; - Revents : C.short; - end record; - pragma Convention (C, Pollfd); - - type Pollfd_Array is array (Positive range <>) of Pollfd; - pragma Convention (C, Pollfd_Array); - - function C_Accept - (S : C.int; - Addr : System.Address; - Addrlen : access C.int) - return C.int; - - function C_Bind - (S : C.int; - Name : System.Address; - Namelen : C.int) - return C.int; - - procedure C_Close (Fildes : C.int); - - function C_Connect - (S : C.int; - Name : System.Address; - Namelen : C.int) - return C.int; - - function C_Dup2 (Fildes, Fildes2 : C.int) return C.int; - - function C_Fcntl - (Fildes : C.int; - Cmd : C.int; - Arg : C.int := 0) - return C.int; - - function C_Getenv - (Name : Strings.chars_ptr) - return Strings.chars_ptr; - - function C_Gethostbyaddr - (Addr : Strings.chars_ptr; - Length : C.int; - Typ : C.int) - return Hostent_Access; - - function C_Gethostbyname - (Name : Strings.chars_ptr) - return Hostent_Access; - - function C_Gethostname - (Name : Strings.chars_ptr; - Namelen : C.int) - return C.int; - - function C_Getpeername - (S : C.int; - Name : Sockaddr_Access; - Namelen : access C.int) - return C.int; - - function C_Getpid return pid_t; - - function C_Getsockname - (S : C.int; - Name : Sockaddr_Access; - Namelen : access C.int) - return C.int; - - function C_Getsockopt - (S : C.int; - Level : C.int; - Optname : C.int; - Optval : Strings.chars_ptr; - Optlen : access C.int) - return C.int; - - function C_Inet_Addr - (Cp : Strings.chars_ptr) - return Interfaces.Unsigned_32; - - function C_Inet_Network - (Cp : Strings.chars_ptr) - return Interfaces.Unsigned_32; - - function C_Inet_Makeaddr - (Net : C.int; - Lna : C.int) - return In_Addr; - - function C_Inet_Lnaof (I : In_Addr) return C.int; - - function C_Inet_Netof (I : In_Addr) return C.int; - - function C_Inet_Ntoa (I : In_Addr) return Strings.chars_ptr; - - function C_Kill (Pid : pid_t; Sig : C.int) return C.int; - - function C_Listen (S, Backlog : C.int) return C.int; - - function C_Msgget - (Key : key_t; - Msgflg : C.int) - return C.int; - - function C_Msgrcv - (Msqid : C.int; - Msgp : Strings.chars_ptr; - Msgsz : C.int; - Msgtyp : C.long; - Msgflg : C.int) - return C.int; - - function C_Msgsnd - (Msqid : C.int; - Msgp : Strings.chars_ptr; - Msgsz : C.int; - Msgflg : C.int) - return C.int; - - function C_Open - (Path : Strings.chars_ptr; - Oflag : C.int; - Mode : mode_t := 0) - return C.int; - - function C_Pipe (Filedes : access Two_Int) return C.int; - - function C_Poll - (Fds : System.Address; - Nfds : C.unsigned_long; - Timeout : C.int) - return C.int; - - function C_Read - (Fildes : C.int; - Buf : System.Address; - Nbyte : C.int) - return C.int; - - function C_Readv - (Fildes : C.int; - Iov : Iovec_Access; - Iovcnt : C.int) - return C.int; - - function C_Recv (S : C.int; Buf : System.Address; Len, Flags : C.int) - return C.int; - - function C_Recvfrom - (S : C.int; - Buf : System.Address; - Len : C.int; - Flags : C.int; - From : System.Address; - Fromlen : access C.int) - return C.int; - - function C_Recvmsg - (S : C.int; - Msg : Msghdr_Access; - Flags : C.int) - return C.int; - - function C_Send - (S : C.int; - Msg : System.Address; - Len : C.int; - Flags : C.int) - return C.int; - - function C_Sendmsg - (S : C.int; - Msg : Msghdr_Access; - Flags : C.int) - return C.int; - - function C_Sendto - (S : C.int; - Msg : System.Address; - Len : C.int; - Flags : C.int; - To : System.Address; - Tolen : C.int) - return C.int; - - function C_Setsid return pid_t; - - function C_Setsockopt - (S : C.int; - Level : C.int; - Optname : C.int; - Optval : System.Address; - Optlen : C.int) - return C.int; - - procedure C_Shutdown - (S : in C.int; - How : in C.int); - - function C_Socket (Domain, Typ, Protocol : C.int) return C.int; - - function C_Strerror (Errnum : C.int) return Strings.chars_ptr; - - function C_Write - (Fildes : C.int; - Buf : System.Address; - Nbyte : C.int) - return C.int; - - function C_Writev - (Fildes : C.int; - Iov : Iovec_Access; - Iovcnt : C.int) - return C.int; - -private - - pragma Import (C, C_Accept, "accept"); - pragma Import (C, C_Bind, "bind"); - pragma Import (C, C_Close, "close"); - pragma Import (C, C_Connect, "connect"); - pragma Import (C, C_Dup2, "dup2"); - pragma Import (C, C_Fcntl, "fcntl"); - pragma Import (C, C_Getenv, "getenv"); - pragma Import (C, C_Gethostbyaddr, "gethostbyaddr"); - pragma Import (C, C_Gethostbyname, "gethostbyname"); - pragma Import (C, C_Gethostname, "gethostname"); - pragma Import (C, C_Getpeername, "getpeername"); - pragma Import (C, C_Getpid, "getpid"); - pragma Import (C, C_Getsockname, "getsockname"); - pragma Import (C, C_Getsockopt, "getsockopt"); - pragma Import (C, C_Inet_Addr, "inet_addr"); - pragma Import (C, C_Inet_Network, "inet_network"); - pragma Import (C, C_Inet_Makeaddr, "inet_makeaddr"); - pragma Import (C, C_Inet_Lnaof, "inet_lnaof"); - pragma Import (C, C_Inet_Netof, "inet_netof"); - pragma Import (C, C_Inet_Ntoa, "inet_ntoa"); - pragma Import (C, C_Kill, "kill"); - pragma Import (C, C_Listen, "listen"); - pragma Import (C, C_Msgget, "msgget"); - pragma Import (C, C_Msgrcv, "msgrcv"); - pragma Import (C, C_Msgsnd, "msgsnd"); - pragma Import (C, C_Open, "open"); - pragma Import (C, C_Pipe, "pipe"); - pragma Import (C, C_Poll, "poll"); - pragma Import (C, C_Read, "read"); - pragma Import (C, C_Readv, "readv"); - pragma Import (C, C_Recv, "recv"); - pragma Import (C, C_Recvfrom, "recvfrom"); - pragma Import (C, C_Recvmsg, "recvmsg"); - pragma Import (C, C_Send, "send"); - pragma Import (C, C_Sendmsg, "sendmsg"); - pragma Import (C, C_Sendto, "sendto"); - pragma Import (C, C_Setsid, "setsid"); - pragma Import (C, C_Setsockopt, "setsockopt"); - pragma Import (C, C_Shutdown, "shutdown"); - pragma Import (C, C_Socket, "socket"); - pragma Import (C, C_Strerror, "strerror"); - pragma Import (C, C_Write, "write"); - pragma Import (C, C_Writev, "writev"); - -end Sockets.Thin; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-utils.adb b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-utils.adb deleted file mode 100644 index f605ad59d1..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-utils.adb +++ /dev/null @@ -1,84 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S . U T I L S -- --- -- --- B o d y -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Ada.Exceptions; use Ada.Exceptions; -with GNAT.OS_Lib; use GNAT.OS_Lib; -with System; use System; - -package body Sockets.Utils is - - use Interfaces.C; - - --------------------- - -- Port_To_Network -- - --------------------- - - function Port_To_Network (Port : unsigned_short) - return unsigned_short - is - begin - if Default_Bit_Order = High_Order_First then - return Port; - else - return (Port / 256) + (Port mod 256) * 256; - end if; - end Port_To_Network; - - ------------------------ - -- Raise_With_Message -- - ------------------------ - - procedure Raise_With_Message (Message : in String; - With_Errno : in Boolean := True) - is - begin - if With_Errno then - Raise_Exception (Constraint_Error'Identity, - Message & " (errno is" & Integer'Image (Errno) & - ")"); - else - Raise_Exception (Constraint_Error'Identity, Message); - end if; - - -- The following line works around a bug in GNAT that does not - -- recognize Ada.Exceptions.Raise_Exception as raising an exception, - -- even if it can compute statically that the occurrence cannot - -- be Null_Occurrence ??? - - raise Program_Error; - end Raise_With_Message; - -end Sockets.Utils; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-utils.ads b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-utils.ads deleted file mode 100644 index e5b52510b9..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets-utils.ads +++ /dev/null @@ -1,52 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S . U T I L S -- --- -- --- S p e c -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Interfaces.C; - -private package Sockets.Utils is - - pragma Elaborate_Body; - - procedure Raise_With_Message (Message : in String; - With_Errno : in Boolean := True); - pragma No_Return (Raise_With_Message); - -- Raise Constraint_Error with an associated error message - - function Port_To_Network (Port : Interfaces.C.unsigned_short) - return Interfaces.C.unsigned_short; - pragma Inline (Port_To_Network); - -end Sockets.Utils; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets.adb b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets.adb deleted file mode 100644 index e5b9416969..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets.adb +++ /dev/null @@ -1,409 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S -- --- -- --- B o d y -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; -with Sockets.Constants; use Sockets.Constants; -with Sockets.Link; -pragma Warnings (Off, Sockets.Link); -with Sockets.Naming; use Sockets.Naming; -with Sockets.Thin; use Sockets.Thin; -with Sockets.Utils; use Sockets.Utils; - -package body Sockets is - - use Ada.Streams, Interfaces.C; - - Socket_Domain_Match : constant array (Socket_Domain) of int := - (AF_INET => Constants.Af_Inet); - - Socket_Type_Match : constant array (Socket_Type) of int := - (SOCK_STREAM => Constants.Sock_Stream, - SOCK_DGRAM => Constants.Sock_Dgram); - - Shutdown_Type_Match : constant array (Shutdown_Type) of int := - (Receive => 0, - Send => 1, - Both => 2); - - Socket_Level_Match : constant array (Socket_Level) of int := - (SOL_SOCKET => Constants.Sol_Socket, - IPPROTO_IP => Constants.Ipproto_Ip); - - Socket_Option_Match : constant array (Socket_Option) of int := - (SO_REUSEADDR => Constants.So_Reuseaddr, - IP_MULTICAST_TTL => Constants.Ip_Multicast_Ttl, - IP_ADD_MEMBERSHIP => Constants.Ip_Add_Membership, - IP_DROP_MEMBERSHIP => Constants.Ip_Drop_Membership, - IP_MULTICAST_LOOP => Constants.Ip_Multicast_Loop); - - Socket_Option_Size : constant array (Socket_Option) of Natural := - (SO_REUSEADDR => 4, - IP_MULTICAST_TTL => 1, - IP_ADD_MEMBERSHIP => 8, - IP_DROP_MEMBERSHIP => 8, - IP_MULTICAST_LOOP => 1); - - function "*" (Left : String; Right : Natural) return String; - pragma Inline ("*"); - - CRLF : constant String := CR & LF; - - --------- - -- "*" -- - --------- - - function "*" (Left : String; Right : Natural) return String is - Result : String (1 .. Left'Length * Right); - First : Positive := 1; - Last : Natural := First + Left'Length - 1; - begin - for I in 1 .. Right loop - Result (First .. Last) := Left; - First := First + Left'Length; - Last := Last + Left'Length; - end loop; - return Result; - end "*"; - - ------------------- - -- Accept_Socket -- - ------------------- - - procedure Accept_Socket (Socket : in Socket_FD; - New_Socket : out Socket_FD) - is - Sin : aliased Sockaddr_In; - Size : aliased int := Sin'Size / 8; - Code : int; - begin - Code := C_Accept (Socket.FD, Sin'Address, Size'Access); - if Code = Failure then - Raise_With_Message ("Accept system call failed"); - else - New_Socket := (FD => Code); - end if; - end Accept_Socket; - - ---------- - -- Bind -- - ---------- - - procedure Bind - (Socket : in Socket_FD; - Port : in Positive) - is - Sin : aliased Sockaddr_In; - begin - Sin.Sin_Family := Constants.Af_Inet; - Sin.Sin_Port := Port_To_Network (unsigned_short (Port)); - if C_Bind (Socket.FD, Sin'Address, Sin'Size / 8) = Failure then - Raise_With_Message ("Bind failed"); - end if; - end Bind; - - ------------- - -- Connect -- - ------------- - - procedure Connect - (Socket : in Socket_FD; - Host : in String; - Port : in Positive) - is - Sin : aliased Sockaddr_In; - begin - Sin.Sin_Family := Constants.Af_Inet; - Sin.Sin_Addr := To_In_Addr (Address_Of (Host)); - Sin.Sin_Port := Port_To_Network (unsigned_short (Port)); - if C_Connect (Socket.FD, Sin'Address, Sin'Size / 8) = Failure then - raise Connection_Refused; - end if; - end Connect; - - --------------------------- - -- Customized_Setsockopt -- - --------------------------- - - procedure Customized_Setsockopt (Socket : in Socket_FD'Class; - Optval : in Opt_Type) - is - begin - pragma Assert (Optval'Size / 8 = Socket_Option_Size (Optname)); - if C_Setsockopt (Socket.FD, Socket_Level_Match (Level), - Socket_Option_Match (Optname), - Optval'Address, Optval'Size / 8) = Failure - then - Raise_With_Message ("Setsockopt failed"); - end if; - end Customized_Setsockopt; - - --------- - -- Get -- - --------- - - function Get (Socket : Socket_FD'Class) return String - is - Stream : constant Stream_Element_Array := Receive (Socket); - Result : String (Positive (Stream'First) .. Positive (Stream'Last)); - begin - for I in Stream'Range loop - Result (Positive (I)) := - Character'Val (Stream_Element'Pos (Stream (I))); - end loop; - return Result; - end Get; - - -------------- - -- Get_Line -- - -------------- - - function Get_Line (Socket : Socket_FD'Class) return String is - Result : String (1 .. 1024); - Index : Positive := Result'First; - Byte : Stream_Element_Array (1 .. 1); - Char : Character; - begin - loop - Receive (Socket, Byte); - Char := Character'Val (Stream_Element'Pos (Byte (Byte'First))); - if Char = LF then - return Result (1 .. Index - 1); - elsif Char /= CR then - Result (Index) := Char; - Index := Index + 1; - if Index > Result'Last then - return Result & Get_Line (Socket); - end if; - end if; - end loop; - end Get_Line; - - ------------ - -- Listen -- - ------------ - - procedure Listen - (Socket : in Socket_FD; - Queue_Size : in Positive := 5) - is - begin - if C_Listen (Socket.FD, int (Queue_Size)) = Failure then - Raise_With_Message ("Listen failed"); - end if; - end Listen; - - -------------- - -- New_Line -- - -------------- - - procedure New_Line (Socket : in Socket_FD'Class; - Count : in Natural := 1) - is - begin - Put (Socket, CRLF * Count); - end New_Line; - - --------- - -- Put -- - --------- - - procedure Put (Socket : in Socket_FD'Class; - Str : in String) - is - Stream : Stream_Element_Array (Stream_Element_Offset (Str'First) .. - Stream_Element_Offset (Str'Last)); - begin - for I in Str'Range loop - Stream (Stream_Element_Offset (I)) := - Stream_Element'Val (Character'Pos (Str (I))); - end loop; - Send (Socket, Stream); - end Put; - - -------------- - -- Put_Line -- - -------------- - - procedure Put_Line (Socket : in Socket_FD'Class; Str : in String) - is - begin - Put (Socket, Str & CRLF); - end Put_Line; - - ------------- - -- Receive -- - ------------- - - function Receive (Socket : Socket_FD; Max : Stream_Element_Count := 4096) - return Ada.Streams.Stream_Element_Array - is - Buffer : Stream_Element_Array (1 .. Max); - Addr : aliased In_Addr; - Addrlen : aliased int := Addr'Size / 8; - Count : constant int := - C_Recvfrom (Socket.FD, Buffer'Address, Buffer'Length, 0, - Addr'Address, Addrlen'Access); - begin - if Count < 0 then - Raise_With_Message ("Receive error"); - elsif Count = 0 then - raise Connection_Closed; - end if; - return Buffer (1 .. Stream_Element_Offset (Count)); - end Receive; - - ------------- - -- Receive -- - ------------- - - procedure Receive (Socket : in Socket_FD'Class; - Data : out Ada.Streams.Stream_Element_Array) - is - Index : Stream_Element_Offset := Data'First; - Rest : Stream_Element_Count := Data'Length; - begin - while Rest > 0 loop - declare - Sub_Buffer : constant Stream_Element_Array := - Receive (Socket, Rest); - Length : constant Stream_Element_Count := Sub_Buffer'Length; - begin - Data (Index .. Index + Length - 1) := Sub_Buffer; - Index := Index + Length; - Rest := Rest - Length; - end; - end loop; - end Receive; - - ---------- - -- Send -- - ---------- - - procedure Send (Socket : in Socket_FD; - Data : in Stream_Element_Array) - is - Index : Stream_Element_Offset := Data'First; - Rest : Stream_Element_Count := Data'Length; - Count : int; - begin - while Rest > 0 loop - Count := C_Send (Socket.FD, Data (Index) 'Address, int (Rest), 0); - if Count < 0 then - Raise_With_Message ("Send failed"); - elsif Count = 0 then - raise Connection_Closed; - end if; - Index := Index + Stream_Element_Count (Count); - Rest := Rest - Stream_Element_Count (Count); - end loop; - end Send; - - ---------------- - -- Setsockopt -- - ---------------- - - procedure Setsockopt - (Socket : in Socket_FD'Class; - Level : in Socket_Level := Sol_Socket; - Optname : in Socket_Option; - Optval : in Integer) - is - begin - case Socket_Option_Size (Optname) is - - when 1 => - declare - C_Char_Optval : aliased char := char'Val (Optval); - begin - pragma Assert (C_Char_Optval'Size = 8); - if C_Setsockopt (Socket.FD, Socket_Level_Match (Level), - Socket_Option_Match (Optname), - C_Char_Optval'Address, 1) = Failure - then - Raise_With_Message ("Setsockopt failed"); - end if; - end; - - when 4 => - declare - C_Int_Optval : aliased int := int (Optval); - begin - pragma Assert (C_Int_Optval'Size = 32); - if C_Setsockopt (Socket.FD, Socket_Level_Match (Level), - Socket_Option_Match (Optname), - C_Int_Optval'Address, 4) = Failure - then - Raise_With_Message ("Setsockopt failed"); - end if; - end; - - when others => - Raise_With_Message ("Setsockopt called with wrong arguments", - False); - - end case; - end Setsockopt; - - -------------- - -- Shutdown -- - -------------- - - procedure Shutdown (Socket : in Socket_FD; - How : in Shutdown_Type := Both) - is - begin - C_Shutdown (Socket.FD, Shutdown_Type_Match (How)); - end Shutdown; - - ------------ - -- Socket -- - ------------ - - procedure Socket - (Sock : out Socket_FD; - Domain : in Socket_Domain := AF_INET; - Typ : in Socket_Type := SOCK_STREAM) - is - Result : constant int := - C_Socket (Socket_Domain_Match (Domain), Socket_Type_Match (Typ), 0); - begin - if Result = Failure then - Raise_With_Message ("Unable to create socket"); - end if; - Sock := (FD => Result); - end Socket; - -end Sockets; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets.ads b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets.ads deleted file mode 100644 index 5c8db3e0ec..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/adasockets/sockets.ads +++ /dev/null @@ -1,155 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- S O C K E T S -- --- -- --- S p e c -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Ada.Streams; -with Interfaces.C; - -package Sockets is - - type Socket_FD is tagged private; - -- A socket - - type Socket_Domain is (AF_INET); - -- AF_INET: Internet sockets (yes, should be PF_INET, but they hold the - -- same value) - - type Socket_Type is (SOCK_STREAM, SOCK_DGRAM); - -- SOCK_STREAM: Stream mode (TCP) - -- SOCK_DGRAM: Datagram mode (UDP, Multicast) - - procedure Socket - (Sock : out Socket_FD; - Domain : in Socket_Domain := AF_INET; - Typ : in Socket_Type := SOCK_STREAM); - -- Create a socket of the given mode - - Connection_Refused : exception; - - procedure Connect - (Socket : in Socket_FD; - Host : in String; - Port : in Positive); - -- Connect a socket on a given host/port. Raise Connection_Refused if - -- the connection has not been accepted by the other end. - - procedure Bind - (Socket : in Socket_FD; - Port : in Positive); - -- Bind a socket on a given port - - procedure Listen - (Socket : in Socket_FD; - Queue_Size : in Positive := 5); - -- Create a socket's listen queue - - type Socket_Level is (SOL_SOCKET, IPPROTO_IP); - - type Socket_Option is (SO_REUSEADDR, IP_MULTICAST_TTL, - IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP, - IP_MULTICAST_LOOP); - - procedure Setsockopt - (Socket : in Socket_FD'Class; - Level : in Socket_Level := SOL_SOCKET; - Optname : in Socket_Option; - Optval : in Integer); - -- Set a socket option - - generic - Level : Socket_Level; - Optname : Socket_Option; - type Opt_Type is private; - procedure Customized_Setsockopt (Socket : in Socket_FD'Class; - Optval : in Opt_Type); - -- Low level control on setsockopt - - procedure Accept_Socket (Socket : in Socket_FD; - New_Socket : out Socket_FD); - -- Accept a connection on a socket - - Connection_Closed : exception; - - procedure Send (Socket : in Socket_FD; - Data : in Ada.Streams.Stream_Element_Array); - -- Send data on a socket. Raise Connection_Closed if the socket - -- has been closed. - - function Receive (Socket : Socket_FD; - Max : Ada.Streams.Stream_Element_Count := 4096) - return Ada.Streams.Stream_Element_Array; - -- Receive data from a socket. May raise Connection_Closed - - procedure Receive (Socket : in Socket_FD'Class; - Data : out Ada.Streams.Stream_Element_Array); - -- Fill data from a socket. Raise Connection_Closed if the socket has - -- been closed before the end of the array. - - type Shutdown_Type is (Receive, Send, Both); - - procedure Shutdown (Socket : in Socket_FD; - How : in Shutdown_Type := Both); - -- Close a previously opened socket - - --------------------------------- - -- String-oriented subprograms -- - --------------------------------- - - procedure Put (Socket : in Socket_FD'Class; - Str : in String); - -- Send a string on the socket - - procedure New_Line (Socket : in Socket_FD'Class; - Count : in Natural := 1); - -- Send CR/LF sequences on the socket - - procedure Put_Line (Socket : in Socket_FD'Class; - Str : in String); - -- Send a string + CR/LF on the socket - - function Get (Socket : Socket_FD'Class) return String; - -- Get a string from the socket - - function Get_Line (Socket : Socket_FD'Class) return String; - -- Get a full line from the socket. CR is ignored and LF is considered - -- as an end-of-line marker. - -private - - type Socket_FD is tagged record - FD : Interfaces.C.int; - end record; - -end Sockets; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/Makefile.ts_386ex b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/Makefile.ts_386ex deleted file mode 100644 index 05077b74c0..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/Makefile.ts_386ex +++ /dev/null @@ -1,43 +0,0 @@ -# -# Makefile for network listener example -# - -MAIN=listener - -# Tool paths -tooldir=/usr/local/rtems -rtemsdir=${tooldir}/ts_386ex - -# Tool names -GCC=${tooldir}/bin/i386-rtemself-gcc -GNATMAKE=${tooldir}/bin/i386-rtemself-gnatmake -SIZE=${tooldir}/bin/i386-rtemself-size -SIS=${tooldir}/bin/sis -GDB=${tooldir}/bin/sis-gdb - -CINCLUDES=-I/usr/local/rtems/ts_386ex/lib/include/networking - -AINCLUDES=-i -I/usr/local/rtems/lib/adasockets - -CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems - -all: init.o - $(GNATMAKE) -v -O -gnata -gnatE -gnato $(AINCLUDES) $(MAIN) -g \ - -bargs -r \ - -cargs $(CARGS) \ - -largs $(CARGS) init.o - $(SIZE) $(MAIN) - - - -init.o: init.c - $(GCC) -O4 -g -Wall -ansi -fasm $(CARGS) $(CINCLUDES) -c init.c - -run: - $(SIS) $(MAIN) - -gdb: - $(GDB) $(MAIN) - -clean: - rm -f b_$(MAIN).c b_$(MAIN).o *.o *.ali $(MAIN) diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/init.c b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/init.c deleted file mode 100644 index 5e87ddf6e2..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/init.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be found in - * the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#include <bsp.h> - -#include <assert.h> -#include <pthread.h> - -#include <stdio.h> -#include <rtems/rtems_bsdnet.h> -#include "../networkconfig.h" - -#ifdef GNAT_PID -#include <unistd.h> -pid_t getpid() -{ - return GNAT_PID; -} -#endif - -/* - * By having the POSIX_Init thread create a second thread just - * to invoke gnat_main, we can override all default attributes - * of the "Ada environment task". Otherwise, we would be - * stuck with the defaults set by RTEMS. - */ - -void *start_gnat_main( void * argument ) -{ - extern int gnat_main ( int argc, char **argv, char **envp ); - - (void) gnat_main ( 0, 0, 0 ); - - exit( 0 ); - - return 0; -} - -void *POSIX_Init( void *argument ) -{ - pthread_t thread_id; - pthread_attr_t attr; - int status; - - rtems_bsdnet_initialize_network (); - - status = pthread_attr_init( &attr ); - assert( !status ); - -#ifdef GNAT_MAIN_STACKSPACE - status = pthread_attr_setstacksize( &attr, GNAT_MAIN_STACKSPACE ); - assert( !status ); -#endif - - status = pthread_create( &thread_id, &attr, start_gnat_main, NULL ); - assert( !status ); - - pthread_exit( 0 ); - - return 0; -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -/* -#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1) -*/ - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024) -#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024) -#define CONFIGURE_INIT_TASK_PRIORITY 120 -#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \ - RTEMS_NO_TIMESLICE | \ - RTEMS_NO_ASR | \ - RTEMS_INTERRUPT_LEVEL(0)) - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 20 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 20 -#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 30 -#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 20 - -#define CONFIGURE_INIT - -#include <confdefs.h> diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/listener.adb b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/listener.adb deleted file mode 100644 index 0a17319897..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/listener.adb +++ /dev/null @@ -1,114 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- L I S T E N E R -- --- -- --- B o d y -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Ada.Exceptions; use Ada.Exceptions; -with Ada.Text_IO; use Ada.Text_IO; -with Sockets; use Sockets; - -procedure Listener is - - -- Usage: listener - -- Example: listener - -- then telnet localhost `listen_port' - - Listen_Port : Positive := 5000; - - task type Echo is - entry Start (FD : in Socket_FD); - end Echo; - - function Rev (S : String) return String; - -- Reverse a string - - ---------- - -- Echo -- - ---------- - - task body Echo is - Sock : Socket_FD; - begin - select - accept Start (FD : in Socket_FD) do - Sock := FD; - end Start; - or - terminate; - end select; - - loop - Put_Line (Sock, Rev (Get_Line (Sock))); - end loop; - - exception - when Connection_Closed => - Put_Line ("Connection closed"); - Shutdown (Sock, Both); - end Echo; - - Accepting_Socket : Socket_FD; - Incoming_Socket : Socket_FD; - - type Echo_Access is access Echo; - Dummy : Echo_Access; - - --------- - -- Rev -- - --------- - - function Rev (S : String) return String is - Result : String (1 .. S'Length); - Index : Natural := 0; - begin - for I in reverse S'Range loop - Index := Index + 1; - Result (Index) := S (I); - end loop; - return Result; - end Rev; - -begin - Socket (Accepting_Socket, AF_INET, SOCK_STREAM); - Setsockopt (Accepting_Socket, SOL_SOCKET, SO_REUSEADDR, 1); - Bind (Accepting_Socket, Listen_Port); - Listen (Accepting_Socket); - loop - Put_Line ("Waiting for new connection"); - Accept_Socket (Accepting_Socket, Incoming_Socket); - Put_Line ("New connection acknowledged"); - Dummy := new Echo; - Dummy.Start (Incoming_Socket); - end loop; -end Listener; diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/networkconfig.h b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/networkconfig.h deleted file mode 100644 index 6b424ccb96..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/networkconfig.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Network configuration - * - ************************************************************ - * EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION * - * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! * - ************************************************************ - * - * $Id$ - */ - -#ifndef _RTEMS_NETWORKCONFIG_H_ -#define _RTEMS_NETWORKCONFIG_H_ - -#define RTEMS_USE_BOOTP - -#include <bsp.h> - -/* - * Define RTEMS_SET_ETHERNET_ADDRESS if you want to specify the - * Ethernet address here. If RTEMS_SET_ETHERNET_ADDRESS is not - * defined the driver will choose an address. - */ - -/*#define RTEMS_SET_ETHERNET_ADDRESS*/ - -#if (defined (RTEMS_SET_ETHERNET_ADDRESS)) -static char ethernet_address[6] = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX }; -#endif - -/* - * Default network interface - */ -static struct rtems_bsdnet_ifconfig netdriver_config = { - RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */ - RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */ - - NULL, /* link to next interface */ - -#if (defined (RTEMS_USE_BOOTP)) - NULL, /* BOOTP supplies IP address */ - NULL, /* BOOTP supplies IP net mask */ -#else - "127.37.12.19", /* IP address of device */ - "255.255.255.0", /* IP net mask */ -#endif /* !RTEMS_USE_BOOTP */ - -#if (defined (RTEMS_SET_ETHERNET_ADDRESS)) - ethernet_address, /* Ethernet hardware address */ -#else - NULL, /* Driver supplies hardware address */ -#endif - 0, /* TRUE == Ignore broadcast packets */ - - 0, /* Default MTU */ - 0, /* Default rbufs */ - 0, /* Default xbufs */ - - 0x300, /* I/O port on ethernet card */ - 5, /* IRQ */ - 0x0000 /* Shared memory start */ - -}; - -/* - * Network configuration - */ -struct rtems_bsdnet_config rtems_bsdnet_config = { - &netdriver_config, - -#if (defined (RTEMS_USE_BOOTP)) - rtems_bsdnet_do_bootp, -#else - NULL, -#endif - - 0, /* Default network task priority */ - 0, /* Default mbuf capacity */ - 0, /* Default mbuf cluster capacity */ - -#if defined (RTEMS_USE_BOOTP) - NULL, - NULL, - NULL, - NULL, - {NULL,NULL,NULL}, -#else - "rtems0", /* Host name */ - "ece.ubc.ca", /* Domain name */ - "127.37.12.254", /* Gateway: */ - "127.37.12.19", /* Log host: */ - {"127.37.15.9"}, /* Name server(s) */ -#endif /* RTEMS_USE_BOOTP */ -}; - -/* - * For TFTP test application - */ -#if (!defined (RTEMS_USE_BOOTP)) -#define RTEMS_TFTP_TEST_HOST_NAME "127.37.12.19" -#define RTEMS_TFTP_TEST_FILE_NAME "bootfiles/xxx" -#endif - -#endif /* _RTEMS_NETWORKCONFIG_H_ */ diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/Makefile.ts_386ex b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/Makefile.ts_386ex deleted file mode 100644 index 1de940b9c5..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/Makefile.ts_386ex +++ /dev/null @@ -1,46 +0,0 @@ -# -# Makefile for tcprelay example -# - -MAIN=tcprelay - -# Tool paths -tooldir=/usr/local/rtems -rtemsdir=${tooldir}/ts_386ex - -# Tool names -GCC=${tooldir}/bin/i386-rtemself-gcc -GNATMAKE=${tooldir}/bin/i386-rtemself-gnatmake -SIZE=${tooldir}/bin/i386-rtemself-size -SIS=${tooldir}/bin/sis -GDB=${tooldir}/bin/sis-gdb - -CINCLUDES=-I/usr/local/rtems/ts_386ex/lib/include/networking - -AINCLUDES=-i -I/usr/local/rtems/lib/adasockets - -CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems - -all: init.o print_error.o - $(GNATMAKE) -O -gnata -gnatE -gnato $(AINCLUDES) $(MAIN) -g \ - -bargs -r \ - -cargs $(CARGS) \ - -largs $(CARGS) init.o print_error.o - $(SIZE) $(MAIN) - - - -init.o: init.c - $(GCC) -O4 -g -Wall -ansi -fasm $(CARGS) $(CINCLUDES) -c init.c - -print_error.o: print_error.c - $(GCC) -O4 -g -Wall -ansi -fasm $(CARGS) $(CINCLUDES) -c print_error.c - -run: - $(SIS) $(MAIN) - -gdb: - $(GDB) $(MAIN) - -clean: - rm -f b_$(MAIN).c b_$(MAIN).o *.o *.ali $(MAIN) diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/init.c b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/init.c deleted file mode 100644 index 5590ad8f2a..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/init.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be found in - * the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#include <bsp.h> - -#include <assert.h> -#include <pthread.h> - -#include <stdio.h> -#include <rtems/rtems_bsdnet.h> -#include "../networkconfig.h" - -#ifdef GNAT_PID -#include <unistd.h> -pid_t getpid() -{ - return GNAT_PID; -} -#endif - -/* - * By having the POSIX_Init thread create a second thread just - * to invoke gnat_main, we can override all default attributes - * of the "Ada environment task". Otherwise, we would be - * stuck with the defaults set by RTEMS. - */ - -void *start_gnat_main( void * argument ) -{ - extern int gnat_main ( int argc, char **argv, char **envp ); - - (void) gnat_main ( 0, 0, 0 ); - - exit( 0 ); - - return 0; -} - -#define GNAT_MAIN_STACKSPACE (32*1024) - -void *POSIX_Init( void *argument ) -{ - pthread_t thread_id; - pthread_attr_t attr; - int status; - - rtems_bsdnet_initialize_network (); - - status = pthread_attr_init( &attr ); - assert( !status ); - -#ifdef GNAT_MAIN_STACKSPACE - status = pthread_attr_setstacksize( &attr, GNAT_MAIN_STACKSPACE ); - assert( !status ); -#endif - - status = pthread_create( &thread_id, &attr, start_gnat_main, NULL ); - assert( !status ); - - pthread_exit( 0 ); - - return 0; -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -/* -#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1) -*/ - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_EXECUTIVE_RAM_SIZE (384*1024) -#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024) -#define CONFIGURE_INIT_TASK_PRIORITY 120 -#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \ - RTEMS_NO_TIMESLICE | \ - RTEMS_NO_ASR | \ - RTEMS_INTERRUPT_LEVEL(0)) - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 20 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 20 -#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 30 -#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 20 - -#define CONFIGURE_INIT - -#include <confdefs.h> diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/print_error.c b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/print_error.c deleted file mode 100644 index 5dab06aad8..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/print_error.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <errno.h> - -void -print_error (void) { - printf("Problem connecting socket: %s\n", strerror (errno)); -} - -void -dump_sin (unsigned char *dp) { - int i; - - printf("Dump of sockaddr_in =\n"); - for(i=0; i<16; i++) - printf("%x ", *dp++); - printf("\n"); -} diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/tcprelay.adb b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/tcprelay.adb deleted file mode 100644 index dd77c8e3b5..0000000000 --- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/tcprelay.adb +++ /dev/null @@ -1,108 +0,0 @@ ------------------------------------------------------------------------------ --- -- --- ADASOCKETS COMPONENTS -- --- -- --- T C P R E L A Y -- --- -- --- B o d y -- --- -- --- $ReleaseVersion: 0.1.3 $ -- --- -- --- Copyright (C) 1998 École Nationale Supérieure des Télécommunications -- --- -- --- AdaSockets 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. AdaSockets 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 AdaSockets; see file COPYING. If not, write to the Free -- --- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- --- 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from -- --- this unit, or you link this unit with other files to produce an -- --- executable, this unit does not by itself cause the resulting -- --- executable to be covered by the GNU General Public License. This -- --- exception does not however invalidate any other reasons why the -- --- executable file might be covered by the GNU Public License. -- --- -- --- The main repository for this software is located at: -- --- http://www-inf.enst.fr/ANC/ -- --- -- ------------------------------------------------------------------------------ - -with Ada.Exceptions; use Ada.Exceptions; -with Ada.Text_IO; use Ada.Text_IO; -with Sockets; use Sockets; - -procedure TCPRelay is - - Relay_Host : String := "host.domain"; - - procedure Print_Error; - pragma Import (C, Print_Error, "print_error"); - - task type Relay is - pragma Storage_Size (8192); - entry Start (From, To : Socket_FD); - end Relay; - - ----------- - -- Relay -- - ----------- - - task body Relay - is - From_FD, To_FD : Socket_FD; - begin - select - accept Start (From, To : Socket_FD) do - From_FD := From; - To_FD := To; - end Start; - or - terminate; - end select; - - loop - Send (To_FD, Receive (From_FD)); - end loop; - exception - when Connection_Closed => - Put_Line ("Connection closed"); - Shutdown (From_FD, Receive); - Shutdown (To_FD, Send); - end Relay; - - Accepting_Socket, - Incoming_Socket, - Outgoing_Socket : Socket_FD; - - type Relay_Access is access Relay; - Dummy : Relay_Access; - -begin - Socket (Accepting_Socket, AF_INET, SOCK_STREAM); - Setsockopt (Accepting_Socket, SOL_SOCKET, SO_REUSEADDR, 1); - Bind (Accepting_Socket, 4567); - Listen (Accepting_Socket); - loop - Put_Line ("Waiting for new connection"); - Accept_Socket (Accepting_Socket, Incoming_Socket); - Put_Line ("New connection acknowledged"); - Socket (Outgoing_Socket, AF_INET, SOCK_STREAM); - Put_Line ("Connecting to remote host"); - Connect (Outgoing_Socket, Relay_Host, 5000); - Put_Line ("Connection established"); - Dummy := new Relay; - Dummy.Start (Incoming_Socket, Outgoing_Socket); - Dummy := new Relay; - Dummy.Start (Outgoing_Socket, Incoming_Socket); - end loop; -exception - when others => - Print_Error; -end TCPRelay; |