-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinet_addr.cpp
More file actions
38 lines (31 loc) · 811 Bytes
/
inet_addr.cpp
File metadata and controls
38 lines (31 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* =====================================================================================
*
* Filename: inet_addr.cpp
*
* Description:
*
* Version: 1.0
* Created: 09/12/2017 10:38:07 AM
* Last Modified: 2018-01-08 08:26:16
* Revision: none
* Compiler: gcc
*
* Author: zt (),
* Organization:
*
* =====================================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main ( int argc, char* argv[] )
{
( void ) argc;
( void ) argv;
uint32_t s1 = ( uint16_t ) ( inet_addr ( "172.16.129.252" ) >> 16 );
uint32_t s2 = ( uint16_t ) ( inet_addr ( "172.16.129.25" ) >> 16 );
printf ( "%04x %04x\n", s1, s2 );
return 0;
}