[
https://issues.apache.org/jira/browse/MESOS-1919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14184789#comment-14184789
]
Evelina Dumitrescu edited comment on MESOS-1919 at 10/27/14 3:44 AM:
---------------------------------------------------------------------
Possible cases where it wouldn't make sense to use
sockaddr_in/sockaddr_in6/sockaddr_storage:
- the IP class and the various situations where it is used:
-- libnl Classifiers for ICMP
-- libnl routing Rule class
-- for getting IPs from interfaces (ie: inline Result<IP> ip(const
std::string& name))
- Process class - separate methods for getting the ip and port(ie: used in
./src/master/http.cpp, type_utils.cpp, sched.cpp)
- flags and environment variables setting.
The IP abstraction will be used also for the netmask.
I think that the Node class should be left as it is.
IMO, Node actually abstracts the endpoint notion: it defines the association of
the ip & port for a connetion.
A node defines more the host(which can have multiple active endpoints).
I want to propose to rename this class in Endpoint and also replace the ip and
port fields from UPID class with this type.
All the IPv6/IPv4 abstraction should be moved into a single class.
This class should be able to work with the SockaddrStorage struct (that will be
useful for the functions that use sockaddr) and with the IPAddress struct(that
will be useful for the situations where only the IP is needed). So far, I have
reffered to this class as IPEndPoint, but the class name should be changed to
something more appropiate: maybe InetHandler(because it handles the
SockaddrStorage and IPAddress structs).
was (Author: evelinad):
Possible cases where it wouldn't make sense to use
sockaddr_in/sockaddr_in6/sockaddr_storage:
- the IP class and the various situations where it is used:
- libnl Classifiers for ICMP
- libnl routing Rule class
- for getting IPs from interfaces (ie: inline Result<IP> ip(const
std::string& name))
- Process class - separate methods for getting the ip and port(ie: used in
./src/master/http.cpp, type_utils.cpp, sched.cpp)
- flags and environment variables setting.
The IP abstraction will be used also for the netmask.
I think that the Node class should be left as it is.
IMO, Node actually abstracts the endpoint notion: it defines the association of
the ip & port for a connetion.
A node defines more the host(which can have multiple active endpoints).
I want to propose to rename this class in Endpoint and also replace the ip and
port fields from UPID class with this type.
All the IPv6/IPv4 abstraction should be moved into a single class.
This class should be able to work with the SockaddrStorage struct (that will be
useful for the functions that use sockaddr) and with the IPAddress struct(that
will be useful for the situations where only the IP is needed). So far, I have
reffered to this class as IPEndPoint, but the class name should be changed to
something more appropiate: maybe InetHandler(because it handles the
SockaddrStorage and IPAddress structs).
> Create IP address abstraction
> -----------------------------
>
> Key: MESOS-1919
> URL: https://issues.apache.org/jira/browse/MESOS-1919
> Project: Mesos
> Issue Type: Task
> Components: libprocess
> Reporter: Dominic Hamon
> Assignee: Evelina Dumitrescu
> Priority: Minor
>
> in the code many functions need only the ip address to be passed as a
> parameter. I don't think it would be desirable to use a struct
> SockaddrStorage (MESOS-1916).
> Consider using a {{std::vector<unsigned char>}} (see {{typedef
> std::vector<unsigned char> IPAddressNumber;}} in the Chromium project)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)