Do all the work of registering an ONC RPC-based protocol in rpc_init_prog().

Hand it a table of version/procedure table/hf-for-program-number
triplets.

Change-Id: I2acc03c2da83353165bd422d8537362201c814e2
Reviewed-on: https://code.wireshark.org/review/9740
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2015-07-21 12:37:11 -07:00
parent f38d976cbe
commit 868cd67915
35 changed files with 339 additions and 235 deletions

View File

@ -138,7 +138,6 @@ static const vsff bootparams1_proc[] = {
dissect_getfile_call, dissect_getfile_reply },
{ 0, NULL, NULL, NULL }
};
/* end of Bootparams version 1 */
static const value_string bootparams1_proc_vals[] = {
{ BOOTPARAMSPROC_NULL, "NULL" },
@ -146,6 +145,11 @@ static const value_string bootparams1_proc_vals[] = {
{ BOOTPARAMSPROC_GETFILE, "GETFILE" },
{ 0, NULL }
};
/* end of Bootparams version 1 */
static const rpc_prog_vers_info bootparams_vers_info[] = {
{ 1, bootparams1_proc, &hf_bootparams_procedure_v1 },
};
void
proto_register_bootparams(void)
@ -190,9 +194,8 @@ void
proto_reg_handoff_bootparams(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_bootparams, BOOTPARAMS_PROGRAM, ett_bootparams);
/* Register the procedure tables */
rpc_init_proc_table(proto_bootparams, BOOTPARAMS_PROGRAM, 1, bootparams1_proc, hf_bootparams_procedure_v1);
rpc_init_prog(proto_bootparams, BOOTPARAMS_PROGRAM, ett_bootparams,
G_N_ELEMENTS(bootparams_vers_info), bootparams_vers_info);
}
/*

View File

@ -48,6 +48,10 @@ static const value_string clearcase3_proc_vals[] = {
};
/* end of Clearcase version 3 */
static const rpc_prog_vers_info clearcase_vers_info[] = {
{ 3, clearcase3_proc, &hf_clearcase_procedure_v3 }
};
void
proto_register_clearcase(void)
{
@ -71,9 +75,8 @@ void
proto_reg_handoff_clearcase(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_clearcase, CLEARCASE_PROGRAM, ett_clearcase);
/* Register the procedure tables */
rpc_init_proc_table(proto_clearcase, CLEARCASE_PROGRAM, 3, clearcase3_proc, hf_clearcase_procedure_v3);
rpc_init_prog(proto_clearcase, CLEARCASE_PROGRAM, ett_clearcase,
G_N_ELEMENTS(clearcase_vers_info), clearcase_vers_info);
}
/*

View File

@ -1777,6 +1777,11 @@ static const vsff fmp3_proc[] = {
};
static const rpc_prog_vers_info fmp_vers_info[] = {
{ FMP_VERSION_3, fmp3_proc, &hf_fmp_procedure }
};
static const value_string fmp_proc_vals[] = {
{ 0, "NULL" },
{ 1, "SessionCreate" },
@ -2296,10 +2301,8 @@ void
proto_reg_handoff_fmp(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_fmp, FMP_PROGRAM, ett_fmp);
/* Register the procedure tables */
rpc_init_proc_table(proto_fmp, FMP_PROGRAM, FMP_VERSION_3, fmp3_proc, hf_fmp_procedure);
rpc_init_prog(proto_fmp, FMP_PROGRAM, ett_fmp,
G_N_ELEMENTS(fmp_vers_info), fmp_vers_info);
}
/*

View File

@ -402,6 +402,10 @@ static const vsff fmp_notify2_proc[] = {
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info fmp_notify_vers_info[] = {
{ FMP_NOTIFY_VERSION_2, fmp_notify2_proc, &hf_fmp_notify_procedure }
};
static const value_string fmp_notify_proc_vals[] = {
{ 0, "NULL" },
{ 1, "DownGrade" },
@ -610,11 +614,8 @@ void
proto_reg_handoff_fmp_notify(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_fmp_notify, FMP_NOTIFY_PROG, ett_fmp_notify);
/* Register the procedure tables */
rpc_init_proc_table(proto_fmp_notify, FMP_NOTIFY_PROG, FMP_NOTIFY_VERSION_2,
fmp_notify2_proc,hf_fmp_notify_procedure);
rpc_init_prog(proto_fmp_notify, FMP_NOTIFY_PROG, ett_fmp_notify,
G_N_ELEMENTS(fmp_notify_vers_info), fmp_notify_vers_info);
}
/*

View File

@ -393,6 +393,12 @@ static const vsff gluster_cli_2_proc[] = {
};
static const rpc_prog_vers_info gluster_cli_vers_info[] = {
{ 1, gluster_cli_proc, &hf_gluster_cli_proc },
{ 2, gluster_cli_2_proc, &hf_gluster_cli_2_proc }
};
static const value_string gluster_cli_proc_vals[] = {
{ GLUSTER_CLI_NULL, "NULL" },
{ GLUSTER_CLI_PROBE, "PROBE" },
@ -546,11 +552,8 @@ proto_register_gluster_cli(void)
void
proto_reg_handoff_gluster_cli(void)
{
rpc_init_prog(proto_gluster_cli, GLUSTER_CLI_PROGRAM, ett_gluster_cli);
rpc_init_proc_table(proto_gluster_cli, GLUSTER_CLI_PROGRAM, 1, gluster_cli_proc,
hf_gluster_cli_proc);
rpc_init_proc_table(proto_gluster_cli, GLUSTER_CLI_PROGRAM, 2, gluster_cli_2_proc,
hf_gluster_cli_2_proc);
rpc_init_prog(proto_gluster_cli, GLUSTER_CLI_PROGRAM, ett_gluster_cli,
G_N_ELEMENTS(gluster_cli_vers_info), gluster_cli_vers_info);
}
/*

View File

@ -163,6 +163,9 @@ static const value_string gluster_pmap_proc_vals[] = {
{ GF_PMAP_SIGNUP, "SIGNUP" },
{ 0, NULL }
};
static const rpc_prog_vers_info gluster_pmap_vers_info[] = {
{ 1, gluster_pmap_proc, &hf_gluster_pmap_proc }
};
/* procedures for GLUSTER_DUMP_PROGRAM */
static const vsff gluster_dump_proc[] = {
@ -175,6 +178,9 @@ static const value_string gluster_dump_proc_vals[] = {
{ GF_DUMP_DUMP, "DUMP" },
{ 0, NULL }
};
static const rpc_prog_vers_info gluster_dump_vers_info[] = {
{ 1, gluster_dump_proc, &hf_gluster_dump_proc }
};
void
proto_register_gluster_pmap(void)
@ -216,9 +222,8 @@ void
proto_reg_handoff_gluster_pmap(void)
{
rpc_init_prog(proto_gluster_pmap, GLUSTER_PMAP_PROGRAM,
ett_gluster_pmap);
rpc_init_proc_table(proto_gluster_pmap, GLUSTER_PMAP_PROGRAM, 1, gluster_pmap_proc,
hf_gluster_pmap_proc);
ett_gluster_pmap,
G_N_ELEMENTS(gluster_pmap_vers_info), gluster_pmap_vers_info);
}
void
@ -266,9 +271,8 @@ void
proto_reg_handoff_gluster_dump(void)
{
rpc_init_prog(proto_gluster_dump, GLUSTER_DUMP_PROGRAM,
ett_gluster_dump);
rpc_init_proc_table(proto_gluster_dump, GLUSTER_DUMP_PROGRAM, 1, gluster_dump_proc,
hf_gluster_dump_proc);
ett_gluster_dump,
G_N_ELEMENTS(gluster_dump_vers_info), gluster_dump_vers_info);
}
/*

View File

@ -616,6 +616,12 @@ static const vsff gd_mgmt_3_proc[] = {
{ 0, NULL, NULL, NULL}
};
static const rpc_prog_vers_info glusterd_mgmt_vers_info[] = {
{ 1, gd_mgmt_proc, &hf_gd_mgmt_proc },
{ 2, gd_mgmt_2_proc, &hf_gd_mgmt_2_proc },
{ 3, gd_mgmt_3_proc, &hf_gd_mgmt_3_proc }
};
static const vsff gd_mgmt_brick_2_proc[] = {
{
GLUSTERD_2_BRICK_NULL, "NULL",
@ -656,6 +662,10 @@ static const vsff gd_mgmt_brick_2_proc[] = {
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info gd_mgmt_brick_vers_info[] = {
{ 2, gd_mgmt_brick_2_proc, &hf_gd_mgmt_brick_2_proc },
};
static const vsff glusterd_friend_proc[] = {
{ GLUSTERD_FRIEND_NULL, "NULL" , dissect_rpc_void , dissect_rpc_void },
{ GLUSTERD_PROBE_QUERY, "PROBE_QUERY" , dissect_rpc_unknown , dissect_rpc_unknown },
@ -665,6 +675,10 @@ static const vsff glusterd_friend_proc[] = {
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info glusterd_friend_vers_info[] = {
{ 2, glusterd_friend_proc, &hf_glusterd_friend_proc },
};
static const value_string gd_mgmt_proc_vals[] = {
{ GD_MGMT_NULL, "NULL" },
{ GD_MGMT_PROBE_QUERY, "PROBE_QUERY" },
@ -885,19 +899,14 @@ proto_register_gluster_gd_mgmt(void)
void
proto_reg_handoff_gluster_gd_mgmt(void)
{
rpc_init_prog(proto_gd_mgmt, GD_MGMT_PROGRAM, ett_gd_mgmt);
rpc_init_proc_table(proto_gd_mgmt, GD_MGMT_PROGRAM, 1, gd_mgmt_proc, hf_gd_mgmt_proc);
rpc_init_proc_table(proto_gd_mgmt, GD_MGMT_PROGRAM, 2, gd_mgmt_2_proc,
hf_gd_mgmt_2_proc);
rpc_init_proc_table(proto_gd_mgmt, GD_MGMT_PROGRAM, 3, gd_mgmt_3_proc,
hf_gd_mgmt_3_proc);
rpc_init_prog(proto_gd_mgmt, GD_MGMT_PROGRAM, ett_gd_mgmt,
G_N_ELEMENTS(glusterd_mgmt_vers_info), glusterd_mgmt_vers_info);
rpc_init_prog(proto_gd_brick, GD_BRICK_PROGRAM, ett_gd_brick);
rpc_init_proc_table(proto_gd_brick, GD_BRICK_PROGRAM, 2, gd_mgmt_brick_2_proc,
hf_gd_mgmt_brick_2_proc);
rpc_init_prog(proto_gd_friend, GD_FRIEND_PROGRAM, ett_gd_friend);
rpc_init_proc_table(proto_gd_friend, GD_FRIEND_PROGRAM, 2,glusterd_friend_proc,
hf_glusterd_friend_proc);
rpc_init_prog(proto_gd_brick, GD_BRICK_PROGRAM, ett_gd_brick,
G_N_ELEMENTS(gd_mgmt_brick_vers_info), gd_mgmt_brick_vers_info);
rpc_init_prog(proto_gd_friend, GD_FRIEND_PROGRAM, ett_gd_friend,
G_N_ELEMENTS(glusterd_friend_vers_info), glusterd_friend_vers_info);
}
/*

View File

@ -2164,6 +2164,12 @@ static const vsff glusterfs3_3_fop_proc[] = {
};
static const rpc_prog_vers_info glusterfs_vers_info[] = {
{ 310, glusterfs3_1_fop_proc, &hf_glusterfs_proc },
{ 330, glusterfs3_3_fop_proc, &hf_glusterfs_proc },
};
static const value_string glusterfs3_1_fop_proc_vals[] = {
{ GFS3_OP_NULL, "NULL" },
{ GFS3_OP_STAT, "STAT" },
@ -2860,12 +2866,8 @@ proto_register_glusterfs(void)
void
proto_reg_handoff_glusterfs(void)
{
rpc_init_prog(proto_glusterfs, GLUSTER3_1_FOP_PROGRAM, ett_glusterfs);
rpc_init_proc_table(proto_glusterfs, GLUSTER3_1_FOP_PROGRAM, 310, glusterfs3_1_fop_proc,
hf_glusterfs_proc);
rpc_init_proc_table(proto_glusterfs, GLUSTER3_1_FOP_PROGRAM, 330, glusterfs3_3_fop_proc,
hf_glusterfs_proc);
rpc_init_prog(proto_glusterfs, GLUSTER3_1_FOP_PROGRAM, ett_glusterfs,
G_N_ELEMENTS(glusterfs_vers_info), glusterfs_vers_info);
}
/*

View File

@ -230,6 +230,12 @@ static const vsff gluster_hndsk_2_proc[] = {
};
static const rpc_prog_vers_info gluster_hndsk_vers_info[] = {
{ 1, gluster_hndsk_proc, &hf_gluster_hndsk_proc },
{ 2, gluster_hndsk_2_proc, &hf_gluster_hndsk_proc },
};
static const value_string gluster_hndsk_proc_vals[] = {
{ GF_HNDSK_NULL, "NULL" },
{ GF_HNDSK_SETVOLUME, "DUMP" },
@ -301,11 +307,8 @@ void
proto_reg_handoff_gluster_hndsk(void)
{
rpc_init_prog(proto_gluster_hndsk, GLUSTER_HNDSK_PROGRAM,
ett_gluster_hndsk);
rpc_init_proc_table(proto_gluster_hndsk, GLUSTER_HNDSK_PROGRAM, 1, gluster_hndsk_proc,
hf_gluster_hndsk_proc);
rpc_init_proc_table(proto_gluster_hndsk, GLUSTER_HNDSK_PROGRAM, 2, gluster_hndsk_2_proc,
hf_gluster_hndsk_proc);
ett_gluster_hndsk,
G_N_ELEMENTS(gluster_hndsk_vers_info), gluster_hndsk_vers_info);
}
/* Legacy GlusterFS Callback procedures, they don't contain any data. */
@ -315,6 +318,9 @@ static const vsff gluster_cbk_proc[] = {
{ GF_CBK_INO_FLUSH, "INO_FLUSH", dissect_rpc_unknown, dissect_rpc_unknown },
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info gluster_cbk_vers_info[] = {
{ 1, gluster_cbk_proc, &hf_gluster_cbk_proc },
};
static const value_string gluster_cbk_proc_vals[] = {
{ GF_CBK_NULL, "NULL" },
{ GF_CBK_FETCHSPEC, "FETCHSPEC" },
@ -350,9 +356,8 @@ proto_register_gluster_cbk(void)
void
proto_reg_handoff_gluster_cbk(void)
{
rpc_init_prog(proto_gluster_cbk, GLUSTER_CBK_PROGRAM, ett_gluster_cbk);
rpc_init_proc_table(proto_gluster_cbk, GLUSTER_CBK_PROGRAM, 1, gluster_cbk_proc,
hf_gluster_cbk_proc);
rpc_init_prog(proto_gluster_cbk, GLUSTER_CBK_PROGRAM, ett_gluster_cbk,
G_N_ELEMENTS(gluster_cbk_vers_info), gluster_cbk_vers_info);
}
/*

View File

@ -676,6 +676,9 @@ static const vsff hclnfsd1_proc[] = {
dissect_rpc_unknown, dissect_rpc_unknown },
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info hclnfsd_vers_info[] = {
{ 1, hclnfsd1_proc, &hf_hclnfsd_procedure_v1 },
};
static const value_string hclnfsd1_proc_vals[] = {
{ HCLNFSDPROC_NULL, "NULL" },
{ HCLNFSDPROC_SPOOL_INQUIRE, "SPOOL_INQUIRE" },
@ -902,10 +905,8 @@ void
proto_reg_handoff_hclnfsd(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_hclnfsd, HCLNFSD_PROGRAM, ett_hclnfsd);
/* Register the procedure tables */
rpc_init_proc_table(proto_hclnfsd, HCLNFSD_PROGRAM, 1, hclnfsd1_proc, hf_hclnfsd_procedure_v1);
rpc_init_prog(proto_hclnfsd, HCLNFSD_PROGRAM, ett_hclnfsd,
G_N_ELEMENTS(hclnfsd_vers_info), hclnfsd_vers_info);
}
/*

View File

@ -114,6 +114,10 @@ static const value_string kadm5_v2_proc_vals[] = {
{ 0, NULL }
};
static const rpc_prog_vers_info kadm5_vers_info[] = {
{ 2, kadm5_v2_proc, &hf_kadm5_procedure_v2 },
};
void
proto_register_kadm5(void)
{
@ -137,10 +141,8 @@ void
proto_reg_handoff_kadm5(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_kadm5, KADM5_PROGRAM, ett_kadm5);
/* Register the procedure tables */
rpc_init_proc_table(proto_kadm5, KADM5_PROGRAM, 2, kadm5_v2_proc,
hf_kadm5_procedure_v2);
rpc_init_prog(proto_kadm5, KADM5_PROGRAM, ett_kadm5,
G_N_ELEMENTS(kadm5_vers_info), kadm5_vers_info);
}
/*

View File

@ -181,6 +181,9 @@ static const vsff klm1_proc[] = {
dissect_klm_unlock_call, dissect_klm_stat_reply },
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info klm_vers_info[] = {
{ 1, klm1_proc, &hf_klm_procedure_v1 },
};
static const value_string klm1_proc_vals[] = {
{ KLMPROC_TEST, "TEST" },
{ KLMPROC_LOCK, "LOCK" },
@ -253,9 +256,8 @@ void
proto_reg_handoff_klm(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_klm, KLM_PROGRAM, ett_klm);
/* Register the procedure tables */
rpc_init_proc_table(proto_klm, KLM_PROGRAM, 1, klm1_proc, hf_klm_procedure_v1);
rpc_init_prog(proto_klm, KLM_PROGRAM, ett_klm,
G_N_ELEMENTS(klm_vers_info), klm_vers_info);
}
/*

View File

@ -765,6 +765,12 @@ static const value_string mount3_proc_vals[] = {
};
/* end of Mount protocol version 3 */
static const rpc_prog_vers_info mount_vers_info[] = {
{ 1, mount1_proc, &hf_mount_procedure_v1 },
{ 2, mount2_proc, &hf_mount_procedure_v2 },
{ 3, mount3_proc, &hf_mount_procedure_v3 },
};
/* SGI mount protocol version 1; actually the same as v1 plus
MOUNTPROC_EXPORTLIST and MOUNTPROC_STATVFS */
@ -803,6 +809,10 @@ static const value_string sgi_mount1_proc_vals[] = {
};
/* end of SGI mount protocol version 1 */
static const rpc_prog_vers_info sgi_mount_vers_info[] = {
{ 1, sgi_mount1_proc, &hf_sgi_mount_procedure_v1 },
};
void
proto_register_mount(void)
{
@ -1027,14 +1037,11 @@ proto_register_mount(void)
void
proto_reg_handoff_mount(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_mount, MOUNT_PROGRAM, ett_mount);
rpc_init_prog(proto_sgi_mount, SGI_MOUNT_PROGRAM, ett_mount);
/* Register the procedure tables */
rpc_init_proc_table(proto_mount, MOUNT_PROGRAM, 1, mount1_proc, hf_mount_procedure_v1);
rpc_init_proc_table(proto_mount, MOUNT_PROGRAM, 2, mount2_proc, hf_mount_procedure_v2);
rpc_init_proc_table(proto_mount, MOUNT_PROGRAM, 3, mount3_proc, hf_mount_procedure_v3);
rpc_init_proc_table(proto_sgi_mount, SGI_MOUNT_PROGRAM, 1, sgi_mount1_proc, hf_sgi_mount_procedure_v1);
/* Register the protocols as RPC */
rpc_init_prog(proto_mount, MOUNT_PROGRAM, ett_mount,
G_N_ELEMENTS(mount_vers_info), mount_vers_info);
rpc_init_prog(proto_sgi_mount, SGI_MOUNT_PROGRAM, ett_mount,
G_N_ELEMENTS(sgi_mount_vers_info), sgi_mount_vers_info);
}
/*

View File

@ -9746,6 +9746,12 @@ static const value_string nfs4_proc_vals[] = {
{ 0, NULL }
};
static const rpc_prog_vers_info nfs_vers_info[] = {
{ 2, nfs2_proc, &hf_nfs2_procedure },
{ 3, nfs3_proc, &hf_nfs3_procedure },
{ 4, nfs4_proc, &hf_nfs4_procedure },
};
/*
* Union of the NFSv2, NFSv3, and NFSv4 status codes.
* Used for the "nfs.status" hidden field and in packet-nfsacl.c.
@ -10239,18 +10245,20 @@ static const value_string nfs_cb_proc_vals[] = {
{ 0, NULL }
};
/*
* The version should be 4, but some Linux kernels set this field to 1.
* "Temporarily" accommodate these servers.
*/
static const rpc_prog_vers_info nfs_cb_vers_info[] = {
{ 1, nfs_cb_proc, &hf_nfs4_cb_procedure },
{ 4, nfs_cb_proc, &hf_nfs4_cb_procedure },
};
void reg_callback(int cbprog)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_nfs, cbprog, ett_nfs);
/*
* Register the procedure tables. The version should be 4,
* but some Linux kernels set this field to 1. "Temporarily",
* accommodate these servers.
*/
rpc_init_proc_table(proto_nfs, cbprog, 1, nfs_cb_proc, hf_nfs4_cb_procedure);
rpc_init_proc_table(proto_nfs, cbprog, 4, nfs_cb_proc, hf_nfs4_cb_procedure);
rpc_init_prog(proto_nfs, cbprog, ett_nfs,
G_N_ELEMENTS(nfs_cb_vers_info), nfs_cb_vers_info);
}
void
@ -12621,12 +12629,8 @@ proto_reg_handoff_nfs(void)
dissector_handle_t fhandle_handle;
/* Register the protocol as RPC */
rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs);
/* Register the procedure tables */
rpc_init_proc_table(proto_nfs, NFS_PROGRAM, 2, nfs2_proc, hf_nfs2_procedure);
rpc_init_proc_table(proto_nfs, NFS_PROGRAM, 3, nfs3_proc, hf_nfs3_procedure);
rpc_init_proc_table(proto_nfs, NFS_PROGRAM, 4, nfs4_proc, hf_nfs4_procedure);
rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs,
G_N_ELEMENTS(nfs_vers_info), nfs_vers_info);
fhandle_handle = create_dissector_handle(dissect_fhandle_data_SVR4, proto_nfs_svr4);
dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);

