-
QDCRDEVD API
aber es gibt doch z.B. das QDCRDEVD API mit diesem kann ich
doch die verschiedensten Informationen bekommen. (wie in dem API LINK beschrieben)
z.B.:
Retrieve the IP Address of a Connected Telnet Client
by Scott Klement
Club Tech iSeries Programming Tips Editor
January 15, 2006 —
Q: How can I retrieve the IP address of someone connected with Telnet? For example, if a user on my network uses iSeries Access to sign on to my iSeries from his or her desktop PC, can I retrieve that PC's IP address?
A: Yes, the Retrieve Device Description (QDCRDEVD) API can return the IP address of the computer that a given display device is connected to.
The QDCRDEVD API is documented in the iSeries Information Center at the following link:
http://publib.boulder.ibm.com/infoce...s/QDCRDEVD.htm
The "Format name" parameter needs to be set to DEVD0600, because this is the format that contains information about display devices.
The "Device name" parameter should be set to the name of the device that you'd like to get the IP address for. If it's for the current interactive job, you can use the RTVJOBA command to get the device name.
For example, if you wanted to write a CL program that uses SNDUSRMSG to display the address of the 5250 client (i.e., the PC connected with iSeries Access) as well as the address of the iSeries itself, you could code the following:
PGM PARM(&DEV)
DCL VAR(&DEV) TYPE(*CHAR) LEN(10)
DCL VAR(&RCVVAR) TYPE(*CHAR) LEN(1000)
DCL VAR(&RCVVARLEN) TYPE(*CHAR) LEN(4)
DCL VAR(&ERRCODE) TYPE(*CHAR) LEN(8) VALUE(X'00000000')
DCL VAR(&PC) TYPE(*CHAR) LEN(15)
DCL VAR(&ISERIES) TYPE(*CHAR) LEN(15)
IF (&DEV *EQ '*CURRENT') DO
RTVJOBA JOB(&DEV)
ENDDO
CHGVAR VAR(%BIN(&RCVVARLEN)) VALUE(1000)
CALL PGM(QDCRDEVD) PARM( &RCVVAR +
&RCVVARLEN +
'DEVD0600' +
&DEV +
&ERRCODE )
CHGVAR VAR(&PC) VALUE(%SST(&RCVVAR 878 15))
CHGVAR VAR(&ISERIES) VALUE(%SST(&RCVVAR 958 15))
SNDUSRMSG MSG('5250 client has IP address' *BCAT &PC) +
MSGTYPE(*INFO)
SNDUSRMSG MSG('iSeries has IP address' *BCAT &ISERIES) +
MSGTYPE(*INFO)
ENDPGM
If you call that program with a parameter of *CURRENT, it looks up the current interactive session. Otherwise, it expects the parameter to be the name of the device that you want to get the address of.
For example, to find the current interactive program's IP address, I could type:
CALL PGM(GETIP) PARM('*CURRENT')
If I want to know the DSP01 session's IP address, I could type the following, instead:
CALL PGM(GETIP) PARM('DSP01')
If you want to use those IP addresses in your program, it should be an easy modification to return the addresses as parameters.
Similar Threads
-
By RaMai in forum NEWSboard Server Job
Antworten: 6
Letzter Beitrag: 04-06-07, 17:49
-
By Stoeberl in forum NEWSboard Programmierung
Antworten: 8
Letzter Beitrag: 10-01-07, 10:58
-
By jth in forum NEWSboard Programmierung
Antworten: 1
Letzter Beitrag: 21-12-06, 11:13
-
By srcdbgr in forum IBM i Hauptforum
Antworten: 9
Letzter Beitrag: 12-09-06, 14:37
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- You may not post attachments
- You may not edit your posts
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks