externs.h

来自「mcf5307实验源代码」· C头文件 代码 · 共 293 行

H
293
字号
/*************************************************************************/
/*                                                                       */
/*      Copyright (c) 1993 - 1996 by Accelerated Technology, Inc.        */
/*                                                                       */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the      */
/* subject matter of this material.  All manufacturing, reproduction,    */
/* use, and sales rights pertaining to this subject matter are governed  */
/* by the license agreement.  The recipient of this software implicitly  */
/* accepts the terms of the license.                                     */
/*                                                                       */
/*************************************************************************/
/*
*
* Portions of this program were written by:       */
/***************************************************************************
*                                                                          *
*                                                                          *
*      NCSA Telnet                                                         *
*      by Tim Krauskopf, VT100 by Gaige Paulsen, Tek by Aaron Contorer     *
*                                                                          *
*      National Center for Supercomputing Applications                     *
*      152 Computing Applications Building                                 *
*      605 E. Springfield Ave.                                             *
*      Champaign, IL  61820                                                *
*                                                                          *
****************************************************************************/
/******************************************************************************/
/*                                                                            */
/* FILE NAME                                            VERSION               */
/*                                                                            */
/*   EXTERNS.H                                          NET 3.2               */
/*                                                                            */
/* DESCRIPTION                                                                */
/*                                                                            */
/*   External definitions for functions in Nucleus NET.                       */
/*   This include file needs to go after other include files                  */
/*                                                                            */
/* AUTHOR                                                                     */
/*                                                                            */
/*                                                                            */
/*                                                                            */
/* DATA STRUCTURES                                                            */
/*                                                                            */
/*                                                                            */
/* FUNCTIONS                                                                  */
/*                                                                            */
/*      None                                                                  */
/*                                                                            */
/* DEPENDENCIES                                                               */
/*                                                                            */
/*      None                                                                  */
/*                                                                            */
/* HISTORY                                                                    */
/*                                                                            */
/*      NAME            DATE                    REMARKS                       */
/*                                                                            */
/******************************************************************************/

#ifndef EXTERNS_H
#define EXTERNS_H

#include "tcpdefs.h"
#include "hostform.h"
#include "target.h"
#include "ip.h"

/* new_ip.c */
extern uint16 ipcheck (uint16 *s, uint16 len);
extern uint16 tcpcheck (uint16 *, uint16 *, uint16);
extern uint32 longswap (uint32);
extern uint16 intswap (uint16);
extern int32 n_clicks (VOID);
extern VOID init_time (VOID);

/* net.c */
extern  VOID   statcheck (VOID);
extern  int16  netarpme (uint8 *);
extern  int16  demux (int16);
extern  int16  dlayersend (DLAYER *, uint16);
extern  int16  dlayerinit (VOID);
extern  VOID   dlayershut (VOID);
extern  int16 NET_Send(struct pqueue HUGE *, int16, uchar);

/* The driver routines */
extern  sshort NU_Recv_Packet (VOID);
extern  sshort NU_Get_Address (uchar *, ulint, ulint);
extern  VOID   NU_Set_Address (uchar *, ulint, ulint);
extern  sshort NU_Etopen (uchar *, uint16, ulint, ulint);

#ifdef NU_PPP
extern  sshort NU_Xmit_Packet (uchar *, uint16, uint16);
#else
extern  sshort NU_Xmit_Packet (uchar *, uint16);
#endif


#ifdef PROC_29K
/* proc_29k.c  - 29k specific */
extern  int16    NU_fgetc (VOID);
extern  int16    NU_Is_Char (VOID);
#endif

/* bootp.c */
extern int16 NU_Bootp (uint8 *);

/* ip.c */
extern  int16 ipinterpret (struct ip *p);
extern  IPKT *found_friend(FPBUF *, IPKT *, int16);
extern  IPKT *first_frag(FPBUF *, IPKT *, int16);
extern  IPKT *ip_reassembly(IPKT *, int16);

/* user.c */
extern  int16 netread (uint16 pnum, char *buffer, uint16 n);
extern  int16 netwrite (uint16 pnum, char *buffer, uint16 n, int16 *);
extern  int16 netpush (uint16 pnum);
extern  int16 netqlen (int16 pnum);
extern  int16 netroom (int16 pnum);
extern  VOID netsetip (uchar *st);
extern  VOID netgetip (uchar *st);
extern  VOID netsetbroad (uchar *st);
extern  VOID netsetmask (const uchar *st);
extern  int16 netest (int16 pn);
extern  int16 netlisten (uint16 serv);
extern  int16 netxopen (uchar *, uint16, uint16, uint16, uint16, uint16);
extern  int16 doconnect(int16, uint16, uint16);
extern  int16 Send_SYN_FIN (PORT *, int16);
extern  int16 netclose (int16 pnum);
extern  int16 netinit (VOID);
extern  INT windowprobe(PORT *, uint16, char *);
extern  uint16 netsend(PORT *);

/* tools.c */
extern  int16 netsleep (int16 n);
extern  uint16 enqueue (struct window *, uchar *, uint16);
extern  uint16 dequeue (struct window *, char *, uint16, char);
extern  uint16 rmqueue (struct window *wind, int32);
extern  int16 comparen (VOID *s1, VOID *s2, int16 n);
extern  STATUS netputevent (UNSIGNED msg_class, UNSIGNED what, UNSIGNED dat);
extern  VOID *normalize_ptr(VOID *);
extern  BUFFER *allocate_buffer(struct port *);

/* udp.c */
extern  int16 udpinterpret (struct udp *, uint16);
extern  int16 neturead (struct uport *, char *, struct addr_struct *,
                      struct sock_struct *);
extern  VOID netulisten (int16);
extern  int16 netusend (struct uport *, uint8 *, uint16, uint16);

/* arp.c */
extern  int16 arp_request (unsigned char *tipnum);
extern  int16 arpinterpret (struct plummer *p);
extern  struct pqueue HUGE *arp_prepare_pkt(uint8 *, const uint8 *, int16);
extern  uint8 *netdlayer (unsigned char *tipnum);
extern  int16 rarp(VOID);
extern  int16 cacheupdate(uint8 *,uint8 *);
extern  int16 arp_reply(uint8 *, uint8 *);
extern  int16 cachelook (unsigned char *, int16, int16);
extern  STATUS  NU_Rarp(VOID);
extern  uint8 *getdlayer (unsigned char *tipnum);
extern  int16 netsetgate (unsigned char *ipn);
extern  VOID ARP_Init (VOID);
extern  VOID ARP_Event(uint16 id);

/* util.c */
extern  int16 Snetinit (VOID);
extern  int16 Snetopen (struct machinfo *m, int16 tport);
extern  VOID Stask (VOID);
extern  STATUS Stimerset (UNSIGNED, UNSIGNED, UNSIGNED, UNSIGNED, int32);
extern  STATUS Stimerunset (UNSIGNED, UNSIGNED, UNSIGNED, int32);
extern  long NU_TCP_Time(uint32 *);

/* dll.c */
extern tqe_t *dll_insert (tqe_t *, tqe_t *, tqe_t *);
extern tqe_t *dll_enqueue (tqe_t *, tqe_t *);
extern tqe_t *dll_dequeue (tqe_t *);
extern tqe_t *dll_remove (tqe_t *, tqe_t *);
extern BUFFER *dll_update_lists (struct pqueue_hdr HUGE *,
                                             struct pqueue_hdr HUGE *);
extern struct transq *dll_transq_alloc(VOID);
extern VOID dll_cleanup(struct pqueue_hdr HUGE *);


/* tcp.c */
extern  int16 TCP_Interpret (struct tcp *p, uint16 tlen);
extern  int16 tcpsend (struct port *pport, struct pqueue HUGE *, uint16 dlen);
extern  int16 tcpreset (TCPKT *);
extern  int16 tcp_sendack(struct port *pport, uint16 dlen);
extern  int16 tcp_update_headers (struct port *, uint16, uint32, int16);
extern  int16 tcp_retransmit(struct port *, int32);
extern  VOID tcp_ackit(struct port *);
extern  int16 tcp_ooo_packet(PORT *, uchar *, int16, int32);
extern  VOID check_ooo_list(PORT *);
extern  int16 tcp_xmit(PORT *, BUFFER *);
extern  STATUS TCP_Cleanup(struct port *prt);

/* protinit.c */
extern  STATUS protinit(VOID);
extern  int16 makeport (VOID);
extern  int16 makeuport (int16);
extern  uint16 get_unique_port_number(void);

/* confile.c */
extern  int16 ncstrcmp (char *sa, char *sb);
extern  VOID Scopyfrom (char *s);
extern  struct machinfo *Smadd (char *mname);
extern  struct machinfo *Shostlook (char *hname);
extern  struct machinfo *Slookip (struct id_struct *ipnum);
extern  VOID Ssetgates (VOID);

