-
Moin,
und nochmals Old School:
H DFTACTGRP(*NO) ACTGRP(*NEW)
D inet_addr PR 10U 0 ExtProc('inet_addr')
D address_str * value options(*string)
D INADDR_NONE C CONST(4294967295)
D inet_ntoa PR * ExtProc('inet_ntoa')
D internet_addr 10U 0 value
D p_hostent S *
D hostent DS Based(p_hostent)
D h_name *
D h_aliases *
D h_addrtype 10I 0
D h_length 10I 0
D h_addr_list *
D p_h_addr S * Based(h_addr_list)
D h_addr S 10U 0 Based(p_h_addr)
D gethostbyname PR * extproc('gethostbyname')
D host_name * value options(*string)
D host S 32A
D IP S 10U 0
D Msg S 50A
c *entry plist
c parm host
c eval IP = inet_addr(%trim(host))
c if IP = INADDR_NONE
c eval p_hostent = gethostbyname(%trim(host))
c if p_hostent <> *NULL
c eval IP = h_addr
c endif
c endif
c if IP = INADDR_NONE
c eval Msg = 'Host not found!'
c else
c eval Msg = 'IP = ' + %str(inet_ntoa(IP))
c endif
c dsply Msg
c eval *inlr = *on
mfg
DKSPROFI
Similar Threads
-
By _MG_ in forum NEWSboard Programmierung
Antworten: 2
Letzter Beitrag: 22-11-15, 09:19
-
By mott in forum NEWSboard Programmierung
Antworten: 0
Letzter Beitrag: 15-10-14, 12:43
-
By Uwe Kohlberg in forum IBM i Hauptforum
Antworten: 9
Letzter Beitrag: 21-08-08, 08:32
-
By systemer in forum IBM i Hauptforum
Antworten: 7
Letzter Beitrag: 19-02-03, 08:33
-
By karin-vogelmann in forum IBM i Hauptforum
Antworten: 3
Letzter Beitrag: 09-11-01, 15:10
Tags for this Thread
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