Skip to main content

Proposed MPEOS api changes for DLNA DIAGE feature

  3 posts   Feedicon  
Replies: 2 - Last Post: April 15, 2013 21:36
by: smallman
showing 1 - 3 of 3
Posted: March 04, 2013 16:02 by mmas
Background

To support the DLNA DIAGE feature the implementation must be able to issue ping,traceroute and nslookup tests. It must also be able to cancel an in progress test. Since there is no platform independent way to do this it is necessary to add MPEOS apis.
mpeos_hnPing
mpeos_hnTraceroute
mpeos_hnNSLookup
mpeos_hnCancelTest
Details are below

Changes to mpeos_hn.h

/**
* Issues ICMP echo requests packets to the target host and returns results.
* This api will block until the pings succeeds,fails or test is cancelled.
*
* @param testid - id associated with this test.
* @param host - name or address of host to ping. Must not be empty string.
* If value is null or empty "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer( ie "null host string").
* @param reps - number of requests to send.
* Value must be between MPE_SOCKET_PING_MIN_COUNT and
* MPE_SOCKET_PING_MAX_COUNT. If value is not valid "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer( ie "reps out of range").
* @param interval - length of time in msec to wait between sending each request.
* Value must be between MPE_SOCKET_PING_MIN_INTERVAL and
* MPE_SOCKET_PING_MAX_INTERVAL. If value is not valid Error_other is
* returned in status and additional detail may be put in
* the info buffer.
* @param timeout - length of time in msec to wait for response to request.
* Value must be between MPE_SOCKET_MIN_TIMEOUT and
* MPE_SOCKET_MAX_TIMEOUT. If value is not valid "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer.
* @param blocksize - size of each packets data block in bytes. Value must be between
* MPE_SOCKET_MIN_BLOCK_SIZE and
* MPE_SOCKET_MAX_BLOCK_SIZE. If value is not valid
* Error_other is returned in status and additional detail
* may be put in the info buffer.
* @param dscp - Diff Serv Point Code value in IP header. Value must be between
* MPE_SOCKET_MIN_DSCP and MPE_SOCKET_MAX_DSCP.
* If value is not valid "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer.
* @param status - returned null terminated string copied into this
* caller-allocated string array of length MPE_SOCKET_STATUS_SIZE
* indicating overall success of test.
* Valid values are "Success","Error_CannotResolveHostName".
* "Error_Other" and "Error_Internal".
* "Success","Error_CannotResolveHostName" and "Error_Other"
* must be supported.
* String is truncated if greater than MPE_SOCKET_STATUS_SIZE.
* @param info - returned null terminated free formatted string of length
* MPE_SOCKET_ADDITIONAL_INFO_SIZE copied into
* this caller-allocated string array that can contain
* additional information about the test.
* String is truncated if greater than
* MPE_SOCKET_ADDITIONAL_INFO_SIZE.
* @param success - returned number of successful pings
* @param fails - returned number of failed pings
* @param avg - returned average response time in msec of successful pings
* or 0 if there were none.
* @param min - returned minimum response time in msec of successful pings
* or 0 if there were none.
* @param max - returned maximum response time in msec of successful pings
* or 0 if there were none.
*
* @return ::MPE_HN_ERR_NOERR If successful.
* ::MPE_HN_ERR_OS_FAILURE If problems are encountered executing the test.
**/
mpe_Error mpeos_hnPing(int testid, char *host, int32_t reps, int32_t interval, int32_t timeout, int32_t blocksize, int32_t dscp, char *status, char *info, int32_t *success, int32_t *fails, int32_t *avg, int32_t *min, int32_t *max);