/* sockets.c */
extern sint NU_Init_Net(int8 *, int16, uint32, uint32);
extern int16  NU_Socket (int16, int16, int16);
extern int16  NU_Bind (int16, struct addr_struct *, int16);
extern int16  NU_Connect (int16, struct addr_struct *, int16);
extern int16  NU_Abort(int16);
extern int16  NU_Listen (int16, uint16);
extern int16  NU_Accept (int16, struct addr_struct *, int16 *);
extern int16  NU_Send (int16, char *, uint16, int16);
extern int16  NU_Send_To (int16, char *, uint16, int16, struct addr_struct *,
                          int16);
extern int16  NU_Recv (int16, char *, uint16, int16);
extern int16  NU_Recv_From (int16, char *, int16, int16, struct addr_struct *, int16 *);
extern int16  NU_Push (int16);
extern int16  NU_Is_Connected (int16);
extern int16  connect_sock (struct machinfo*, int16);
extern int16  NU_GetPnum (struct sock_struct *);
extern int16  NU_Get_UDP_Pnum (struct sock_struct *);
extern int16  NU_fcntl (int16, int16, int16, schar);
extern uint32 NU_Get_Host_ID (VOID);
extern STATUS NU_Get_Host_By_Name(CHAR *name, NU_HOSTENT *host_entry);
extern STATUS NU_Get_Host_By_Addr(CHAR *, INT, INT, NU_HOSTENT *);
extern int16  NU_Get_Peer_Name (int16, struct sockaddr_struct *, int16 *);
extern int16 NU_Close_Socket (int16);
#ifdef PLUS
  extern VOID suspend_task(NU_TASK *);
#else
  extern VOID suspend_task(sint);
#endif
#ifdef PLUS
struct TASK_TABLE_STRUCT * NU_SearchTaskList(struct TASK_TABLE_STRUCT *,
                                             NU_TASK *, INT, int16, int16);
#else
struct TASK_TABLE_STRUCT * NU_SearchTaskList(struct TASK_TABLE_STRUCT *,
                                             int, uint16, int16);
#endif
extern void   NU_UpdateTaskTable(struct TASK_TABLE_STRUCT *);
extern void   NU_TaskTableAdd(struct TASK_TABLE_STRUCT *);
extern int16  NU_Socket_Connected(int16);
extern int32  NU_Setsockopt(int16, int16, int16, void *, int16);
extern int32  NU_Getsockopt(int16, int16, int16, void *, int16);

/* select.c */
#ifdef PLUS
  extern STATUS NU_Select(INT, FD_SET *, FD_SET *, FD_SET *, UNSIGNED);
#else
  extern STATUS NU_Select(INT, FD_SET *, FD_SET *, FD_SET *, sint);
#endif
extern INT NU_FD_Check(INT, FD_SET *);
extern VOID NU_FD_Set(int16, FD_SET *);
extern VOID NU_FD_Init(FD_SET *fd);
extern VOID NU_FD_Reset(INT, FD_SET *);
extern STATUS SEL_Check_Recv(INT, FD_SET *);
#ifdef PLUS
extern STATUS SEL_Setup_Recv_Ports(INT, FD_SET *, NU_TASK *);
#else
extern INT SEL_Setup_Recv_Ports(int16, FD_SET *, int16);
#endif
extern STATUS SEL_Enable_Timeout(int16, UNSIGNED);
extern STATUS SEL_Clear_Timeout(int16);

/* odh.c */
extern int16 NU_Allocate_Buffer(int16, char **);
extern int16 NU_Deallocate_Buffer(int16, char *);
extern int16 NU_ODH_Recv(int16, char **, int16);
extern STATUS ODH_Init(VOID);

/* proc_29k.c  - 29k specific */
extern int getch (VOID);
extern int kbhit (VOID);

/* timer.c -- new double link list for the timer stuff, and will be used
   for the defragmentation later */
extern int16 tqpost (tqe_t *tqlist, tqe_t *tqe);

/* For more optimized data copies, we recommend using an assembly level
   routine in place of memmove and memcpy.  Such a routine is supplied
   with some ports of Nucleus NET. */
extern VOID *movebytes(VOID *, const VOID *, unsigned);

#define NU_Close_Driver    pketclose

#endif  /* EXTERNS_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?