#define PROTO_H
#include "tables.h"
+#include "in.h"
struct protocol {
char *name;
+ in_port_t default_port;
int ( * load ) ( char *url,
struct sockaddr_in *server,
char *file,
*p++ = htonl(ver);
*p++ = htonl(IP_UDP);
*p++ = 0;
- if ( ! addr->sin_port ) {
- addr->sin_port = SUNRPC_PORT;
- }
for (retries = 0; retries < MAX_RPC_RETRIES; retries++) {
long timeout;
udp_transmit(addr->sin_addr.s_addr, sport, addr->sin_port,
INIT_FN ( INIT_RPC, rpc_init, nfs_reset, nfs_reset );
static struct protocol nfs_protocol __protocol = {
- "nfs", nfs
+ .name = "nfs",
+ .default_port = SUNRPC_PORT,
+ .load = nfs,
};
struct slam_info info;
/* Set the defaults */
info.server = *server;
- if ( ! info.server.sin_port )
- info.server.sin_port = SLAM_PORT;
info.multicast.sin_addr.s_addr = htonl(SLAM_MULTICAST_IP);
info.multicast.sin_port = SLAM_MULTICAST_PORT;
info.local.sin_addr.s_addr = arptable[ARP_CLIENT].ipaddr.s_addr;
}
static struct protocol slam_protocol __protocol = {
- "x-slam", url_slam
+ .name = "x-slam",
+ .default_port = SLAM_PORT,
+ .load = url_slam,
};
/* Set the defaults */
info.server = *server;
- if ( ! info.server.sin_port )
- info.server.sin_port = TFTM_PORT;
info.local.sin_addr.s_addr = arptable[ARP_CLIENT].ipaddr.s_addr;
info.local.sin_port = TFTM_PORT; /* Does not matter. */
info.multicast = info.local;
}
static struct protocol tftm_protocol __protocol = {
- "x-tftm", url_tftm
+ .name = "x-tftm",
+ .default_port = TFTM_PORT,
+ .load = url_tftm,
};
blksize = TFTP_DEFAULTSIZE_PACKET;
lport++; /* Use new local port */
server = *(request->server);
- if ( ! server.sin_port )
- server.sin_port = TFTP_PORT;
if ( !udp_transmit(server.sin_addr.s_addr, lport,
server.sin_port, xmitlen, &xmit) )
return (0);
}
struct protocol tftp_protocol __default_protocol = {
- "tftp", tftp
+ .name = "tftp",
+ .default_port = TFTP_PORT,
+ .load = tftp,
};