* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
if (sock == RPC_ANYSOCK) {
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
- perror("svcudp_create: socket creation problem");
+ perror(_("svcudp_create: socket creation problem"));
return ((SVCXPRT *)NULL);
}
madesock = TRUE;
(void)bind(sock, (struct sockaddr *)&addr, len);
}
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
- perror("svcudp_create - cannot getsockname");
+ perror(_("svcudp_create - cannot getsockname"));
if (madesock)
(void)close(sock);
return ((SVCXPRT *)NULL);
SVCXPRT *xprt;
{
- return (XPRT_IDLE);
+ return (XPRT_IDLE);
}
static bool_t
static bool_t
svcudp_reply(xprt, msg)
- register SVCXPRT *xprt;
- struct rpc_msg *msg;
+ register SVCXPRT *xprt;
+ struct rpc_msg *msg;
{
register struct svcudp_data *su = su_data(xprt);
register XDR *xdrs = &(su->su_xdrs);
(type *) mem_alloc((unsigned) (sizeof(type) * (size)))
#define BZERO(addr, type, size) \
- bzero((char *) addr, sizeof(type) * (int) (size))
+ bzero((char *) addr, sizeof(type) * (int) (size))
/*
* An entry in the cache
/*
* Next node on the list, if there is a collision
*/
- cache_ptr cache_next;
+ cache_ptr cache_next;
};
* the hashing function
*/
#define CACHE_LOC(transp, xid) \
- (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size))
+ (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size))
/*
- * Enable use of the cache.
+ * Enable use of the cache.
* Note: there is no disable.
*/
svcudp_enablecache(transp, size)
struct udp_cache *uc;
if (su->su_cache != NULL) {
- CACHE_PERROR("enablecache: cache already enabled");
- return(0);
+ CACHE_PERROR(_("enablecache: cache already enabled"));
+ return(0);
}
uc = ALLOC(struct udp_cache, 1);
if (uc == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache");
+ CACHE_PERROR(_("enablecache: could not allocate cache"));
return(0);
}
uc->uc_size = size;
uc->uc_nextvictim = 0;
uc->uc_entries = ALLOC(cache_ptr, size * SPARSENESS);
if (uc->uc_entries == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache data");
+ CACHE_PERROR(_("enablecache: could not allocate cache data"));
return(0);
}
BZERO(uc->uc_entries, cache_ptr, size * SPARSENESS);
uc->uc_fifo = ALLOC(cache_ptr, size);
if (uc->uc_fifo == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache fifo");
+ CACHE_PERROR(_("enablecache: could not allocate cache fifo"));
return(0);
}
BZERO(uc->uc_fifo, cache_ptr, size);
static
cache_set(xprt, replylen)
SVCXPRT *xprt;
- u_long replylen;
+ u_long replylen;
{
- register cache_ptr victim;
+ register cache_ptr victim;
register cache_ptr *vicp;
register struct svcudp_data *su = su_data(xprt);
struct udp_cache *uc = (struct udp_cache *) su->su_cache;
victim = uc->uc_fifo[uc->uc_nextvictim];
if (victim != NULL) {
loc = CACHE_LOC(xprt, victim->cache_xid);
- for (vicp = &uc->uc_entries[loc];
- *vicp != NULL && *vicp != victim;
- vicp = &(*vicp)->cache_next)
+ for (vicp = &uc->uc_entries[loc];
+ *vicp != NULL && *vicp != victim;
+ vicp = &(*vicp)->cache_next)
;
if (*vicp == NULL) {
- CACHE_PERROR("cache_set: victim not found");
+ CACHE_PERROR(_("cache_set: victim not found"));
return;
}
*vicp = victim->cache_next; /* remote from cache */
victim->cache_prog = uc->uc_prog;
victim->cache_addr = uc->uc_addr;
loc = CACHE_LOC(xprt, victim->cache_xid);
- victim->cache_next = uc->uc_entries[loc];
+ victim->cache_next = uc->uc_entries[loc];
uc->uc_entries[loc] = victim;
uc->uc_fifo[uc->uc_nextvictim++] = victim;
uc->uc_nextvictim %= uc->uc_size;