eCosPro® Reference Manual
Prev |  | Next

# netbuf_fromport()

## Name

netbuf_fromport() -- Obtain the sender's port number for a netbuf

## Synopsis

``u16_t netbuf_fromport`(struct netbuf *buf);`

## Description

Returns the port number of the host the netbuf buf was received from. If the netbuf has not been received from the network, the return value of this function is undefined. The function `netbuf_fromaddr()` can be used to obtain the IP address of the remote host.

Prev | Home | Next
netbuf_fromaddr() | Up | netconn_new()