/**
* Issues an IP layer traceroute and returns results.
* Traceroute issues a sequence of ICMP echo request packets to a target host
* and determines the intermediate routers transversed.
* This api blocks until the traceroute succeeds, fails or test is cancelled.
*
* @param testid - id associated with this test.
* @param host - name or address of host to probe. Must not be empty string.
* If value is null or empty "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer( ie "null host string").
* @param hops - max number of hops(ie maximum time-to_live). Value must be between
* MPE_SOCKET_TRACEROUTE_MIN_HOPS and MPE_SOCKET_TRACEROUTE_MAX_HOPS.
* If value is not valid "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer.
* @param timeout - length of time in msec to wait for response to probe.
* Value must be between MPE_SOCKET_MIN_TIMEOUT and
* MPE_SOCKET_MAX_TIMEOUT.
* If value is not valid "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer.
* @param blocksize - size of each packets data block in bytes. Value must be between
* MPE_SOCKET_MIN_BLOCK_SIZE and
* MPE_SOCKET_MAX_BLOCK_SIZE. If value is not valid
* Error_other is returned in status and additional detail
* may be put in the info buffer.
* @param dscp - Diff Serv Point Code value in IP header. Value must be between
* MPE_SOCKET_MIN_DSCP and MPE_SOCKET_MAX_DSCP.
* If value is not valid "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer.
* @param status - returned null terminated string copied into this
* caller-allocated string array of length MPE_SOCKET_STATUS_SIZE
* indicating overall success of test.
* Valid values are "Success","Error_CannotResolveHostName",
* "Error_MaxHopCountExceeded","Error_Internal" and "Error_Other".
* "Success","Error_CannotResolveHostName","Error_MaxHopCountExceeded"
* and "Error_Other" must be supported.
* String is truncated if greater than MPE_SOCKET_STATUS_SIZE.
* @param info - returned null terminated free formatted string of length
* MPE_SOCKET_ADDITIONAL_INFO_SIZE copied into
* this caller-allocated string array that can contain
* additional information about the test.
* String is truncated if greater than
* MPE_SOCKET_ADDITIONAL_INFO_SIZE.
* @param avgresp - returned average response time of probes in msec
* @param hophosts - null terminated string array copied into this caller-allocated
* string array of length MPE_SOCKET_MAX_TRACEROUTE_HOSTS
* Comma-separated list of host IP addresses
* along the discovered route. If a host could not be contacted,
* the corresponding entry in the list is empty, i.e.
* there will be two consecutive
* commas in the list, as in host1,,host3.
* String is truncated if greater than
* MPE_SOCKET_MAX_TRACEROUTE_HOSTS.
*
* @return ::MPE_HN_ERR_NOERR If successful.
* ::MPE_HN_ERR_OS_FAILURE If problems are encountered.
**/
mpe_Error mpeos_hnTraceroute(int32_t testid, char *host, int32_t reps, int32_t timeout, int32_t blocksize, int32_t dscp, char *status, char *info, int32_t *avgresp, char *hophosts);

/**
* Issues an IP layer DNS lookup and returns results.
* Queries a supplied DNS server for domain name and IP address
* mappings for a target host.
*
* @param testid - id associated with this test.
* @param host - name of host to lookup. Must not be empty string.
* If name is not fully qualified current domain is used for
* lookup.
* If value is not valid(empty string). "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer( ie "null host string").
* @param server - name or address of server to use. An empty string denotes
* using the default server. If name or address is not resolvable
* "Error_DNSServerNotAvailable" is returned in the status buffer.
* @param timeout - length of time in msec to wait for response to probe.
* Value must be between MPE_SOCKET_MIN_TIMEOUT and
* MPE_SOCKET_MAX_TIMEOUT.
* If value is not valid "Error_Other"
* is returned in status buffer and additional detail is put in
* the info buffer.
* @param status - returned null terminated string copied into this
* caller-allocated string array of length MPE_SOCKET_STATUS_SIZE
* indicating overall success of test.
* Valid values are "Success","Error_DNSServerNotResolved",
* "Error_DNSServerNotAvailable","Error_Internal","Error_Other"
* "ErrorHostNameNot-Resolved" and "Error_Timeout".
* "Success","Error_DNSServerNotResolved" and "Error_Other"
* must be supported.
* String is truncated if greater than MPE_SOCKET_STATUS_SIZE.
* @param info - returned null terminated free formatted string of length
* MPE_SOCKET_ADDITIONAL_INFO_SIZE copied into
* this caller-allocated string array that can contain
* additional information about the test.
* String is truncated if greater than
* MPE_SOCKET_ADDITIONAL_INFO_SIZE.
* @param resultAnswer - returned null terminated string of DNS answer type
* copied into this caller-allocated string array of length
* MPE_SOCKET_MAX_NSLOOKUP_ANSWER_RESULT_SIZE.
* Valid values are "None", "Authoritative" or NonAuthoritative".
* @param resultName - returned null terminated string of DNS fully qualified name of host
* copied into this caller-allocated string array of length
* MPE_SOCKET_MAX_NSLOOKUP_NAME_RESULT_SIZE.
* String is truncated if greater than MPE_SOCKET_MAX_NSLOOKUP_NAME_RESULT_SIZE.
* @param resultIPS - returned null terminated string of DNS IP addresses resolved for host
* copied into this caller-allocated string array of length
* MPE_SOCKET_MAX_NSLOOKUP_IPS_RESULT_SIZE.
* This is a comma-separated list if IP addresses returned by lookup or empty
* string if none found.
* String is truncated if greater than MPE_SOCKET_MAX_NSLOOKUP_IPS_RESULT_SIZE.
* @param resultServer - returned null terminated string of DNS Server IP address used
* copied into this caller-allocated string array of length
* MPE_SOCKET_MAX_NSLOOKUP_SERVER_RESULT_SIZE.
* String is truncated if greater than MPE_SOCKET_MAX_NSLOOKUP_IPS_RESULT_SIZE.
* @param resultTime - Response time of lookup in msec
*
* @return ::MPE_HN_ERR_NOERR If successful.
* ::MPE_HN_ERR_OS_FAILURE If problems are encountered.
**/
mpe_Error mpeos_hnNSLookup(int32_t testid, char *host, char *server, int32_t timeout, char *status, char *info, char *resultAnswer, char *resultName, char *resultIPS, char *resultServer, int *resultTime);