View File

@ -504,6 +504,12 @@ static const value_string nfsacl3_proc_vals[] = {
{ 0, NULL }
};
static const rpc_prog_vers_info nfsacl_vers_info[] = {
{ 1, nfsacl1_proc, &hf_nfsacl_procedure_v1 },
{ 2, nfsacl2_proc, &hf_nfsacl_procedure_v2 },
{ 3, nfsacl3_proc, &hf_nfsacl_procedure_v3 },
};
void
proto_register_nfsacl(void)
{
@ -587,11 +593,8 @@ void
proto_reg_handoff_nfsacl(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_nfsacl, NFSACL_PROGRAM, ett_nfsacl);
/* Register the procedure tables */
rpc_init_proc_table(proto_nfsacl, NFSACL_PROGRAM, 1, nfsacl1_proc, hf_nfsacl_procedure_v1);
rpc_init_proc_table(proto_nfsacl, NFSACL_PROGRAM, 2, nfsacl2_proc, hf_nfsacl_procedure_v2);
rpc_init_proc_table(proto_nfsacl, NFSACL_PROGRAM, 3, nfsacl3_proc, hf_nfsacl_procedure_v3);
rpc_init_prog(proto_nfsacl, NFSACL_PROGRAM, ett_nfsacl,
G_N_ELEMENTS(nfsacl_vers_info), nfsacl_vers_info);
}
/*

View File

@ -51,6 +51,9 @@ static const value_string nfsauth1_proc_vals[] = {
{ NFSAUTH1_ACCESS, "ACCESS" },
{ 0, NULL }
};
static const rpc_prog_vers_info nfsauth_vers_info[] = {
{ 1, nfsauth1_proc, &hf_nfsauth_procedure_v1 },
};
void
@ -75,9 +78,8 @@ void
proto_reg_handoff_nfsauth(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_nfsauth, NFSAUTH_PROGRAM, ett_nfsauth);
/* Register the procedure tables */
rpc_init_proc_table(proto_nfsauth, NFSAUTH_PROGRAM, 1, nfsauth1_proc, hf_nfsauth_procedure_v1);
rpc_init_prog(proto_nfsauth, NFSAUTH_PROGRAM, ett_nfsauth,
G_N_ELEMENTS(nfsauth_vers_info), nfsauth_vers_info);
}
/*

View File

@ -1165,6 +1165,9 @@ static const value_string nisplus3_proc_vals[] = {
{ NISPROC_UPDKEYS, "UPDKEYS" },
{ 0, NULL }
};
static const rpc_prog_vers_info nisplus_vers_info[] = {
{ 3, nisplus3_proc, &hf_nisplus_procedure_v3 },
};
@ -1831,9 +1834,8 @@ void
proto_reg_handoff_nis(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_nisplus, NIS_PROGRAM, ett_nisplus);
/* Register the procedure tables */
rpc_init_proc_table(proto_nisplus, NIS_PROGRAM, 3, nisplus3_proc, hf_nisplus_procedure_v3);
rpc_init_prog(proto_nisplus, NIS_PROGRAM, ett_nisplus,
G_N_ELEMENTS(nisplus_vers_info), nisplus_vers_info);
}
@ -1897,6 +1899,9 @@ static const value_string nispluscb1_proc_vals[] = {
{ CBPROC_ERROR, "ERROR" },
{ 0, NULL }
};
static const rpc_prog_vers_info nispluscb_vers_info[] = {
{ 1, cb1_proc, &hf_nispluscb_procedure_v1 },
};
void
proto_register_niscb(void)
@ -1930,9 +1935,8 @@ void
proto_reg_handoff_niscb(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_nispluscb, CB_PROGRAM, ett_nispluscb);
/* Register the procedure tables */
rpc_init_proc_table(proto_nispluscb, CB_PROGRAM, 1, cb1_proc, hf_nispluscb_procedure_v1);
rpc_init_prog(proto_nispluscb, CB_PROGRAM, ett_nispluscb,
G_N_ELEMENTS(nispluscb_vers_info), nispluscb_vers_info);
}
/*

View File

@ -1095,6 +1095,12 @@ static const value_string nlm4_proc_vals[] = {
};
/* end of NLM protocol version 4 */
static const rpc_prog_vers_info nlm_vers_info[] = {
{ 1, nlm1_proc, &hf_nlm_procedure_v1 },
{ 2, nlm2_proc, &hf_nlm_procedure_v2 },
{ 3, nlm3_proc, &hf_nlm_procedure_v3 },
{ 4, nlm4_proc, &hf_nlm_procedure_v4 },
};
void
proto_register_nlm(void)
@ -1214,12 +1220,8 @@ void
proto_reg_handoff_nlm(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_nlm, NLM_PROGRAM, ett_nlm);
/* Register the procedure tables */
rpc_init_proc_table(proto_nlm, NLM_PROGRAM, 1, nlm1_proc, hf_nlm_procedure_v1);
rpc_init_proc_table(proto_nlm, NLM_PROGRAM, 2, nlm2_proc, hf_nlm_procedure_v2);
rpc_init_proc_table(proto_nlm, NLM_PROGRAM, 3, nlm3_proc, hf_nlm_procedure_v3);
rpc_init_proc_table(proto_nlm, NLM_PROGRAM, 4, nlm4_proc, hf_nlm_procedure_v4);
rpc_init_prog(proto_nlm, NLM_PROGRAM, ett_nlm,
G_N_ELEMENTS(nlm_vers_info), nlm_vers_info);
}
/*

View File

@ -341,6 +341,10 @@ static const value_string pcnfsd2_proc_vals[] = {
};
/* end of PCNFS version 2 */
static const rpc_prog_vers_info pcnfsd_vers_info[] = {
{ 1, pcnfsd1_proc, &hf_pcnfsd_procedure_v1 },
{ 2, pcnfsd2_proc, &hf_pcnfsd_procedure_v2 },
};
void
proto_register_pcnfsd(void)
@ -416,10 +420,8 @@ void
proto_reg_handoff_pcnfsd(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_pcnfsd, PCNFSD_PROGRAM, ett_pcnfsd);
/* Register the procedure tables */
rpc_init_proc_table(proto_pcnfsd, PCNFSD_PROGRAM, 1, pcnfsd1_proc, hf_pcnfsd_procedure_v1);
rpc_init_proc_table(proto_pcnfsd, PCNFSD_PROGRAM, 2, pcnfsd2_proc, hf_pcnfsd_procedure_v2);
rpc_init_prog(proto_pcnfsd, PCNFSD_PROGRAM, ett_pcnfsd,
G_N_ELEMENTS(pcnfsd_vers_info), pcnfsd_vers_info);
}
/*

View File

@ -554,6 +554,13 @@ static const value_string portmap4_proc_vals[] = {
};
/* end of Portmap version 4 */
static const rpc_prog_vers_info portmap_vers_info[] = {
{ 1, portmap1_proc, &hf_portmap_procedure_v1 },
{ 2, portmap2_proc, &hf_portmap_procedure_v2 },
{ 3, portmap3_proc, &hf_portmap_procedure_v3 },
{ 4, portmap4_proc, &hf_portmap_procedure_v4 },
};
void
proto_register_portmap(void)
{
@ -631,12 +638,9 @@ void
proto_reg_handoff_portmap(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_portmap, PORTMAP_PROGRAM, ett_portmap);
/* Register the procedure tables */
rpc_init_proc_table(proto_portmap, PORTMAP_PROGRAM, 1, portmap1_proc, hf_portmap_procedure_v1);
rpc_init_proc_table(proto_portmap, PORTMAP_PROGRAM, 2, portmap2_proc, hf_portmap_procedure_v2);
rpc_init_proc_table(proto_portmap, PORTMAP_PROGRAM, 3, portmap3_proc, hf_portmap_procedure_v3);
rpc_init_proc_table(proto_portmap, PORTMAP_PROGRAM, 4, portmap4_proc, hf_portmap_procedure_v4);
rpc_init_prog(proto_portmap, PORTMAP_PROGRAM, ett_portmap,
G_N_ELEMENTS(portmap_vers_info), portmap_vers_info);
rpc_handle = find_dissector("rpc");
}

