⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 novell.h

📁 这是一个在正实际应用当中运行的电力监控系统软件源代码
💻 H
字号:
// ObjectWindows - (C) Copyright 1992 by Borland International
#ifndef NOVELL_H
#define NOVELL_H
//#include <mem.h>
//#include "def.h"

#define REGISTER        0
#define SST             1
#define YXDRF           2
#define YCDRF           3
#define WTRDRF          4
#define FRQDRF          5
#define SOE             6
#define KWHDRF          7
#define YK              8
#define YT              9
#define WAVE            29
#define FERTPARA        10
#define CALLPARA        11
#define SYSSTATE        12
#define RTULOCK         13
#define RTUSTATE        14
#define ATB             15
#define MODEM			52
#define ENDBUF			17
//-------------------------------------

#define SETIN           17
#define PRTABLE         19
#define COPYSCREEN      20
#define YXS             21
#define KWHPV           22
#define MODIP           23
#define MODID           24
#define CANCEL          26
#define SENDPARA        27
#define SENDFILEHEAD    28
#define WAVE            29
#define REMYC           30
#define SENDYCSUM       31
#define SENDKWHSUM      32
#define SENDOPTICKET    33
#define PUTGRD          34
#define PUTCONTAINER    35
#define PROTYPE         36
#define KWHD            37
#define FHCMD           38
#define FHCHK           39
#define FHDATA          40
#define ASKBB           41
#define ASKEVENT        42
#define QXPREVALUE      43
#define SENDGRAPH       44
#define YCOVER          45
#define YXCHG           46
#define MNPCMD          47
#define OPTCHK          48
#define ASKQX           49
#define MNPCHK          50
#define PROTCMD         51

//   功能码
//   FHCMD
#define CHKTIME         0
#define RESET           1
#define FHYK            2         // 
#define SENDCONST       3         // 下发定值
#define ASKYC           4         // 召测
#define FREEZE          5         // 冻结
#define E_CONTROL       7         // 电控投切
#define P_CONTROL       8         // 功控投切
#define READCONST      11         // 读定值
//   功能码
//   MNP
#define TRUE     1
#define FALSE    0

#define SUCCESS  1
#define FAILURE  0

#ifndef BYTE
#define BYTE   unsigned char
#endif

#ifndef PSTR
#define PSTR   char *
#endif

#ifndef WORD
#define WORD   unsigned short int
#endif

#ifndef DWORD
#define DWORD   unsigned long
#endif

#define NetbiosInt21FunctionCode     ((BYTE) 0x2a)
#define NetbiosInt5c                 ((BYTE) 0x5c)

#define COMMNAD_PENDING              ((BYTE) 0xff)

#define Mcb   Ncb

#define MAX_ADAPTER_NUMBER          1
#define MAX_SESSION_COUNT           254
#define MAX_NAMES                   254
#define MAX_COMMAND_COUNT           255

#define NO_WAIT                     ((BYTE) 0x80)

#define NETBIOS_RESET_WAIT_ONLY     ((BYTE) 0x32)
#define NETBIOS_CANCEL_WAIT_ONLY    ((BYTE) 0x35)
#define NETBIOS_ADAPTER_STATUS      ((BYTE) 0x33)
#define NETBIOS_UNLINK_WAIT_ONLY    ((BYTE) 0x70)
#define NETBIOS_TRACE               ((BYTE) 0x79)

#define NETBIOS_ADD_NAME            ((BYTE) 0x30)
#define NETBIOS_ADD_GROUP_NAME      ((BYTE) 0x36)
#define NETBIOS_DELETE_NAME         ((BYTE) 0x31)
#define NETBIOS_FIND_NAME           ((BYTE) 0x78)