/**
* Cancels a Ping/Traceroute or NSLookup Test
*
* @param testid - id of test to cancel.
* @return ::MPE_HN_ERR_NOERR If successful.
* ::MPE_HN_ERR_OS_FAILURE OS-specific failures.
**/
mpe_Error mpeos_hnCancelTest(int32_t testid);

Changes to mpeos_socket.h

/**
* Minimum/Maximum values used in mpeos_hnPing/os_Ping/mpeos_hnTraceroute/os_Traceroute
* and mpeos_hnNSLookup/os_NSLookup
*
***************************************************************************************/
/**
* Additional Info string size
* See mpeos_hnPing() for more details.
**/
#define MPE_SOCKET_ADDITIONAL_INFO_SIZE 1024
/**
* Status string size
* See mpeos_hnPing() for more details.
**/
#define MPE_SOCKET_STATUS_SIZE 32
/**
* Maximum Ping result array size
* See mpeos_hnPing() for more details.
**/
#define MPE_SOCKET_MAX_PING_RESULT_SIZE 7

/**
* Minimum/Maximum Ping repetition count
* See mpeos_hnPing() for more details.
**/
#define MPE_SOCKET_PING_MIN_COUNT 1
#define MPE_SOCKET_PING_MAX_COUNT 100

/**
* Minimum/Maximum request timeout(msecs)
* See mpeos_hnPing() for more details.
**/
#define MPE_SOCKET_MIN_TIMEOUT 1000
#define MPE_SOCKET_MAX_TIMEOUT 30000

// Default for Ping since not provided by user
#define MPE_SOCKET_PING_DEFAULT_TIMEOUT 10000

/**
* Minimum/Maximum Ping request interval(msecs)
* See mpeos_hnPing() for more details.
**/

#define MPE_SOCKET_PING_MIN_INTERVAL 1000
#define MPE_SOCKET_PING_MAX_INTERVAL 30000

/**
* Minimum/Maximum data block size(bytes)
* See mpeos_hnPing() for more details.
**/

#define MPE_SOCKET_MIN_BLOCK_SIZE 20
#define MPE_SOCKET_MAX_BLOCK_SIZE 2048

/**
* Minimum/Maximum Differential Service Value
* See mpeos_hnPing(),mpe_hnTraceroute for more details.
**/
#define MPE_SOCKET_MIN_DSCP 0
#define MPE_SOCKET_MAX_DSCP 64

/**
* Maximum Traceroute result size
* See mpeos_hnTraceroute() for more details.
**/
#define MPE_SOCKET_TRACEROUTE_RESULT_SIZE 4
#define MPE_SOCKET_MAX_TRACEROUTE_HOSTS 2048

/**
* Minimum/Maximum Traceroute hops
* See mpeos_hnTraceroute() for more details.
**/

#define MPE_SOCKET_TRACEROUTE_MIN_HOPS 1
#define MPE_SOCKET_TRACEROUTE_MAX_HOPS 64

/**
* Maximum NSLookup results size
* See mpeos_hnNSLookup() for more details.
**/
#define MPE_SOCKET_MAX_NSLOOKUP_ANSWER_RESULT_SIZE 32
#define MPE_SOCKET_MAX_NSLOOKUP_NAME_RESULT_SIZE 256
#define MPE_SOCKET_MAX_NSLOOKUP_IPS_RESULT_SIZE 1024
#define MPE_SOCKET_MAX_NSLOOKUP_SERVER_RESULT_SIZE 128
#define MPE_SOCKET_MAX_NSLOOKUP_RESULT_ARRAY_SIZE 7
Posted: March 19, 2013 18:52 by mmas

implemented svn revision 41083
Posted: April 15, 2013 21:36 by smallman
The review period for the proposed MPEOS changes has ended.
Replies: 2 - Last Post: April 15, 2013 21:36
by: smallman
 
 
Close
loading
Please Confirm
Close