|
I have been trying to code up a simple program using the V5R1 API QtocRtvNetCnnDta. I can get the data returned into the NCND0200 format just fine. I am having a terrible time trying to get some of the data in the List of Job/Task Connections data structure(?). I am trying to get to the data that is at the offset contained in the variable QTOLJAWC (Offset to list of jobs associated with). My initial thought is that since the offset is mentioned I should be able to "point" to that area using the eval stmt. In my case this returnes no data. If I increase the size of the data structure QTOD020000 by 62 bytes(size of the data I want) I get the data I want. The proble with this approach is that there could be multiple occurences of that data structure. The API is documented here: http://publib.boulder.ibm.com/html/as400/v5r1/ic2924/info/apis/qtocrtvnetcnndta.htm here Is what I have coded so far (please be nice, I am not a good programmer just full of ideas) **-- Header specifications: --------------------------------------------** H Option( *SrcStmt ) hdftactgrp( *no ) bnddir( 'QC2LE' ) DEBUG **-- Global declarations: ----------------------------------------------** D*QtocRtvNetCnnDta D*1st arg - I/O - pointer to receiver variable space D*2nd arg - OUTPUT - size of receiver variable D*3rd arg - INPUT - pointer to API output format name D*4th arg - INPUT - pointer to Socket Connection Request D*5th arg - I/O - pointer to Error code storage variable * QSYSINC/QRPGLESRC * QTOCNETSTS **-- Api error data structure: -----------------------------------------** D ApiError Ds D AeBytPro 10i 0 Inz( %Size( ApiError )) D AeBytAvl 10i 0 Inz D AeMsgId 7a D 1a D AeMsgDta 128a **-- List network connections: -----------------------------------------** D LstNetDta Pr ExtProc( 'QtocRtvNetCnnDta' ) D LcRcvVarQ * value D LcRcvVarLen 10i 0 const D LcRtvQualFmt 8a const D LcRtvSocConn * value D LcError 1024a Options( *VarSize ) ** **--Type Definition for Input Parameter - Socket Connection Request ** DSocReqInfo DS Qtoc RtvNetCnnDta Socket Req D SRProtocol 1 4U 0 Protocol D SRLclIP 5 8U 0 Local IP Address D SRLclPort 9 12U 0 Local Port Number D SRRmtIP 13 16U 0 Remote IP Address D SRRmtPort 17 20U 0 Remote Port Number ** D*Type Definition for the NCND0200 format of the receiver variable. D*If this format is requested the NCND0100 format is included. D******************************************************************* DQTOD020000 DS Qtoc RtvNetCnnDta NCND0200 D Q01BytRetr 10U 0 Bytes Returned D Q02BytAvail 10U 0 Bytes Available D Q03TCPConCur 10U 0 TCP Connections Curr Est D Q04TCPActOpn 10U 0 TCP Active Opens D Q05TCPPasOpn 10U 0 TCP Passive Opens D Q06TCPAtOpFl 10U 0 TCP Attempted Opens Failed D Q07TCPEstRset 10U 0 TCP Established And Then Res D Q08TCPSegSnt 10U 0 TCP Segments Sent D Q09TCPRtrSeg 10U 0 TCP Retransmited Segments D Q10TCPRsetSeg 10U 0 TCP Reset Segments D Q11TCPSegRcv 10U 0 TCP Segments Received D Q12TCPSegRErr 10U 0 TCP Segments Received In Err D Q13UDPDtaGSnt 10U 0 UDP Datagrams Sent D Q14UDPDtaGRcv 10U 0 UDP Datagrams Received D Q15UDPDtaGND 10U 0 UDP Datagrams ND Port Not Fn D Q16UDPDtaGOt 10U 0 UDP Datagrams ND Other Dtg E D Q17OffSetAdd 10U 0 Offset To Additional Info D Q18LenAddInf 10U 0 Length Of Additional Info D Q19Proto 10U 0 Protocol D Q20LocIP 10U 0 Local IP Address D Q21LocPort 10U 0 Local Port Number D Q22RmtIP 10U 0 Remote IP Address D Q23RmtPort 10U 0 Remote Port Number D Q24RndTrip 10U 0 Round Trip Time D Q25RndTripV 10U 0 Round Trip Variance D Q26OutByteBuf 10U 0 Outgoing Bytes Buffered D Q27UsrSndNxt 10U 0 User Send Next D Q28SndNext 10U 0 Send Next D Q29SndUnAck 10U 0 Send Unacknowledged D Q30OutPush# 10U 0 Outgoing Push Number D Q31OutUrg# 10U 0 Outgoing Urgency Number D Q32OutWind# 10U 0 Outgoing Window Number D Q33InBytBuf 10U 0 Incoming Bytes Buffered D Q34RcvNxt 10U 0 Receive Next D Q35UsrRcvNxt 10U 0 User Receive Next D Q36InPush# 10U 0 Incoming Push Number D Q37InUrg# 10U 0 Incoming Urgency Number D Q38InWind# 10U 0 Incoming Window Number D Q39TotRetr 10U 0 Total Retransmissions D Q40CurRetr 10U 0 Currect Retransmissions D Q41MaxWindSiz 10U 0 Maximum Window Size D Q42CurWindSiz 10U 0 Current Window Size D Q43LastUpd 10U 0 Last Update D Q44LastUpdACK 10U 0 Last Update Acknowledged D Q45CongWind 10U 0 Congestion Window D Q46SlowStrThr 10U 0 Slow Start Threshold D Q47MaxSeqSiz 10U 0 Maximum Seqment Size D Q48IntSndSeq# 10U 0 Initial Send Sequence Number D Q49IntRcvSeq# 10U 0 Initial Receive Sequence Num D Q50ConTrnLayr 10U 0 Connection Transport Layer D Q51TCPState 10U 0 TCP State D Q52ConOpnTyp 10U 0 Connections Open Type D Q53IdlTimMSec 10U 0 Idle Time In Milliseconds D Q54IPOpt 40 IP Options D Q55ByteIn 10U 0 Bytes In D Q56ByteOut 10U 0 Bytes Out D Q57SocState 10U 0 Socket State D Q58OfsLstSocOp 10U 0 Offset List Of Socket Option D Q59#SocOpt 10U 0 Num Socket Opts Assoc With C D Q60EntLenSocOp 10U 0 Entry Len List Sock Opts A W D Q61OfsLstJob 10U 0 Offset List Jobs Assoc W Cnn ( QTOLJAWC) D Q62#JobConn 10U 0 Num Jobs Assoc With Connecti D Q63EntLenLstJb 10U 0 Entry Len List Jobs A W Cnn D******************************************************************* D*Type Definition for the List of Job/Task Connections. D******************************************************************* DJobInfo DS 62 BASED(p2JobInfo) Qtoc RtvNetCnnDta LC D QJobFmtEnt 10U 0 Format Entry D QTaskName 16 Task Name D QJobname 10 Job Name D QJobUser 10 Job User D QJobNumber 6 Job Number D QJobIntID 16 Job Internal ID D* D******************************************************************* D*Type Definition for the List of Socket Options. D******************************************************************* DQTOCDLSO DS Qtoc RtvNetCnnDta LSO D QTOSO 1 4U 0 Socket Option D QTOOV 5 8U 0 Option Value **----------Misc Variables-----------------------------------------------** D rcvvarlen S 10i 0 D p2JobInfo s * **-- Mainline: ---------------------------------------------------------** * Hard code the input variables. The will be populated one I get this figured out c eval SRProtocol = 1 c eval SRLclIP = 3232274210 c eval SRLclPort = 23 c eval SRRmtIP = 3232274400 c eval SRRmtPort = 2323 c eval RcvVarLen = %size(QTOD020000) Just Testing * C CallP LstNetDta( %Addr(QTOD020000) C : %size(QTOD020000) C : 'NCND0200' C : %addr(SocReqInfo) C : ApiError C ) ** c eval p2JobInfo = %addr(QTOD020000) + Q61OfsLstJob + 1 c dump c eval *INLR = *ON C Return ------------------------- Bryan Dietz 3X Corporation 614-410-9205
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.