360 lines
8.6 KiB
Plaintext
360 lines
8.6 KiB
Plaintext
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; This is a Pilot Debugger script used to help in debugging the
|
|
; Net Library. It contains structure definitions for most of the
|
|
; Net Library structures.
|
|
;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; Constants
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
var "netRcvPktQLen" #13
|
|
var "netNumCmdBlocks" #8
|
|
var "netMaxNumSockets" #4
|
|
var "netMaxNetIFs" #4
|
|
var "netMaxNumPISockets" #4
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; Epilogue structures
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
typedef struct "timer"
|
|
> MemPtr "link"
|
|
> UInt32 "expire"
|
|
> MemPtr "handler"
|
|
> MemPtr "cookie"
|
|
typeend
|
|
|
|
typedef struct "packet"
|
|
> packet @"pkt_link"
|
|
> MemPtr "pkt_n"
|
|
> UInt32 "pkt_tstamp"
|
|
> UInt16 "pkt_flags"
|
|
> UInt8Ptr "pkt_buffer"
|
|
> UInt16 "pkt_buflen"
|
|
> UInt8Ptr "pkt_data"
|
|
> UInt16 "pkt_datalen"
|
|
> UInt16 "opt_len"
|
|
> MemPtr "pkt_completion"
|
|
> MemPtr "pkt_private"
|
|
> MemPtr "pkt_rcv_info"
|
|
typeend
|
|
typedef packet @"packetptr"
|
|
|
|
|
|
typedef struct "driver"
|
|
> MemPtr "init"
|
|
> MemPtr "send"
|
|
> MemPtr "ip_send"
|
|
> MemPtr "arp_send"
|
|
> MemPtr "device_ctl"
|
|
> MemPtr "close"
|
|
> Char @"prefix"
|
|
> Char @"name"
|
|
> UInt16 "lnh"
|
|
> UInt16 "lnt"
|
|
> UInt16 "maxlen"
|
|
> Int16 "type"
|
|
> UInt16 "arp_hw_type"
|
|
> MemPtr "media_ctl"
|
|
typeend
|
|
|
|
typedef struct "net_if"
|
|
> MemPtr "link"
|
|
> driver @"driver"
|
|
> Int16 "instance"
|
|
> packet @"inputq"
|
|
> UInt16 "flags"
|
|
> Char @"s_name"
|
|
> UInt32 "ip_addr"
|
|
> UInt32 "ip_mask"
|
|
> UInt32 "ip_bcast"
|
|
> MemPtr "arp"
|
|
> timer "arp_tm"
|
|
> Int16 "ha_len"
|
|
> UInt8Ptr "h_address"
|
|
> MemPtr "specific"
|
|
> UInt16 "mtu"
|
|
> UInt32 "speed"
|
|
> UInt32 "status_tstamp"
|
|
> UInt32 "ifInOctets"
|
|
> UInt32 "ifInUcastPkts"
|
|
> UInt32 "ifInNUcastPkts"
|
|
> UInt32 "ifInDiscards"
|
|
> UInt32 "ifInErrors"
|
|
> UInt32 "ifInUnknownProtos"
|
|
> UInt32 "ifOutOctets"
|
|
> UInt32 "ifOutNUcastPkts"
|
|
> UInt32 "ifOutDiscards"
|
|
> UInt32 "ifOutErrors"
|
|
> MemPtr "ifSpecific"
|
|
> MemPtr "media_cookie"
|
|
typeend
|
|
|
|
|
|
; DNS Structures
|
|
typedef struct "dns_config"
|
|
> MemPtr "dns_transport"
|
|
> UInt16 "n_servers"
|
|
> MemPtr "servers"
|
|
> UInt16 "max_tries_per_server"
|
|
> UInt32 "wait_for_buf_alloc"
|
|
> UInt16 "max_buf_alloc_failures"
|
|
> MemPtr "search_path"
|
|
> UInt32 "max_ttl"
|
|
> MemPtr "preferences"
|
|
typeend
|
|
|
|
typedef struct "dns_server"
|
|
> UInt32 "addr"
|
|
typeend
|
|
|
|
typedef struct "dns_preference_list"
|
|
> UInt32 "addr"
|
|
> UInt32 "mask"
|
|
typeend
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; Command Block
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
typedef struct "NetLibCmdPBType"
|
|
> NetLibCmdPBType @"nextP"
|
|
> UInt8 "checkoutCount"
|
|
|
|
> Boolean "done"
|
|
> UInt32 "callerTaskID"
|
|
> UInt32 "uniqueID"
|
|
|
|
> UInt8 "cmd"
|
|
> Err "result"
|
|
> UInt8 "param"[#20] \-
|
|
typeend
|
|
|
|
typedef NetLibCmdPBType @"NetLibCmdPBPtr"
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; NetIOVec
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
typedef struct "NetIOVecType"
|
|
> UInt8Ptr "bufP"
|
|
> UInt16 "bufLen"
|
|
typeend
|
|
|
|
typedef NetIOVecType @"NetIOVecPtr"
|
|
|
|
typedef struct "NetIOParamType"
|
|
> UInt8Ptr "addrP"
|
|
> UInt16 "addrLen"
|
|
> NetIOVecPtr "iov"
|
|
> UInt16 "iovLen"
|
|
> UInt8Ptr "accessRights"
|
|
> UInt16 "accessRightsLen"
|
|
typeend
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; Socket
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
typedef struct "NetSocketLingerType"
|
|
> Int16 "onOff"
|
|
> Int16 "time"
|
|
typeend
|
|
|
|
typedef struct "NetSocketType"
|
|
> UInt16 "rcvOpen-sendOpen-nonBlocking"
|
|
> UInt16 "socketRef"
|
|
> UInt8 "type"
|
|
> UInt8 "filler" \-
|
|
> Err "err"
|
|
> NetSocketLingerType "linger" \-
|
|
|
|
> MemPtr "conn.tcbP_or_udpP"
|
|
> NetLibCmdPBPtr "conn.tcp.pendConnectCmdP"
|
|
> UInt16 "conn.tcp.flags"
|
|
> NetLibCmdPBPtr "conn.tcp.pendAcceptCmdP"
|
|
> MemPtr "conn.tcp.acceptTcbP"
|
|
> UInt16 "conn.tcp.remoteWindowSize"
|
|
> UInt16 "conn.tcp.localWindowSize"
|
|
|
|
> UInt16 "rcvStart"
|
|
> UInt16 "rcvEnd"
|
|
> packetptr "rcvPacketP"[netRcvPktQLen]
|
|
> UInt32 "rcvHostIPAddr"[netRcvPktQLen] \-
|
|
> UInt16 "rcvHostPort"[netRcvPktQLen] \-
|
|
|
|
> UInt16 "rcvUrgentPktOffset"
|
|
> UInt32 "rcvUrgentByteOffset"
|
|
|
|
> UInt32 "rcvBytesAdded"
|
|
> UInt32 "rcvBytesRemoved"
|
|
|
|
> Boolean "rcvClientBlocking"
|
|
> UInt32 "rcvClientTaskID"
|
|
|
|
> UInt16 "rcvMinSize"
|
|
|
|
> MemPtr "rcvRecordP"
|
|
> NetIOVecType "rcvIOBuf" \-
|
|
> NetIOVecPtr "rcvIOVP"
|
|
> UInt16 "rcvIOVLen"
|
|
typeend
|
|
typedef NetSocketType @"NetSocketPtr"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; Network Interface Info structure
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
typedef struct "NetIFInfoType"
|
|
> UInt32 "creator"
|
|
> UInt16 "instance"
|
|
> MemHandle "codeH"
|
|
> MemPtr "procP"
|
|
> net_if @"netP"
|
|
> UInt16 "cardNo"
|
|
> LocalID "dbID"
|
|
typeend
|
|
typedef NetIFInfoType @"NetIFInfoPtr"
|
|
|
|
typedef struct "NetIFCallbacksType"
|
|
> MemPtr "ip_rcv"
|
|
> MemPtr "ip_advise_if_down"
|
|
> MemPtr "ip_advise_if_up"
|
|
> MemPtr "pkt_alloc"
|
|
> MemPtr "pkt_free"
|
|
> MemPtr "traceMsg"
|
|
> MemPtr "traceMsgPrintF"
|
|
> MemPtr "tm_init"
|
|
> MemPtr "tm_cancel"
|
|
> MemPtr "tm_set"
|
|
> MemPtr "netGiveTime"
|
|
> MemPtr "add_address"
|
|
> MemPtr "settingGet"
|
|
> MemPtr "settingSet"
|
|
> MemPtr "raw_rcv"
|
|
> MemPtr "setSocketErr"
|
|
> MemPtr "tracePkt"
|
|
> MemPtr "netSemReserve"
|
|
> MemPtr "netSemRelease"
|
|
typeend
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; Globals
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
typedef struct "NetGlobalsType"
|
|
> UInt32 "lockSemID"
|
|
> UInt8 "openCount"
|
|
> UInt8 "flags"
|
|
> MemPtr "shadowGlobalsP"
|
|
|
|
> UInt16 "refNum"
|
|
> Int32 "mailboxID"
|
|
> UInt32 "netTaskID"
|
|
> UInt32 "timerID"
|
|
> MemPtr "glueCallInHandler"
|
|
|
|
> timer "closeTimer" \-
|
|
|
|
> UInt16 "cmdPBsCheckedOut"
|
|
> UInt32 "cmdPBUniqueID"
|
|
> NetLibCmdPBPtr "cmdPBHeadP"
|
|
> NetLibCmdPBType "cmdPB"[netNumCmdBlocks] \-
|
|
|
|
> UInt16 "openSockets"
|
|
> UInt16 "openRawIPSockets"
|
|
> NetSocketPtr "socketP"[netMaxNumSockets]
|
|
|
|
> UInt16 "piLibRefNum"[netMaxNumPISockets]
|
|
|
|
> UInt16 "numNetIFs"
|
|
> NetIFInfoType "netIFInfo"[netMaxNetIFs] \-
|
|
|
|
> UInt8 "connected"
|
|
> UInt8 "filler"
|
|
|
|
> MemPtr "hostTableP"
|
|
|
|
> UInt32 "traceBits"
|
|
> UInt8 "traceRoll"
|
|
> MemPtr "traceBufP"
|
|
> UInt16 "traceStart"
|
|
> UInt16 "traceSize"
|
|
|
|
> UInt16 "udpNextPort"
|
|
|
|
> UInt16 "dnsFlags"
|
|
> dns_config "dnsConfig" \-
|
|
> dns_server "dnsServers"[4] \-
|
|
> dns_preference_list "dnsPreferences" \-
|
|
> MemPtr "dnsSearchPath"[3] \-
|
|
> Char "dnsDomainName"[#256] \-
|
|
|
|
> UInt16 "prefsDBCardNo"
|
|
> LocalID "prefsDBID"
|
|
|
|
> UInt32 "tcpSendSpaceAvailable"
|
|
|
|
> NetIFCallbacksType "ifCallbacks" \-
|
|
|
|
> UInt16 "ifThreads"
|
|
|
|
> MemPtr "cmdPBCheckoutP"
|
|
> MemPtr "cmdPBCheckinP"
|
|
> MemPtr "globalsLockP"
|
|
> MemPtr "globalsUnlockP"
|
|
> MemPtr "ifGetCodePtrP"
|
|
> MemPtr "ifGetFromPrefsP"
|
|
> MemPtr "ifAttachToPrefsP"
|
|
> MemPtr "ifDetachFromPrefsP"
|
|
> MemPtr "ifSettingGetP"
|
|
> MemPtr "ifSettingSetP"
|
|
> MemPtr "settingGetP"
|
|
> MemPtr "settingSetP"
|
|
> MemPtr "traceInitP"
|
|
> MemPtr "traceDoneP"
|
|
> MemPtr "traceEventStoreP"
|
|
> MemPtr "traceEventGetP"
|
|
> MemPtr "traceMsgPrintF"
|
|
|
|
typeend
|
|
typedef NetGlobalsType @"NetGlobalsPtr"
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; SLIP Globals
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
typedef struct "SlipGlobalsType"
|
|
> UInt16 "serWakes"
|
|
> UInt16 "serRefNum"
|
|
> Boolean "serOpen"
|
|
> UInt32 "emTaskID"
|
|
> MemPtr "callbacksP"
|
|
> UInt8 "escend"[2]
|
|
> UInt8 "escesc"[2]
|
|
> Boolean "escaped"
|
|
> packet @"rcvPktP"
|
|
> UInt8Ptr "serRcvBufP"
|
|
typeend
|
|
|
|
|
|
;################################################################
|
|
; Macros
|
|
;##############################################################
|
|
var "GSysLibTableP" 00000140
|
|
var "GSysLibNet" 00000272
|
|
|
|
;This alias assumes that each lib entry entry is 8 bytes.
|
|
; It gets the Net Globals pointer from the second long word in
|
|
; the entry for the Net Library.
|
|
alias "NetGlobals" "dm @(@GSysLibTableP+(@.w(GSysLibNet))*10+4) NetGlobalsType"
|
|
|
|
|
|
|
|
|
|
|