115 DBGC (
ping,
"PING %p reply id %#04x seq %#04x\n",
174 &
ping->peer ) ) != 0 ) {
175 DBGC (
ping,
"PING %p could not transmit: %s\n",
243 DBGC (
ping,
"PING %p could not bind: %s\n",
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
#define assert(condition)
Assert a condition at run-time.
uint8_t meta
Metadata flags.
#define __unused
Declare a variable or data structure as unused.
int ping_sock_echo
Linkage hack.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EADDRINUSE
Address already in use.
#define ENOMEM
Not enough space.
#define ENOTCONN
The socket is not connected.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
int icmp_tx_echo_request(struct io_buffer *iobuf, struct sockaddr_tcpip *st_dest)
Transmit ICMP echo request.
Transport-network layer interface.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
void intf_close(struct interface *intf, int rc)
Close an object interface.
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
#define INTF_DESC(object_type, intf, operations)
Define an object interface descriptor.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define iob_push(iobuf, len)
#define iob_disown(iobuf)
Disown an I/O buffer.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define iob_reserve(iobuf, len)
#define iob_pull(iobuf, len)
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define list_del(list)
Delete an entry from a list.
#define LIST_HEAD(list)
Declare a static list head.
#define list_add(new, head)
Add a new entry to the head of a list.
void * zalloc(size_t size)
Allocate cleared memory.
struct mschapv2_challenge peer
Peer challenge.
Network device management.
#define MAX_LL_NET_HEADER_LEN
Maximum combined length of a link-layer and network-layer header.
Data transfer interface opening.
#define __socket_opener
Register a socket opener.
static int ping_open(struct interface *xfer, struct sockaddr *peer, struct sockaddr *local)
Open a ping connection.
static struct io_buffer * ping_alloc_iob(struct ping_connection *ping __unused, size_t len)
Allocate I/O buffer for ping.
int ping_rx(struct io_buffer *iobuf, struct sockaddr_tcpip *st_src)
Process ICMP ping reply.
static int ping_port_available(int port)
Check if local port number is available.
static struct ping_connection * ping_demux(unsigned int port)
Identify ping connection by local port number.
static struct interface_operation ping_xfer_operations[]
Ping data transfer interface operations.
static struct interface_descriptor ping_xfer_desc
Ping data transfer interface descriptor.
static int ping_deliver(struct ping_connection *ping, struct io_buffer *iobuf, struct xfer_metadata *meta)
Deliver datagram as I/O buffer.
static void ping_close(struct ping_connection *ping, int rc)
Close ping connection.
int ping(const char *hostname, unsigned long timeout, size_t len, unsigned int count, int quiet)
Ping a host.
#define ref_put(refcnt)
Drop reference to object.
#define ref_init(refcnt, free)
Initialise a reference counter.
char * strerror(int errno)
Retrieve string representation of error number.
An ICMP echo request/reply.
An object interface descriptor.
An object interface operation.
void * data
Start of data.
A doubly-linked list entry (or list head)
struct sockaddr_tcpip peer
Remote socket address.
uint16_t port
Local port number.
struct interface xfer
Data transfer interface.
struct list_head list
List of ping connections.
struct refcnt refcnt
Reference counter.
Generalized socket address structure.
int tcpip_bind(struct sockaddr_tcpip *st_local, int(*available)(int port))
Bind to local TCP/IP port.
int xfer_deliver(struct interface *intf, struct io_buffer *iobuf, struct xfer_metadata *meta)
Deliver datagram.
struct io_buffer * xfer_alloc_iob(struct interface *intf, size_t len)
Allocate I/O buffer.
Data transfer interfaces.
#define XFER_FL_ABS_OFFSET
Offset is absolute.