#ifndef KPI_SOCKET_H
#define KPI_SOCKET_H

#include <sys/types.h>

#ifndef   SYS_KERNELTYPES_H
#include <sys/kernel_types.h>
#endif

#include <sys/socket.h>
//#include <sys/oc_socket.h>
#include <netinet/in.h>//hys

/*sock_getsockname

errno_t sock_getsockname(
    socket_t so,
    struct sockaddr *sockname,
    int socknamelen);  
Parameters
so
The socket.
sockname
Storage for the local name.
socknamelen
Length of storage for the socket name.
Return Value

0 on success otherwise the errno error. 
Discussion 

Retrieves the local address of a socket. See 'man 2 getsockname'.*/
errno_t sock_getsockname(
    socket_t so,
    struct sockaddr *sockname,
    int socknamelen);  

#endif