Removed the newline from the messages sent
[simple_comm.git] / src / addr_ip.cc
blobe95c8c8e2deba1df20db0a033fa30df67424b139
1 /*******************************************************************************
2 ********************************************************************************
4 Copyright (c) 2008 Ahmed S. Badran
6 Licensed under the FreeBSD License (see LICENSE)
8 Filename: addr_ip.cc
9 Description: Implementation.
10 Created: 12/26/2008 04:40:59 PM PST
11 Author: Ahmed S. Badran (Ahmed B.), ahmed.badran@gmail.com
13 ********************************************************************************
14 *******************************************************************************/
15 #include "addr_ip.h"
16 #include <sys/socket.h>
17 #include <netinet/in.h>
18 #include <arpa/inet.h>
19 using namespace std;
20 using namespace simple_comm;
22 addr_ip::addr_ip (u8 a_, u8 b_, u8 c_, u8 d_):
23 a(a_), b(b_), c(c_), d(d_)
25 struct in_addr addr;
26 addr.s_addr = (a << 24) | (b << 16) | (c << 8) | d;
27 name = inet_ntoa(addr);
30 const string
31 addr_ip::get () const
33 return name;
36 addr_if*
37 addr_ip::clone () const
39 return new addr_ip(a, b, c, d);