#define NETBIOS_CALL                ((BYTE) 0x10)
#define NETBIOS_LISTEN              ((BYTE) 0x11)
#define NETBIOS_HANG_UP             ((BYTE) 0x12)
#define NETBIOS_SEND                ((BYTE) 0x14)
#define NETBIOS_SEND_NO_ACK         ((BYTE) 0x71)
#define NETBIOS_CHAIN_SEND          ((BYTE) 0x17)
#define NETBIOS_CHAIN_SEND_NO_ACK   ((BYTE) 0x72)
#define NETBIOS_RECEIVE             ((BYTE) 0x15)
#define NETBIOS_RECEIVE_ANY         ((BYTE) 0x16)
#define NETBIOS_SESSION_STATUS      ((BYTE) 0x34)

#define NETBIOS_SEND_DATAGRAM       ((BYTE) 0x20)
#define NETBIOS_RECEIVE_DATAGRAM    ((BYTE) 0x21)
#define NETBIOS_SEND_BDATAGRAM      ((BYTE) 0x22)
#define NETBIOS_RECEIVE_BDATAGRAM   ((BYTE) 0x23)

#define NETBIOS_INVALID_COMMAND     ((BYTE) 0x7F)

/*  LAN Adapter Type  */

#define TOKEN_RING_ADAPTER          ((BYTE) 0xff)
#define PC_NETWORK_ADAPTER          ((BYTE) 0xfe)

/*  NETBIOS Version Numbers  */

#define VERSION_MASK                ((BYTE) 0x0F)

#define PARM_MASK                   ((BYTE) 0xF0)
#define OLD_PARMS                   ((BYTE) 0x10)
#define NEW_PARMS                   ((BYTE) 0x20)

#define MIN_NAME_NUM        2
#define MAX_NAME_NUM       254
#define ILLEGAL_NAME_NUM    0

#define MIN_LSN             1
#define MAX_LSN            254
#define ILLEGAL_LSN         0


#define NB_ILLEGAL_BUFFER_LENGTH          0x01
#define NB_INVALID_COMMAND                0x03
#define NB_COMMAND_TIMED_OUT              0x05
#define NB_MESSAGE_INCOMPLETE             0x06
#define NB_NO_ACK_FAILURE                 0x07
#define NB_ILLEGAL_LSN                    0x08
#define NB_NO_RESOURCE_AVAILABLE          0x09
#define NB_SESSION_CLOSED                 0x0a
#define NB_COMMAND_CANCELED               0x0b
#define NB_DUPLICATE_LOCAL_NAME           0x0d
#define NB_NAME_TABLE_FULL                0x0e
#define NB_NAME_HAS_ACTIVE_SESSIONS       0x0f

#define NB_LOCAL_SESSION_TABLE_FULL       0x11
#define NB_SESSION_OPEN_REJECTED          0x12
#define NB_ILLEGAL_NAME_NUMBER            0x13
#define NB_CANNOT_FIND_CALLED_NAME        0x14
#define NB_NAME_NOT_FOUND_OR_ILLEGAL      0x15
#define NB_NAME_USED_ON_RMT_ADAPTER       0x16
#define NB_NAME_DELETED                   0x17
#define NB_SESSION_ENDED_ABNORMALLY       0x18
#define NB_NAME_CONFLICT_DETECTED         0x19
#define NB_INCOMPATIBLE_RMT_DEVICE        0x1a

#define NB_INTERFACE_BUSY                 0x21
#define NB_TOO_MANY_COMMANDS_PENDING      0x22
#define NB_INVALID_ADAPTER_NUMBER         0x23
#define NB_CMD_COMPLETED_DURING_CANCEL    0x24
#define NB_RESERVED_NAME_SPECIFIED        0x25
#define NB_CMD_NOT_VALID_TO_CANCEL        0x26

#define NB_LANA_SYSTEM_ERROR              0x40
#define NB_LANA_REMOTE_HOT_CARRIER        0x41
#define NB_LANA_LOCAL_HOT_CARRIER         0x42
#define NB_LAN_NO_CARRIER_DETECTED        0x43
#define NB_UNUSUAL_NETWORK_CONDITION      0x44

#define NB_ADAPTER_MALFUNCTION            0x50

