Use struct initializers. No functional change.

This commit is contained in:
elad 2007-12-07 18:49:35 +00:00
parent a0b97864fc
commit 5551af680e
1 changed files with 106 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: iso_proto.c,v 1.25 2007/08/30 02:17:38 dyoung Exp $ */
/* $NetBSD: iso_proto.c,v 1.26 2007/12/07 18:49:35 elad Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -65,7 +65,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iso_proto.c,v 1.25 2007/08/30 02:17:38 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: iso_proto.c,v 1.26 2007/12/07 18:49:35 elad Exp $");
#include <sys/param.h>
@ -106,10 +106,19 @@ const struct protosw isosw[] = {
* pffindtype, which gets the first entry that matches the type.
* sigh.
*/
{SOCK_DGRAM, &isodomain, ISOPROTO_CLTP, PR_ATOMIC | PR_ADDR,
0, cltp_output, 0, 0,
cltp_usrreq,
cltp_init, 0, 0, 0
{ .pr_type = SOCK_DGRAM,
.pr_domain = &isodomain,
.pr_protocol = ISOPROTO_CLTP,
.pr_flags = PR_ATOMIC | PR_ADDR,
.pr_input = 0,
.pr_output = cltp_output,
.pr_ctlinput = 0,
.pr_ctloutput = 0,
.pr_usrreq = cltp_usrreq,
.pr_init = cltp_init,
.pr_fasttimo = 0,
.pr_slowtimo = 0,
.pr_drain = 0
},
/*
@ -120,53 +129,116 @@ const struct protosw isosw[] = {
* New way: let pffindproto work (for x.25, thank you) but create
* a clnp_usrreq() that returns error on PRU_ATTACH.
*/
{SOCK_DGRAM, &isodomain, ISOPROTO_CLNP, 0,
0, clnp_output, 0, 0,
clnp_usrreq,
clnp_init, 0, clnp_slowtimo, clnp_drain,
{ .pr_type = SOCK_DGRAM,
.pr_domain = &isodomain,
.pr_protocol = ISOPROTO_CLNP,
.pr_flags = 0,
.pr_input = 0,
.pr_output = clnp_output,
.pr_ctlinput = 0,
.pr_ctloutput = 0,
.pr_usrreq = clnp_usrreq,
.pr_init = clnp_init,
.pr_fasttimo = 0,
.pr_slowtimo = clnp_slowtimo,
.pr_drain = clnp_drain,
},
/* raw clnp */
{SOCK_RAW, &isodomain, ISOPROTO_RAW, PR_ATOMIC | PR_ADDR,
rclnp_input, rclnp_output, 0, rclnp_ctloutput,
clnp_usrreq,
0, 0, 0, 0
{ .pr_type = SOCK_RAW,
.pr_domain = &isodomain,
.pr_protocol = ISOPROTO_RAW,
.pr_flags = PR_ATOMIC | PR_ADDR,
.pr_input = rclnp_input,
.pr_output = rclnp_output,
.pr_ctlinput = 0,
.pr_ctloutput = rclnp_ctloutput,
.pr_usrreq = clnp_usrreq,
.pr_init = 0,
.pr_fasttimo = 0,
.pr_slowtimo = 0,
.pr_drain = 0
},
/* ES-IS protocol */
{SOCK_DGRAM, &isodomain, ISOPROTO_ESIS, PR_ATOMIC | PR_ADDR,
esis_input, 0, esis_ctlinput, 0,
esis_usrreq,
esis_init, 0, 0, 0
{ .pr_type = SOCK_DGRAM,
.pr_domain = &isodomain,
.pr_protocol = ISOPROTO_ESIS,
.pr_flags = PR_ATOMIC | PR_ADDR,
.pr_input = esis_input,
.pr_output = 0,
.pr_ctlinput = esis_ctlinput,
.pr_ctloutput = 0,
.pr_usrreq = esis_usrreq,
.pr_init = esis_init,
.pr_fasttimo = 0,
.pr_slowtimo = 0,
.pr_drain = 0
},
/* ISOPROTO_INTRAISIS */
{SOCK_DGRAM, &isodomain, ISOPROTO_INTRAISIS, PR_ATOMIC | PR_ADDR,
isis_input, 0, 0, 0,
esis_usrreq,
0, 0, 0, 0
{ .pr_type = SOCK_DGRAM,
.pr_domain = &isodomain,
.pr_protocol = ISOPROTO_INTRAISIS,
.pr_flags = PR_ATOMIC | PR_ADDR,
.pr_input = isis_input,
.pr_output = 0,
.pr_ctlinput = 0,
.pr_ctloutput = 0,
.pr_usrreq = esis_usrreq,
.pr_init = 0,
.pr_fasttimo = 0,
.pr_slowtimo = 0,
.pr_drain = 0
},
/* ISOPROTO_IDRP */
{SOCK_DGRAM, &isodomain, ISOPROTO_IDRP, PR_ATOMIC | PR_ADDR,
idrp_input, 0, 0, 0,
idrp_usrreq,
idrp_init, 0, 0, 0
{ .pr_type = SOCK_DGRAM,
.pr_domain = &isodomain,
.pr_protocol = ISOPROTO_IDRP,
.pr_flags = PR_ATOMIC | PR_ADDR,
.pr_input = idrp_input,
.pr_output = 0,
.pr_ctlinput = 0,
.pr_ctloutput = 0,
.pr_usrreq = idrp_usrreq,
.pr_init = idrp_init,
.pr_fasttimo = 0,
.pr_slowtimo = 0,
.pr_drain = 0
},
/* ISOPROTO_TP */
{SOCK_SEQPACKET, &isodomain, ISOPROTO_TP, PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN | PR_ABRTACPTDIS,
tpclnp_input, 0, tpclnp_ctlinput, tp_ctloutput,
tp_usrreq,
tp_init, tp_fasttimo, tp_slowtimo, tp_drain,
{ .pr_type = SOCK_SEQPACKET,
.pr_domain = &isodomain,
.pr_protocol = ISOPROTO_TP,
.pr_flags = PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN | PR_ABRTACPTDIS,
.pr_input = tpclnp_input,
.pr_output = 0,
.pr_ctlinput = tpclnp_ctlinput,
.pr_ctloutput = tp_ctloutput,
.pr_usrreq = tp_usrreq,
.pr_init = tp_init,
.pr_fasttimo = tp_fasttimo,
.pr_slowtimo = tp_slowtimo,
.pr_drain = tp_drain,
},
#ifdef TPCONS
/* ISOPROTO_TP */
{SOCK_SEQPACKET, &isodomain, ISOPROTO_TP0, PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN | PR_ABRTACPTDIS,
tpcons_input, 0, 0, tp_ctloutput,
tp_usrreq,
cons_init, 0, 0, 0,
{ .pr_type = SOCK_SEQPACKET,
.pr_domain = &isodomain,
.pr_protocol = ISOPROTO_TP0,
.pr_flags = PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN | PR_ABRTACPTDIS,
.pr_input = tpcons_input,
.pr_output = 0,
.pr_ctlinput = 0,
.pr_ctloutput = tp_ctloutput,
.pr_usrreq = tp_usrreq,
.pr_init = cons_init,
.pr_fasttimo = 0,
.pr_slowtimo = 0,
.pr_drain = 0,
},
#endif
};