Skip to content

Sock #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2025
Merged

Sock #28

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions include/arpa/ftp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ftp.h 8.1 (Berkeley) 6/2/93
*/

#ifndef _ARPA_FTP_H
#define _ARPA_FTP_H

#ifdef __cplusplus
extern "C"
{
#endif

/* Definitions for FTP; see RFC-765. */

/*
* Reply codes.
*/
#define PRELIM 1 /* positive preliminary */
#define COMPLETE 2 /* positive completion */
#define CONTINUE 3 /* positive intermediate */
#define TRANSIENT 4 /* transient negative completion */
#define ERROR 5 /* permanent negative completion */

/*
* Type codes
*/
#define TYPE_A 1 /* ASCII */
#define TYPE_E 2 /* EBCDIC */
#define TYPE_I 3 /* image */
#define TYPE_L 4 /* local byte size */

#ifdef FTP_NAMES
char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
#endif

/*
* Form codes
*/
#define FORM_N 1 /* non-print */
#define FORM_T 2 /* telnet format effectors */
#define FORM_C 3 /* carriage control (ASA) */
#ifdef FTP_NAMES
char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
#endif

/*
* Structure codes
*/
#define STRU_F 1 /* file (no record structure) */
#define STRU_R 2 /* record structure */
#define STRU_P 3 /* page structure */
#ifdef FTP_NAMES
char *strunames[] = {"0", "File", "Record", "Page" };
#endif

/*
* Mode types
*/
#define MODE_S 1 /* stream */
#define MODE_B 2 /* block */
#define MODE_C 3 /* compressed */
#ifdef FTP_NAMES
char *modenames[] = {"0", "Stream", "Block", "Compressed" };
#endif

/*
* Record Tokens
*/
#define REC_ESC '\377' /* Record-mode Escape */
#define REC_EOR '\001' /* Record-mode End-of-Record */
#define REC_EOF '\002' /* Record-mode End-of-File */

/*
* Block Header
*/
#define BLK_EOR 0x80 /* Block is End-of-Record */
#define BLK_EOF 0x40 /* Block is End-of-File */
#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
#define BLK_RESTART 0x10 /* Block is Restart Marker */

#define BLK_BYTECOUNT 2 /* Bytes in this block */

#ifdef __cplusplus
}
#endif

#endif /* !_ARPA_FTP_H */
82 changes: 82 additions & 0 deletions include/arpa/inet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* libsocket - BSD socket like library for DJGPP
* Copyright 1997, 1998 by Indrek Mandre
* Copyright 1997-2000 by Richard Dawe
*
* Portions of libsocket Copyright 1985-1993 Regents of the University of
* California.
* Portions of libsocket Copyright 1991, 1992 Free Software Foundation, Inc.
* Portions of libsocket Copyright 1997, 1998 by the Regdos Group.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef _ARPA_INET_H
#define _ARPA_INET_H

#include <lsck/errno.h>
#include <netinet/in.h>

#ifdef __cplusplus
extern "C"
{
#endif

/* Fundamental Internet types */
#ifndef __libsocket_in_port_t
typedef unsigned short in_port_t;
#define __libsocket_in_port_t
#endif /* __libsocket_in_port_t */

#ifndef __libsocket_in_addr_t
typedef unsigned long in_addr_t;
#define __libsocket_in_addr_t
#endif /* __libsocket_in_addr_t */

/* Internet address. */
#ifndef __libsocket_in_addr
#define __libsocket_in_addr
struct in_addr {
in_addr_t s_addr;
};
#endif /* __libsocket_in_addr */

/* Function declarations */
extern in_addr_t inet_addr (const char *);
extern in_addr_t inet_lnaof (struct in_addr);
extern struct in_addr inet_makeaddr (in_addr_t, in_addr_t);
extern in_addr_t inet_netof (struct in_addr);
extern in_addr_t inet_network (const char *);
extern char *inet_ntoa (struct in_addr);
extern int inet_aton (const char *, struct in_addr *);

/* New inet functions for handling IPv6 (and other) <-> text conversions. */
extern const char *inet_ntop (int , const void *, char *, size_t);
extern int inet_pton (int, const char *, void *);

/* NSAP address functions (que?) */
extern char *inet_nsap_ntoa (int,
register const unsigned char *,
register char *);

extern unsigned int inet_nsap_addr (const char * /* ascii */,
unsigned char * /*binary */,
int /* maxlen */);

#ifdef __cplusplus
}
#endif

#endif /* _ARPA_INET_H */
Loading