View File

@ -465,58 +465,6 @@ rpc_proc_hash(gconstpointer k)
}
/* insert some entries */
void
rpc_init_proc_table(int proto, guint prog, guint vers, const vsff *proc_table,
int procedure_hf)
{
rpc_prog_info_value *rpc_prog;
const vsff *proc;
/*
* Add the operation number hfinfo value for this version of the
* program.
*/
rpc_prog = (rpc_prog_info_value *)g_hash_table_lookup(rpc_progs, GUINT_TO_POINTER(prog));
DISSECTOR_ASSERT(rpc_prog != NULL);
rpc_prog->procedure_hfs = g_array_set_size(rpc_prog->procedure_hfs,
vers);
g_array_insert_val(rpc_prog->procedure_hfs, vers, procedure_hf);
for (proc = proc_table ; proc->strptr!=NULL; proc++) {
rpc_proc_info_key key;
key.prog = prog;
key.vers = vers;
key.proc = proc->value;
if (proc->dissect_call == NULL) {
fprintf(stderr, "OOPS: No call handler for %s version %u procedure %s\n",
proto_get_protocol_long_name(rpc_prog->proto),
vers,
proc->strptr);
if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
abort();
continue;
}
dissector_add_custom_table_handle("rpc.call", g_memdup(&key, sizeof(rpc_proc_info_key)),
new_create_dissector_handle_with_name(proc->dissect_call, proto, proc->strptr));
if (proc->dissect_reply == NULL) {
fprintf(stderr, "OOPS: No call handler for %s version %u procedure %s\n",
proto_get_protocol_long_name(rpc_prog->proto),
vers,
proc->strptr);
if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
abort();
continue;
}
dissector_add_custom_table_handle("rpc.reply", g_memdup(&key, sizeof(rpc_proc_info_key)),
new_create_dissector_handle_with_name(proc->dissect_reply, proto, proc->strptr));
}
}
/* return the name associated with a previously registered procedure. */
const char *
rpc_proc_name(guint32 prog, guint32 vers, guint32 proc)
@ -561,9 +509,12 @@ rpc_prog_free_val(gpointer v)
}
void
rpc_init_prog(int proto, guint32 prog, int ett)
rpc_init_prog(int proto, guint32 prog, int ett, size_t nvers,
const rpc_prog_vers_info *versions)
{
rpc_prog_info_value *value;
size_t versidx;
const vsff *proc;
value = (rpc_prog_info_value *) g_malloc(sizeof(rpc_prog_info_value));
value->proto = find_protocol_by_id(proto);
@ -573,6 +524,52 @@ rpc_init_prog(int proto, guint32 prog, int ett)
value->procedure_hfs = g_array_new(FALSE, TRUE, sizeof (int));
g_hash_table_insert(rpc_progs,GUINT_TO_POINTER(prog),value);
/*
* Now register each of the versions of the program.
*/
for (versidx = 0; versidx < nvers; versidx++) {
/*
* Add the operation number hfinfo value for this version.
*/
value->procedure_hfs = g_array_set_size(value->procedure_hfs,
versions[versidx].vers);
g_array_insert_val(value->procedure_hfs,
versions[versidx].vers, *versions[versidx].procedure_hf);
for (proc = versions[versidx].proc_table; proc->strptr != NULL;
proc++) {
rpc_proc_info_key key;
key.prog = prog;
key.vers = versions[versidx].vers;
key.proc = proc->value;
if (proc->dissect_call == NULL) {
fprintf(stderr, "OOPS: No call handler for %s version %u procedure %s\n",
proto_get_protocol_long_name(value->proto),
versions[versidx].vers,
proc->strptr);
if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
abort();
continue;
}
dissector_add_custom_table_handle("rpc.call", g_memdup(&key, sizeof(rpc_proc_info_key)),
new_create_dissector_handle_with_name(proc->dissect_call, value->proto_id, proc->strptr));
if (proc->dissect_reply == NULL) {
fprintf(stderr, "OOPS: No call handler for %s version %u procedure %s\n",
proto_get_protocol_long_name(value->proto),
versions[versidx].vers,
proc->strptr);
if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
abort();
continue;
}
dissector_add_custom_table_handle("rpc.reply", g_memdup(&key, sizeof(rpc_proc_info_key)),
new_create_dissector_handle_with_name(proc->dissect_reply, value->proto_id, proc->strptr));
}
}
}

