Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1004117 // isPublicIP

JavaX fragment (include)

1  
static bool isPublicIP(S ip) ctex {
2  
  InetAddress addr = InetAddress.getByName(ip);
3  
  ip = addr.getHostAddress();
4  
  ret !(
5  
    startsWithOneOf(ip, "169.254.", "127.", "192.168.", "fc", "fd", "fe")
6  
    || addr.isSiteLocalAddress());
7  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004117
Snippet name: isPublicIP
Eternal ID of this version: #1004117/6
Text MD5: dea8db9e5de101ecb33c9c4ff65318c2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-25 23:56:54
Source code size: 239 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 630 / 632
Version history: 5 change(s)
Referenced in: [show references]