rename osockaddr to talkd_sockaddr and use that instead.

This commit is contained in:
christos 2005-09-24 16:40:01 +00:00
parent 86497ecc9f
commit c4445bc71c
3 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: talkd.h,v 1.8 2003/08/07 09:44:13 agc Exp $ */
/* $NetBSD: talkd.h,v 1.9 2005/09/24 16:40:01 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -52,6 +52,14 @@
* stream connection through which the conversation takes place.
*/
/*
* 4.3 compat sockaddr
*/
struct talkd_sockaddr {
u_int16_t sa_family; /* address family */
char sa_data[14]; /* up to 14 bytes of direct address */
};
/*
* Client->server request message format.
*/
@ -61,8 +69,8 @@ typedef struct {
u_char answer; /* not used */
u_char pad;
u_int32_t id_num; /* message id */
struct osockaddr addr; /* old (4.3) style */
struct osockaddr ctl_addr; /* old (4.3) style */
struct talkd_sockaddr addr; /* old (4.3) style */
struct talkd_sockaddr ctl_addr;/* old (4.3) style */
int32_t pid; /* caller's process id */
#define NAME_SIZE 12
char l_name[NAME_SIZE]; /* caller's name */
@ -80,7 +88,7 @@ typedef struct {
u_char answer; /* respose to request message, see below */
u_char pad;
u_int32_t id_num; /* message id */
struct osockaddr addr; /* address for establishing conversation */
struct talkd_sockaddr addr; /* address for establishing conversation */
} CTL_RESPONSE;
#define TALK_VERSION 1 /* protocol version */

View File

@ -1,4 +1,4 @@
/* $NetBSD: invite.c,v 1.6 2003/08/07 11:16:04 agc Exp $ */
/* $NetBSD: invite.c,v 1.7 2005/09/24 16:40:01 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)invite.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: invite.c,v 1.6 2003/08/07 11:16:04 agc Exp $");
__RCSID("$NetBSD: invite.c,v 1.7 2005/09/24 16:40:01 christos Exp $");
#endif /* not lint */
#include "talk.h"
@ -74,7 +74,7 @@ invite_remote()
p_error("Error on attempt to listen for caller");
#ifdef MSG_EOR
/* copy new style sockaddr to old, swap family (short in old) */
msg.addr = *(struct osockaddr *)&my_addr; /* XXX new to old style*/
msg.addr = *(struct talkd_sockaddr *)(void *)&my_addr;
msg.addr.sa_family = htons(my_addr.sin_family);
#else
msg.addr = *(struct sockaddr *)&my_addr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: look_up.c,v 1.6 2003/08/07 11:16:05 agc Exp $ */
/* $NetBSD: look_up.c,v 1.7 2005/09/24 16:40:01 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)look_up.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: look_up.c,v 1.6 2003/08/07 11:16:05 agc Exp $");
__RCSID("$NetBSD: look_up.c,v 1.7 2005/09/24 16:40:01 christos Exp $");
#endif /* not lint */
#include "talk.h"
@ -55,7 +55,7 @@ check_local()
/* the rest of msg was set up in get_names */
#ifdef MSG_EOR
/* copy new style sockaddr to old, swap family (short in old) */
msg.ctl_addr = *(struct osockaddr *)&ctl_addr;
msg.ctl_addr = *(struct talkd_sockaddr *)(void *)&ctl_addr;
msg.ctl_addr.sa_family = htons(ctl_addr.sin_family);
#else
msg.ctl_addr = *(struct sockaddr *)&ctl_addr;