View File

@ -132,6 +132,9 @@ typedef struct _rpc_call_info_value {
typedef int (dissect_function_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree, void* data);
/*
* Information about a particular version of a program.
*/
typedef struct _vsff {
guint32 value;
const gchar *strptr;
@ -139,11 +142,16 @@ typedef struct _vsff {
new_dissector_t dissect_reply;
} vsff;
typedef struct _rpc_proc_list {
guint vers;
const vsff *proc_table;
int *procedure_hf;
} rpc_prog_vers_info;
extern const value_string rpc_auth_flavor[];
WS_DLL_PUBLIC void rpc_init_proc_table(int proto, guint prog, guint vers, const vsff *proc_table,
int procedure_hf);
WS_DLL_PUBLIC void rpc_init_prog(int proto, guint32 prog, int ett);
WS_DLL_PUBLIC void rpc_init_prog(int proto, guint32 prog, int ett, size_t nvers,
const rpc_prog_vers_info *versions);
WS_DLL_PUBLIC const char *rpc_prog_name(guint32 prog);
WS_DLL_PUBLIC const char *rpc_proc_name(guint32 prog, guint32 vers, guint32 proc);
WS_DLL_PUBLIC int rpc_prog_hf(guint32 prog, guint32 vers);

View File

@ -203,6 +203,11 @@ static const value_string rquota2_proc_vals[] = {
};
/* end of RQUOTA version 2 */
static const rpc_prog_vers_info rquota_vers_info[] = {
{ 1, rquota1_proc, &hf_rquota_procedure_v1 },
{ 2, rquota2_proc, &hf_rquota_procedure_v2 },
};
void
proto_register_rquota(void)
{
@ -296,10 +301,8 @@ void
proto_reg_handoff_rquota(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_rquota, RQUOTA_PROGRAM, ett_rquota);
/* Register the procedure tables */
rpc_init_proc_table(proto_rquota, RQUOTA_PROGRAM, 1, rquota1_proc, hf_rquota_procedure_v1);
rpc_init_proc_table(proto_rquota, RQUOTA_PROGRAM, 2, rquota2_proc, hf_rquota_procedure_v2);
rpc_init_prog(proto_rquota, RQUOTA_PROGRAM, ett_rquota,
G_N_ELEMENTS(rquota_vers_info), rquota_vers_info);
}
/*

View File

@ -108,6 +108,13 @@ static const value_string rstat4_proc_vals[] = {
{ 0, NULL }
};
static const rpc_prog_vers_info rstat_vers_info[] = {
{ 1, rstat1_proc, &hf_rstat_procedure_v1 },
{ 2, rstat2_proc, &hf_rstat_procedure_v2 },
{ 3, rstat3_proc, &hf_rstat_procedure_v3 },
{ 4, rstat4_proc, &hf_rstat_procedure_v4 },
};
void
proto_register_rstat(void)
{
@ -139,12 +146,8 @@ void
proto_reg_handoff_rstat(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_rstat, RSTAT_PROGRAM, ett_rstat);
/* Register the procedure tables */
rpc_init_proc_table(proto_rstat, RSTAT_PROGRAM, 1, rstat1_proc, hf_rstat_procedure_v1);
rpc_init_proc_table(proto_rstat, RSTAT_PROGRAM, 2, rstat2_proc, hf_rstat_procedure_v2);
rpc_init_proc_table(proto_rstat, RSTAT_PROGRAM, 3, rstat3_proc, hf_rstat_procedure_v3);
rpc_init_proc_table(proto_rstat, RSTAT_PROGRAM, 4, rstat4_proc, hf_rstat_procedure_v4);
rpc_init_prog(proto_rstat, RSTAT_PROGRAM, ett_rstat,
G_N_ELEMENTS(rstat_vers_info), rstat_vers_info);
}
/*

View File

@ -59,6 +59,10 @@ static const vsff rwall1_proc[] = {
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info rwall_vers_info[] = {
{ 1, rwall1_proc, &hfi_rwall_procedure_v1.id },
};
void
proto_register_rwall(void)
{
@ -86,9 +90,8 @@ void
proto_reg_handoff_rwall(void)
{
/* Register the protocol as RPC */
rpc_init_prog(hfi_rwall->id, RWALL_PROGRAM, ett_rwall);
/* Register the procedure tables */
rpc_init_proc_table(hfi_rwall->id, RWALL_PROGRAM, 1, rwall1_proc, hfi_rwall_procedure_v1.id);
rpc_init_prog(hfi_rwall->id, RWALL_PROGRAM, ett_rwall,
G_N_ELEMENTS(rwall_vers_info), rwall_vers_info);
}
/*

View File

@ -71,6 +71,12 @@ static const value_string sadmind3_proc_vals[] = {
{ 0, NULL }
};
static const rpc_prog_vers_info sadmind_vers_info[] = {
{ 1, sadmind1_proc, &hf_sadmind_procedure_v1 },
{ 2, sadmind2_proc, &hf_sadmind_procedure_v2 },
{ 3, sadmind3_proc, &hf_sadmind_procedure_v3 },
};
void
proto_register_sadmind(void)
{
@ -99,11 +105,8 @@ void
proto_reg_handoff_sadmind(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_sadmind, SADMIND_PROGRAM, ett_sadmind);
/* Register the procedure tables */
rpc_init_proc_table(proto_sadmind, SADMIND_PROGRAM, 1, sadmind1_proc, hf_sadmind_procedure_v1);
rpc_init_proc_table(proto_sadmind, SADMIND_PROGRAM, 2, sadmind2_proc, hf_sadmind_procedure_v2);
rpc_init_proc_table(proto_sadmind, SADMIND_PROGRAM, 3, sadmind3_proc, hf_sadmind_procedure_v3);
rpc_init_prog(proto_sadmind, SADMIND_PROGRAM, ett_sadmind,
G_N_ELEMENTS(sadmind_vers_info), sadmind_vers_info);
}
/*

View File

@ -90,6 +90,10 @@ static const value_string spray1_proc_vals[] = {
{ 0, NULL }
};
static const rpc_prog_vers_info spray_vers_info[] = {
{ 1, spray1_proc, &hf_spray_procedure_v1 },
};
void
proto_register_spray(void)
{
@ -133,9 +137,8 @@ void
proto_reg_handoff_spray(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_spray, SPRAY_PROGRAM, ett_spray);
/* Register the procedure tables */
rpc_init_proc_table(proto_spray, SPRAY_PROGRAM, 1, spray1_proc, hf_spray_procedure_v1);
rpc_init_prog(proto_spray, SPRAY_PROGRAM, ett_spray,
G_N_ELEMENTS(spray_vers_info), spray_vers_info);
}
/*

View File

@ -69,6 +69,10 @@ static const value_string statnotify1_proc_vals[] = {
};
/* end of stat-notify version 1 */
static const rpc_prog_vers_info statnotify_vers_info[] = {
{ 1, statnotify1_proc, &hf_statnotify_procedure_v1 },
};
void
proto_register_statnotify(void)
@ -101,9 +105,8 @@ void
proto_reg_handoff_statnotify(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_statnotify, STATNOTIFY_PROGRAM, ett_statnotify);
/* Register the procedure tables */
rpc_init_proc_table(proto_statnotify, STATNOTIFY_PROGRAM, 1, statnotify1_proc, hf_statnotify_procedure_v1);
rpc_init_prog(proto_statnotify, STATNOTIFY_PROGRAM, ett_statnotify,
G_N_ELEMENTS(statnotify_vers_info), statnotify_vers_info);
}
/*

View File

@ -304,6 +304,10 @@ static const vsff stat1_proc[] = {
/* end of stat version 1 */
static const rpc_prog_vers_info stat_vers_info[] = {
{ 1, stat1_proc, &hfi_stat_procedure_v1.id },
};
void
proto_register_stat(void)
{
@ -348,9 +352,8 @@ void
proto_reg_handoff_stat(void)
{
/* Register the protocol as RPC */
rpc_init_prog(hfi_stat->id, STAT_PROGRAM, ett_stat);
/* Register the procedure tables */
rpc_init_proc_table(hfi_stat->id, STAT_PROGRAM, 1, stat1_proc, hfi_stat_procedure_v1.id);
rpc_init_prog(hfi_stat->id, STAT_PROGRAM, ett_stat,
G_N_ELEMENTS(stat_vers_info), stat_vers_info);
}
/*

View File

@ -462,6 +462,10 @@ static const value_string teklink_proc_vals[] = {
{ 0, NULL }
};
static const rpc_prog_vers_info teklink_vers_info[] = {
{ 1, teklink_proc, &hf_teklink_procedure },
};
#if 0
static const value_string teklink_error_vals[] = {
{ 0, NULL }
@ -573,10 +577,8 @@ void
proto_reg_handoff_teklink(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_teklink, PROGRAM_TEKLINK, ett_teklink);
/* Register the procedure tables */
rpc_init_proc_table(proto_teklink, PROGRAM_TEKLINK, 1, teklink_proc, hf_teklink_procedure);
rpc_init_prog(proto_teklink, PROGRAM_TEKLINK, ett_teklink,
G_N_ELEMENTS(teklink_vers_info), teklink_vers_info);
}
/*

View File

@ -923,12 +923,12 @@ proto_reg_handoff_vxi11_core(void)
dissect_rpc_void, dissect_device_error },
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info vxi11_core_vers_info[] = {
{ VXI11_CORE_VERSION, vxi111_core_proc, &hf_vxi11_core_procedure_v1 },
};
rpc_init_prog(proto_vxi11_core, VXI11_CORE_PROGRAM, ett_vxi11_core);
rpc_init_proc_table(proto_vxi11_core, VXI11_CORE_PROGRAM,
VXI11_CORE_VERSION,
vxi111_core_proc,
hf_vxi11_core_procedure_v1);
rpc_init_prog(proto_vxi11_core, VXI11_CORE_PROGRAM, ett_vxi11_core,
G_N_ELEMENTS(vxi11_core_vers_info), vxi11_core_vers_info);
}
@ -970,12 +970,12 @@ proto_reg_handoff_vxi11_async(void)
dissect_device_link, dissect_device_error },
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info vxi11_async_vers_info[] = {
{ VXI11_ASYNC_VERSION, vxi111_async_proc, &hf_vxi11_async_procedure_v1 },
};
rpc_init_prog(proto_vxi11_async, VXI11_ASYNC_PROGRAM, ett_vxi11_async);
rpc_init_proc_table(proto_vxi11_async, VXI11_ASYNC_PROGRAM,
VXI11_ASYNC_VERSION,
vxi111_async_proc,
hf_vxi11_async_procedure_v1);
rpc_init_prog(proto_vxi11_async, VXI11_ASYNC_PROGRAM, ett_vxi11_async,
G_N_ELEMENTS(vxi11_async_vers_info), vxi11_async_vers_info);
}
@ -1023,12 +1023,12 @@ proto_reg_handoff_vxi11_intr(void)
dissect_device_SRQ_parms, dissect_rpc_void },
{ 0, NULL, NULL, NULL }
};
static const rpc_prog_vers_info vxi11_intr_vers_info[] = {
{ VXI11_INTR_VERSION, vxi111_intr_proc, &hf_vxi11_intr_procedure_v1 },
};
rpc_init_prog(proto_vxi11_intr, VXI11_INTR_PROGRAM, ett_vxi11_intr);
rpc_init_proc_table(proto_vxi11_intr, VXI11_INTR_PROGRAM,
VXI11_INTR_VERSION,
vxi111_intr_proc,
hf_vxi11_intr_procedure_v1);
rpc_init_prog(proto_vxi11_intr, VXI11_INTR_PROGRAM, ett_vxi11_intr,
G_N_ELEMENTS(vxi11_intr_vers_info), vxi11_intr_vers_info);
}
/*

View File

@ -165,6 +165,11 @@ static const value_string ypbind2_proc_vals[] = {
/* end of YPBind version 2 */
static const rpc_prog_vers_info ypbind_vers_info[] = {
{ 1, ypbind1_proc, &hf_ypbind_procedure_v1 },
{ 2, ypbind2_proc, &hf_ypbind_procedure_v2 },
};
void
proto_register_ypbind(void)
{
@ -216,10 +221,8 @@ void
proto_reg_handoff_ypbind(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_ypbind, YPBIND_PROGRAM, ett_ypbind);
/* Register the procedure tables */
rpc_init_proc_table(proto_ypbind, YPBIND_PROGRAM, 1, ypbind1_proc, hf_ypbind_procedure_v1);
rpc_init_proc_table(proto_ypbind, YPBIND_PROGRAM, 2, ypbind2_proc, hf_ypbind_procedure_v2);
rpc_init_prog(proto_ypbind, YPBIND_PROGRAM, ett_ypbind,
G_N_ELEMENTS(ypbind_vers_info), ypbind_vers_info);
}
/*

View File

@ -97,6 +97,10 @@ static const value_string yppasswd1_proc_vals[] = {
{ 0, NULL }
};
static const rpc_prog_vers_info yppasswd_vers_info[] = {
{ 1, yppasswd1_proc, &hf_yppasswd_procedure_v1 },
};
void
proto_register_yppasswd(void)
{
@ -161,9 +165,8 @@ void
proto_reg_handoff_yppasswd(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_yppasswd, YPPASSWD_PROGRAM, ett_yppasswd);
/* Register the procedure tables */
rpc_init_proc_table(proto_yppasswd, YPPASSWD_PROGRAM, 1, yppasswd1_proc, hf_yppasswd_procedure_v1);
rpc_init_prog(proto_yppasswd, YPPASSWD_PROGRAM, ett_yppasswd,
G_N_ELEMENTS(yppasswd_vers_info), yppasswd_vers_info);
}
/*

View File

@ -572,6 +572,11 @@ static const value_string ypserv2_proc_vals[] = {
/* end of YPServ version 2 */
static const rpc_prog_vers_info ypserv_vers_info[] = {
{ 1, ypserv1_proc, &hf_ypserv_procedure_v1 },
{ 2, ypserv2_proc, &hf_ypserv_procedure_v2 },
};
void
proto_register_ypserv(void)
{
@ -640,12 +645,8 @@ void
proto_reg_handoff_ypserv(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ett_ypserv);
/* Register the procedure tables */
rpc_init_proc_table(proto_ypserv, YPSERV_PROGRAM, 1, ypserv1_proc,
hf_ypserv_procedure_v1);
rpc_init_proc_table(proto_ypserv, YPSERV_PROGRAM, 2, ypserv2_proc,
hf_ypserv_procedure_v2);
rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ett_ypserv,
G_N_ELEMENTS(ypserv_vers_info), ypserv_vers_info);
}
/*

View File

@ -49,6 +49,10 @@ static const value_string ypxfr1_proc_vals[] = {
};
/* end of YPXFR version 1 */
static const rpc_prog_vers_info ypxfr_vers_info[] = {
{ 1, ypxfr1_proc, &hf_ypxfr_procedure_v1 },
};
void
proto_register_ypxfr(void)
{
@ -72,9 +76,8 @@ void
proto_reg_handoff_ypxfr(void)
{
/* Register the protocol as RPC */
rpc_init_prog(proto_ypxfr, YPXFR_PROGRAM, ett_ypxfr);
/* Register the procedure tables */
rpc_init_proc_table(proto_ypxfr, YPXFR_PROGRAM, 1, ypxfr1_proc, hf_ypxfr_procedure_v1);
rpc_init_prog(proto_ypxfr, YPXFR_PROGRAM, ett_ypxfr,
G_N_ELEMENTS(ypxfr_vers_info), ypxfr_vers_info);
}
/*