#define NB_COMMAND_PENDING                0xff

#define MAX_SESSION_BUFFER_SIZE           8192



#define MAXNODE       6
#define MAXRCVNCB     6
#define MAXNETPOOL    10
#define DATAGRAM_LEN  1024		//512报文长度

#define FERTNODEMAXNUM 2
#define HOSTNODEMAXNUM 10
#define MAXDBN         6
#define MAXFN          6

class NCB {
public:
    BYTE huge   NcbCommand;              /* command code                       */
    BYTE huge   NcbRetCode;              /* return code                        */
    BYTE huge   NcbLsn;                  /* local session number               */
    BYTE huge   NcbNum;                  /* Datagram Add Name table entry      */
    LPSTR huge   NcbBuffer;
    WORD  huge  NcbLength;
    char  huge  NcbCallName[16];
    char  huge  NcbName[16];

    BYTE  huge  NcbRto;
    BYTE  huge  NcbSto;

    char  huge *NcbPostRtn;
    BYTE  huge  NcbLanaNum;
    BYTE  huge  NcbCmdCplt;

    char  huge  NcbReservedArea[14];
};

class NODEMSG
{
public:
    BOOL    Use;
    BYTE    NodeState;                    // 'H' == main. 'B'== back.
    WORD    ATBCount;
    WORD    LostCount;
};

//
class GRAMHEAD
{
public:
    BYTE    DestType;        //'G' 'F' 'H'
    BYTE    DestName;        //A B C D
    BYTE    SourceType;      //F H
    BYTE    SourceName;      //A B C D
    BYTE    SourceNo;        // not use .0--6.     0,1 is fert.   2,3,4... is back.
    WORD    TxCount;
};
class GRAMINF
{
public:
    BYTE    FertStatus;
    BYTE    CmdCode;
    WORD    Length;
};
class CREGISTER
{
public:
    BYTE    NodeNo;            //0--6
    BYTE    NodeType;        //F H
    BYTE    NodeName;        //A  B  C  D  == NodeId
    BYTE    NodeState;     //M/S
};
//
class NETSEND
{
public:
    WORD        TxCount;
    NCB         SendNcb;
	BOOL        txfinishflag; //发送完成标志
    char far    TXBUF_addr[DATAGRAM_LEN];
};

class NETRCV
{
public:
    WORD  huge    RxCount;
    char  huge    RXBUF_addr[DATAGRAM_LEN];
    NCB   huge    RcvNcb;
    BOOL  huge    rxfinishflag;
};

class NETPOOL
{
    char far    RcvPool[DATAGRAM_LEN];
    BOOL        NewData;
public:
    BOOL haveNewData() { return NewData; }
    void SetNewData( LPSTR buf)
    {
        memmove(RcvPool,buf,DATAGRAM_LEN);
        NewData = TRUE;
    }
    void ProNewData() { NewData = FALSE; }
    LPSTR GetBuf()    { return RcvPool; }
};

class TRANSDBNFN {
public:
    BYTE  Trans;
    DWORD Offset;
    DWORD endOffset;
    WORD  Length;
    TRANSDBNFN () { Trans=0;Offset=0;endOffset =0;}
};

extern NETSEND huge NetSend;
extern NETRCV  huge NetRcv[MAXRCVNCB];
extern NODEMSG huge FertNode[FERTNODEMAXNUM];
extern NODEMSG huge HostNode[HOSTNODEMAXNUM];

extern BYTE huge    NodeCount;
extern BYTE huge    MainFertName;
extern BYTE huge    ThisNodeName;
extern BOOL huge    FrameFlag[60];
extern BYTE huge    CallPara;
extern BYTE far CurrDbn;
extern BYTE far CurrFn;
extern TRANSDBNFN far TransDbnFn[MAXDBN+1][MAXFN+1];

extern void          SetRcvData (LPSTR buf);
extern BYTE          GetMainHostName ();
extern BYTE          GetNodeNo (BYTE);


#endif

⌨️ 快捷键说明

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