Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4972 → Rev 4973

/programs/develop/libraries/menuetlibc/src/libcpp/net/ip_addr.cpp
0,0 → 1,32
#include<menuet/network.hpp>
 
IP_Address::IP_Address(unsigned long addr)
{
this_ip_inet_fmt=addr;
}
 
IP_Address::IP_Address(__u8 p1,__u8 p2,__u8 p3,__u8 p4)
{
this_ip_inet_fmt=p4;
this_ip_inet_fmt<<=8;
this_ip_inet_fmt|=p3;
this_ip_inet_fmt<<=8;
this_ip_inet_fmt|=p2;
this_ip_inet_fmt<<=8;
this_ip_inet_fmt|=p1;
}
 
IP_Address::~IP_Address()
{
}
 
unsigned long IP_Address::operator = (IP_Address& a)
{
return a.this_ip_inet_fmt;
}
 
IP_Address& IP_Address::operator = (unsigned long a)
{
this->this_ip_inet_fmt=a;
return *this;
}
/programs/develop/libraries/menuetlibc/src/libcpp/net/udp_socket.cpp
0,0 → 1,39
#include<menuet/network.hpp>
 
UDP_Socket::UDP_Socket(__u32 local_port,__u32 remote_port,__u32 remote_ip,bool close_on_delete)
{
this->p[0]=local_port;
this->p[1]=remote_port;
this->p[2]=remote_ip;
this->f=close_on_delete;
}
 
UDP_Socket::~UDP_Socket()
{
if(this->f) this->Close();
}
 
int UDP_Socket::Open()
{
return (sock=__menuet__open_UDP_socket(p[0],p[1],p[2]));
}
 
int UDP_Socket::Close()
{
return __menuet__close_UDP_socket(sock);
}
 
int UDP_Socket::Read(__u8 * data)
{
return __menuet__read_socket(sock,data);
}
 
int UDP_Socket::Write(int count,void * data)
{
return __menuet__write_UDP_socket(sock,count,data);
}
 
int UDP_Socket::Poll()
{
return __menuet__poll_socket(sock);
}