rpcb_clnt.c (6eac7d3f45a2519283d38bf670cb6968230124f8) rpcb_clnt.c (a613fa168afc19179a7547fbba45644c5b6912bf)
1/*
2 * In-kernel rpcbind client supporting versions 2, 3, and 4 of the rpcbind
3 * protocol
4 *
5 * Based on RFC 1833: "Binding Protocols for ONC RPC Version 2" and
6 * RFC 3530: "Network File System (NFS) version 4 Protocol"
7 *
8 * Original: Gilles Quillard, Bull Open Source, 2005 <gilles.quillard@bull.net>

--- 98 unchanged lines hidden (view full) ---

107/*
108 * Note that RFC 1833 does not put any size restrictions on the
109 * address string returned by the remote rpcbind database.
110 */
111#define RPCB_getaddrres_sz RPCB_addr_sz
112
113static void rpcb_getport_done(struct rpc_task *, void *);
114static void rpcb_map_release(void *data);
1/*
2 * In-kernel rpcbind client supporting versions 2, 3, and 4 of the rpcbind
3 * protocol
4 *
5 * Based on RFC 1833: "Binding Protocols for ONC RPC Version 2" and
6 * RFC 3530: "Network File System (NFS) version 4 Protocol"
7 *
8 * Original: Gilles Quillard, Bull Open Source, 2005 <gilles.quillard@bull.net>

--- 98 unchanged lines hidden (view full) ---

107/*
108 * Note that RFC 1833 does not put any size restrictions on the
109 * address string returned by the remote rpcbind database.
110 */
111#define RPCB_getaddrres_sz RPCB_addr_sz
112
113static void rpcb_getport_done(struct rpc_task *, void *);
114static void rpcb_map_release(void *data);
115static struct rpc_program rpcb_program;
115static const struct rpc_program rpcb_program;
116
117struct rpcbind_args {
118 struct rpc_xprt * r_xprt;
119
120 u32 r_prog;
121 u32 r_vers;
122 u32 r_prot;
123 unsigned short r_port;

--- 8 unchanged lines hidden (view full) ---

132static struct rpc_procinfo rpcb_procedures3[];
133static struct rpc_procinfo rpcb_procedures4[];
134
135struct rpcb_info {
136 u32 rpc_vers;
137 struct rpc_procinfo * rpc_proc;
138};
139
116
117struct rpcbind_args {
118 struct rpc_xprt * r_xprt;
119
120 u32 r_prog;
121 u32 r_vers;
122 u32 r_prot;
123 unsigned short r_port;

--- 8 unchanged lines hidden (view full) ---

132static struct rpc_procinfo rpcb_procedures3[];
133static struct rpc_procinfo rpcb_procedures4[];
134
135struct rpcb_info {
136 u32 rpc_vers;
137 struct rpc_procinfo * rpc_proc;
138};
139
140static struct rpcb_info rpcb_next_version[];
141static struct rpcb_info rpcb_next_version6[];
140static const struct rpcb_info rpcb_next_version[];
141static const struct rpcb_info rpcb_next_version6[];
142
143static const struct rpc_call_ops rpcb_getport_ops = {
144 .rpc_call_done = rpcb_getport_done,
145 .rpc_release = rpcb_map_release,
146};
147
148static void rpcb_wake_rpcbind_waiters(struct rpc_xprt *xprt, int status)
149{

--- 896 unchanged lines hidden (view full) ---

1046 .p_arglen = RPCB_getaddrargs_sz,
1047 .p_replen = RPCB_getaddrres_sz,
1048 .p_statidx = RPCBPROC_GETADDR,
1049 .p_timer = 0,
1050 .p_name = "GETADDR",
1051 },
1052};
1053
142
143static const struct rpc_call_ops rpcb_getport_ops = {
144 .rpc_call_done = rpcb_getport_done,
145 .rpc_release = rpcb_map_release,
146};
147
148static void rpcb_wake_rpcbind_waiters(struct rpc_xprt *xprt, int status)
149{

--- 896 unchanged lines hidden (view full) ---

1046 .p_arglen = RPCB_getaddrargs_sz,
1047 .p_replen = RPCB_getaddrres_sz,
1048 .p_statidx = RPCBPROC_GETADDR,
1049 .p_timer = 0,
1050 .p_name = "GETADDR",
1051 },
1052};
1053
1054static struct rpcb_info rpcb_next_version[] = {
1054static const struct rpcb_info rpcb_next_version[] = {
1055 {
1056 .rpc_vers = RPCBVERS_2,
1057 .rpc_proc = &rpcb_procedures2[RPCBPROC_GETPORT],
1058 },
1059 {
1060 .rpc_proc = NULL,
1061 },
1062};
1063
1055 {
1056 .rpc_vers = RPCBVERS_2,
1057 .rpc_proc = &rpcb_procedures2[RPCBPROC_GETPORT],
1058 },
1059 {
1060 .rpc_proc = NULL,
1061 },
1062};
1063
1064static struct rpcb_info rpcb_next_version6[] = {
1064static const struct rpcb_info rpcb_next_version6[] = {
1065 {
1066 .rpc_vers = RPCBVERS_4,
1067 .rpc_proc = &rpcb_procedures4[RPCBPROC_GETADDR],
1068 },
1069 {
1070 .rpc_vers = RPCBVERS_3,
1071 .rpc_proc = &rpcb_procedures3[RPCBPROC_GETADDR],
1072 },
1073 {
1074 .rpc_proc = NULL,
1075 },
1076};
1077
1065 {
1066 .rpc_vers = RPCBVERS_4,
1067 .rpc_proc = &rpcb_procedures4[RPCBPROC_GETADDR],
1068 },
1069 {
1070 .rpc_vers = RPCBVERS_3,
1071 .rpc_proc = &rpcb_procedures3[RPCBPROC_GETADDR],
1072 },
1073 {
1074 .rpc_proc = NULL,
1075 },
1076};
1077
1078static struct rpc_version rpcb_version2 = {
1078static const struct rpc_version rpcb_version2 = {
1079 .number = RPCBVERS_2,
1080 .nrprocs = ARRAY_SIZE(rpcb_procedures2),
1081 .procs = rpcb_procedures2
1082};
1083
1079 .number = RPCBVERS_2,
1080 .nrprocs = ARRAY_SIZE(rpcb_procedures2),
1081 .procs = rpcb_procedures2
1082};
1083
1084static struct rpc_version rpcb_version3 = {
1084static const struct rpc_version rpcb_version3 = {
1085 .number = RPCBVERS_3,
1086 .nrprocs = ARRAY_SIZE(rpcb_procedures3),
1087 .procs = rpcb_procedures3
1088};
1089
1085 .number = RPCBVERS_3,
1086 .nrprocs = ARRAY_SIZE(rpcb_procedures3),
1087 .procs = rpcb_procedures3
1088};
1089
1090static struct rpc_version rpcb_version4 = {
1090static const struct rpc_version rpcb_version4 = {
1091 .number = RPCBVERS_4,
1092 .nrprocs = ARRAY_SIZE(rpcb_procedures4),
1093 .procs = rpcb_procedures4
1094};
1095
1091 .number = RPCBVERS_4,
1092 .nrprocs = ARRAY_SIZE(rpcb_procedures4),
1093 .procs = rpcb_procedures4
1094};
1095
1096static struct rpc_version *rpcb_version[] = {
1096static const struct rpc_version *rpcb_version[] = {
1097 NULL,
1098 NULL,
1099 &rpcb_version2,
1100 &rpcb_version3,
1101 &rpcb_version4
1102};
1103
1104static struct rpc_stat rpcb_stats;
1105
1097 NULL,
1098 NULL,
1099 &rpcb_version2,
1100 &rpcb_version3,
1101 &rpcb_version4
1102};
1103
1104static struct rpc_stat rpcb_stats;
1105
1106static struct rpc_program rpcb_program = {
1106static const struct rpc_program rpcb_program = {
1107 .name = "rpcbind",
1108 .number = RPCBIND_PROGRAM,
1109 .nrvers = ARRAY_SIZE(rpcb_version),
1110 .version = rpcb_version,
1111 .stats = &rpcb_stats,
1112};
1107 .name = "rpcbind",
1108 .number = RPCBIND_PROGRAM,
1109 .nrvers = ARRAY_SIZE(rpcb_version),
1110 .version = rpcb_version,
1111 .stats = &rpcb_stats,
1112};