iPXE
Functions
gdbudp.h File Reference

GDB remote debugging over UDP. More...

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
 FILE_SECBOOT (FORBIDDEN)
 
network device name

Set up the UDP transport with network address

@addr IP address and UDP listen port, may be NULL and fields may be zero

Return values
transportsuitable for starting the GDB stub or NULL on error
struct gdb_transportgdbudp_configure (const char *name, struct sockaddr_in *addr)
 

Detailed Description

GDB remote debugging over UDP.

Definition in file gdbudp.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN  )

◆ gdbudp_configure()

struct gdb_transport* gdbudp_configure ( const char *  name,
struct sockaddr_in addr 
)

Definition at line 214 of file gdbudp.c.

214  {
215  struct settings *settings;
216 
217  /* Release old network device */
218  netdev_put ( netdev );
219 
220  netdev = find_netdev ( name );
221  if ( !netdev ) {
222  return NULL;
223  }
224 
225  /* Hold network device */
226  netdev_get ( netdev );
227 
228  /* Source UDP port */
229  source_addr.sin_port = ( addr && addr->sin_port ) ? addr->sin_port : htons ( DEFAULT_PORT );
230 
231  /* Source IP address */
232  if ( addr && addr->sin_addr.s_addr ) {
233  source_addr.sin_addr.s_addr = addr->sin_addr.s_addr;
234  } else {
237  if ( source_addr.sin_addr.s_addr == 0 ) {
238  netdev_put ( netdev );
239  netdev = NULL;
240  return NULL;
241  }
242  }
243 
244  return &udp_gdb_transport;
245 }
const char * name
Definition: ath9k_hw.c:1986
int fetch_ipv4_setting(struct settings *settings, const struct setting *setting, struct in_addr *inp)
Fetch value of IPv4 address setting.
Definition: settings.c:913
const struct setting ip_setting
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
Definition: netdevice.h:587
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
Definition: netdevice.h:576
static struct net_device * netdev
Definition: gdbudp.c:53
uint16_t sin_port
TCP/IP port (part of struct sockaddr_tcpip)
Definition: in.h:94
uint32_t addr
Buffer address.
Definition: dwmac.h:20
A settings block.
Definition: settings.h:133
static struct net_device * netdev_get(struct net_device *netdev)
Get reference to network device.
Definition: netdevice.h:565
static struct sockaddr_in source_addr
Definition: gdbudp.c:56
uint32_t s_addr
Definition: in.h:43
struct in_addr sin_addr
IPv4 address.
Definition: in.h:101
struct net_device * find_netdev(const char *name)
Get network device by name.
Definition: netdevice.c:989
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322
#define htons(value)
Definition: byteswap.h:136

References addr, DEFAULT_PORT, fetch_ipv4_setting(), find_netdev(), htons, ip_setting, name, netdev, netdev_get(), netdev_put(), netdev_settings(), NULL, in_addr::s_addr, sockaddr_in::sin_addr, sockaddr_in::sin_port, and source_addr.

Referenced by gdbudp_init().