Go to the source code of this file.
Functions | ||||
| FILE_LICENCE (GPL2_OR_LATER) | ||||
network device name | ||||
Set up the UDP transport with network address IP address and UDP listen port, may be NULL and fields may be zero
| ||||
| struct gdb_transport * | gdbudp_configure (const char *name, struct sockaddr_in *addr) | |||
Definition in file gdbudp.h.
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| struct gdb_transport* gdbudp_configure | ( | const char * | name, | |
| struct sockaddr_in * | addr | |||
| ) | [read] |
Definition at line 206 of file gdbudp.c.
References DEFAULT_PORT, fetch_ipv4_setting(), find_netdev(), htons, 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().
00206 { 00207 struct settings *settings; 00208 00209 /* Release old network device */ 00210 netdev_put ( netdev ); 00211 00212 netdev = find_netdev ( name ); 00213 if ( !netdev ) { 00214 return NULL; 00215 } 00216 00217 /* Hold network device */ 00218 netdev_get ( netdev ); 00219 00220 /* Source UDP port */ 00221 source_addr.sin_port = ( addr && addr->sin_port ) ? addr->sin_port : htons ( DEFAULT_PORT ); 00222 00223 /* Source IP address */ 00224 if ( addr && addr->sin_addr.s_addr ) { 00225 source_addr.sin_addr.s_addr = addr->sin_addr.s_addr; 00226 } else { 00227 settings = netdev_settings ( netdev ); 00228 fetch_ipv4_setting ( settings, &ip_setting, &source_addr.sin_addr ); 00229 if ( source_addr.sin_addr.s_addr == 0 ) { 00230 netdev_put ( netdev ); 00231 netdev = NULL; 00232 return NULL; 00233 } 00234 } 00235 00236 return &udp_gdb_transport; 00237 }
1.5.7.1