Remove all $Id$ from top of file
[metze/wireshark/wip.git] / epan / dissectors / packet-teklink.c
1 /* packet-teklink.c
2  * Routines for TEKLINK dissection
3  * Copyright (c)2010 Sven Schnelle <svens@stackframe.org>
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 #include "config.h"
25
26 #include "packet-rpc.h"
27
28 #define PROGRAM_TEKLINK 0x20400034
29
30 void proto_reg_handoff_teklink(void);
31 void proto_register_teklink(void);
32
33 static int proto_teklink = -1;
34 static int hf_teklink_procedure = -1;
35 static int hf_teklink_unknown_long = -1;
36 static int hf_teklink_unknown_string = -1;
37 static int hf_teklink_cmd = -1;
38 static int hf_teklink_user = -1;
39 static int hf_teklink_host = -1;
40 static int hf_teklink_location = -1;
41 static int hf_teklink_tla_type = -1;
42 static int hf_teklink_locked = -1;
43 static int hf_teklink_vtc_srcnames = -1;
44 static int hf_teklink_vtc_dstnames = -1;
45 static int hf_teklink_vtc_sigpol = -1;
46 static int hf_teklink_vtc_sigen = -1;
47 static int hf_teklink_vtc_clksource = -1;
48 static int hf_teklink_vtc_clkmode = -1;
49 static int hf_teklink_vtc_clkedge = -1;
50 static int hf_teklink_vtc_mode = -1;
51 static int hf_teklink_vtc_edge = -1;
52 static int hf_teklink_vtc_sigfeedback = -1;
53
54 static gint ett_teklink = -1;
55
56 static const value_string teklink_vtc_srcnames[] = {
57         { 0, "VTC_SRC_APPSIG0" },
58         { 1, "VTC_SRC_APPSIG1" },
59         { 2, "VTC_SRC_APPSIG2" },
60         { 3, "VTC_SRC_APPSIG3" },
61         { 4, "VTC_SRC_APPSIG4" },
62         { 5, "VTC_SRC_APPSIG5" },
63         { 6, "VTC_SRC_APPSIG6" },
64         { 7, "VTC_SRC_APPSIG7" },
65         { 8, "VTC_SRC_APPSIG8" },
66         { 9, "VTC_SRC_APPSIG9" },
67         { 10, "VTC_SRC_APPSIG10" },
68         { 11, "VTC_SRC_APPSIG11" },
69         { 12, "VTC_SRC_TTLTRIG0" },
70         { 13, "VTC_SRC_TTLTRIG1" },
71         { 14, "VTC_SRC_TTLTRIG2" },
72         { 15, "VTC_SRC_TTLTRIG3" },
73         { 16, "VTC_SRC_TTLTRIG4" },
74         { 17, "VTC_SRC_TTLTRIG5" },
75         { 18, "VTC_SRC_TTLTRIG6" },
76         { 19, "VTC_SRC_TTLTRIG7" },
77         { 20, "VTC_SRC_XBAR1" },
78         { 21, "VTC_SRC_XBAR2" },
79         { 22, "VTC_SRC_ECLTRIG0" },
80         { 23, "VTC_SRC_ECLTRIG1" },
81         { 24, "VTC_SRC_ALL" },
82         { 25, "VTC_SRC_XXX" },
83         { 26, "VTC_SRC_XXX" },
84         { 27, "VTC_SRC_VCC" },
85         { 0, NULL },
86 };
87
88 static const value_string teklink_vtc_dstnames[] = {
89         { 0, "VTC_DST_APPSIG0" },
90         { 1, "VTC_DST_APPSIG1" },
91         { 2, "VTC_DST_APPSIG2" },
92         { 3, "VTC_DST_APPSIG3" },
93         { 4, "VTC_DST_APPSIG4" },
94         { 5, "VTC_DST_APPSIG5" },
95         { 6, "VTC_DST_APPSIG6" },
96         { 7, "VTC_DST_APPSIG7" },
97         { 8, "VTC_DST_APPSIG8" },
98         { 9, "VTC_DST_APPSIG9" },
99         { 10, "VTC_DST_APPSIG10" },
100         { 11, "VTC_DST_APPSIG11" },
101         { 12, "VTC_DST_TTLTRIG0" },
102         { 13, "VTC_DST_TTLTRIG1" },
103         { 14, "VTC_DST_TTLTRIG2" },
104         { 15, "VTC_DST_TTLTRIG3" },
105         { 16, "VTC_DST_TTLTRIG4" },
106         { 17, "VTC_DST_TTLTRIG5" },
107         { 18, "VTC_DST_TTLTRIG6" },
108         { 19, "VTC_DST_TTLTRIG7" },
109         { 20, "VTC_DST_XBAR1" },
110         { 21, "VTC_DST_XBAR2" },
111         { 22, "VTC_DST_ECLTRIG0" },
112         { 23, "VTC_DST_ECLTRIG1" },
113         { 24, "VTC_DST_ALL" },
114         { 0, NULL },
115 };
116
117 static const value_string teklink_vtc_sigen[] = {
118         { 0, "VTC_OUT_FORCE_OFF" },
119         { 1, "VTC_OUT_FORCE_ON" },
120         { 0, NULL },
121 };
122
123 static const value_string teklink_vtc_sigfeedback[] = {
124         { 0, "VTC_MODE_FEEDBK_OFF" },
125         { 1, "VTC_MODE_FEEDBK_ON" },
126         { 0, NULL },
127 };
128
129 static const value_string teklink_vtc_edge[] = {
130         { 0, "VTC_MODE_EDGE_FALL" },
131         { 1, "VTC_MODE_EDGE_RISE" },
132         { 0, NULL },
133 };
134
135 static const value_string teklink_vtc_sigpol[] = {
136         { 0, "VTC_OUT_POL_NORM" },
137         { 1, "VTC_OUT_POL_INVERT" },
138         { 0, NULL },
139 };
140
141 static const value_string teklink_vtc_clkmode[] = {
142         { 0, "VTC_CLK_MODE_ASYNCH" },
143         { 1, "VTC_CLK_MODE_SYNCH" },
144         { 0, NULL },
145 };
146
147 static const value_string teklink_vtc_clkedge[] = {
148         { 0, "VTC_CLK_EDGE_SENS_FALL" },
149         { 1, "VTC_CLK_EDGE_SENS_RISE" },
150         { 0, NULL },
151 };
152
153 static const value_string teklink_vtc_clksource[] = {
154         { 0, "VTC_CLK_SRC_GND" },
155         { 1, "VTC_CLK_SRC_1" },
156         { 2, "VTC_CLK_SRC_2" },
157         { 3, "VTC_CLK_SRC_CPUCLK" },
158         { 0, NULL },
159 };
160
161 static const value_string teklink_vtc_modes[] = {
162         { 0, "VTC_MODE_NONE" },
163         { 1, "VTC_MODE_1" },
164         { 2, "VTC_MODE_2" },
165         { 3, "VTC_MODE_3" },
166         { 4, "VTC_MODE_4" },
167         { 5, "VTC_MODE_5" },
168         { 6, "VTC_MODE_6" },
169         { 7, "VTC_MODE_EVENT_CNT_LAT" },
170         { 0, NULL },
171 };
172
173 static int dissect_teklink_tlaframeopen_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
174         proto_tree *tree, void* data _U_)
175 {
176         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
177         offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL);
178         offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL);
179         offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL);
180         return offset;
181 }
182
183 static int dissect_teklink_tlaframeclose_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
184         proto_tree *tree, void* data _U_)
185 {
186         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
187         return offset;
188 }
189
190 static int dissect_teklink_tlaframeclose_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
191         proto_tree *tree, void* data _U_)
192 {
193         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
194         return offset;
195 }
196
197 static int dissect_teklink_tlaframeopen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
198         proto_tree *tree, void* data _U_)
199 {
200         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
201         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
202         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
203         return offset;
204 }
205
206 static int dissect_teklink_get_software_version_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
207         proto_tree *tree, void* data _U_)
208 {
209         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
210         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
211         offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL);
212         offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL);
213         return offset;
214 }
215
216 static int dissect_teklink_call65_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
217         proto_tree *tree, void* data _U_)
218 {
219         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_cmd, offset);
220         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
221         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
222         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
223         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
224         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
225         return offset;
226 }
227
228 static int dissect_teklink_call65_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
229         proto_tree *tree, void* data _U_)
230 {
231         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
232         return offset;
233 }
234
235 static int dissect_teklink_info_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
236         proto_tree *tree, void* data _U_)
237 {
238         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_locked, offset);
239         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
240         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_tla_type, offset);
241         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
242         offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL);
243         offset = dissect_rpc_string(tvb, tree, hf_teklink_location, offset, NULL);
244         offset = dissect_rpc_string(tvb, tree, hf_teklink_user, offset, NULL);
245         offset = dissect_rpc_string(tvb, tree, hf_teklink_host, offset, NULL);
246         offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL);
247         return offset;
248 }
249
250 static int dissect_teklink_info_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
251         proto_tree *tree, void* data _U_)
252 {
253         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
254         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
255         return offset;
256 }
257
258
259 static int dissect_teklink_vtc_ident(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
260         proto_tree *tree, void* data _U_)
261 {
262         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
263         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
264         return offset;
265 }
266
267 static int dissect_teklink_vtc_sigstatall(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
268         proto_tree *tree, void* data _U_)
269 {
270         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
271         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
272         return offset;
273 }
274
275 static int dissect_teklink_vtc_outen(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
276         proto_tree *tree, void* data _U_)
277 {
278         guint32 sig = tvb_get_ntohl(tvb, offset);
279         guint32 sigon = tvb_get_ntohl(tvb, offset + 4);
280
281         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_dstnames, offset);
282         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_sigen, offset);
283
284         col_append_fstr(pinfo->cinfo, COL_INFO," %s, %s ",
285                         val_to_str(sig, teklink_vtc_dstnames, "Unknown destination %d"),
286                         sigon ? "VTC_OUT_FORCE_ON" : "VTC_OUT_FORCE_OFF");
287         return offset;
288 }
289
290 static int dissect_teklink_vtc_map(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
291         proto_tree *tree, void* data _U_)
292 {
293         guint32 src, dst;
294
295         src = tvb_get_ntohl(tvb, offset);
296         dst = tvb_get_ntohl(tvb, offset + 4);
297
298         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_srcnames, offset);
299         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_dstnames, offset);
300
301         col_append_fstr(pinfo->cinfo, COL_INFO," %s, %s ",
302                         val_to_str(src, teklink_vtc_srcnames, "Unknown source %d"),
303                         val_to_str(dst, teklink_vtc_dstnames, "Unknown destination %d"));
304         return offset;
305 }
306
307 static int dissect_teklink_vtc_clk(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
308         proto_tree *tree, void* data _U_)
309 {
310         guint32 sig, clksource, clkedge, clkmode;
311
312         sig = tvb_get_ntohl(tvb, offset);
313         clksource = tvb_get_ntohl(tvb, offset + 4);
314         clkedge = tvb_get_ntohl(tvb, offset + 8);
315         clkmode = tvb_get_ntohl(tvb, offset + 12);
316
317         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_dstnames, offset);
318         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_clksource, offset);
319         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_clkedge, offset);
320         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_clkmode, offset);
321
322         col_append_fstr(pinfo->cinfo, COL_INFO,"  %s, %s, %s, %s",
323                         val_to_str(sig, teklink_vtc_dstnames, "Unknown destination %d"),
324                         val_to_str(clksource, teklink_vtc_clksource, "Unknown clocksource %d"),
325                         val_to_str(clkedge, teklink_vtc_clkedge, "Unknown edge setting %d"),
326                         val_to_str(clkmode, teklink_vtc_clkmode, "Unknown mode setting %d"));
327         return offset;
328 }
329
330 static int dissect_teklink_vtc_mode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
331         proto_tree *tree, void* data _U_)
332 {
333         guint32 sig, edge, mode;
334
335         sig = tvb_get_ntohl(tvb, offset);
336         edge = tvb_get_ntohl(tvb, offset + 4);
337         mode = tvb_get_ntohl(tvb, offset + 12);
338
339         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_dstnames, offset);
340         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_edge, offset);
341         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
342         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_mode, offset);
343
344         col_append_fstr(pinfo->cinfo, COL_INFO," %s, %s, %s",
345                         val_to_str(sig, teklink_vtc_dstnames, "Unknown destination %d"),
346                         val_to_str(edge, teklink_vtc_edge, "Unknown edge setting %d"),
347                         val_to_str(mode, teklink_vtc_modes, "Unknown mode setting %d"));
348         return offset;
349 }
350
351 static int dissect_teklink_vtc_outsetup(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
352         proto_tree *tree, void* data _U_)
353 {
354         guint32 sig, en, pol, feedback;
355
356         sig = tvb_get_ntohl(tvb, offset);
357         en = tvb_get_ntohl(tvb, offset + 4);
358         pol = tvb_get_ntohl(tvb, offset + 8);
359         feedback = tvb_get_ntohl(tvb, offset + 12);
360
361         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_dstnames, offset);
362         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_sigen, offset);
363         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_sigpol, offset);
364         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_sigfeedback, offset);
365
366         col_append_fstr(pinfo->cinfo, COL_INFO," %s, %s, %s, %s",
367                         val_to_str(sig, teklink_vtc_dstnames, "Unknown destination %d"),
368                         val_to_str(pol, teklink_vtc_sigpol, "Unknown signal polarity %d"),
369                         val_to_str(en, teklink_vtc_sigen, "Unknown signal enable %d"),
370                         val_to_str(feedback, teklink_vtc_sigfeedback, "Unknown signal feedback setting %d"));
371         return offset;
372 }
373
374 static int dissect_teklink_vtc_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
375         proto_tree *tree, void* data _U_)
376 {
377         guint32 sig = tvb_get_ntohl(tvb, offset);
378
379         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_vtc_dstnames, offset);
380
381         col_append_fstr(pinfo->cinfo, COL_INFO," %s",
382                         val_to_str(sig, teklink_vtc_dstnames, "Unknown destination %d"));
383         return offset;
384 }
385
386 static int dissect_teklink_vtl_spinbits(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
387         proto_tree *tree, void* data _U_)
388 {
389         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
390         return offset;
391 }
392
393 static int dissect_teklink_vtl_zmode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
394         proto_tree *tree, void* data _U_)
395 {
396         offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset);
397         return offset;
398 }
399
400 static const vsff teklink_proc[] = {
401         { 1, "TLAFrameOpen", dissect_teklink_tlaframeopen_call, dissect_teklink_tlaframeopen_reply },
402         { 2, "TLAFrameClose", dissect_teklink_tlaframeclose_call, dissect_teklink_tlaframeclose_reply },
403         { 3, "GetSoftwareVersion", NULL, dissect_teklink_get_software_version_reply },
404         { 4, "GetInfo", dissect_teklink_info_call, dissect_teklink_info_reply },
405         { 5, "VtcIdent", NULL, dissect_teklink_vtc_ident },
406         { 7, "VtcOutEn", dissect_teklink_vtc_outen, NULL },
407         { 8, "VtcMap", dissect_teklink_vtc_map, NULL },
408         { 9, "VtcOutSetup", dissect_teklink_vtc_outsetup, NULL },
409         { 10, "VtcClk", dissect_teklink_vtc_clk, NULL },
410         { 11, "VtcMode", dissect_teklink_vtc_mode, NULL },
411         { 12, "VtcRes", dissect_teklink_vtc_res, NULL },
412         { 13, "VtcHardRes", NULL, NULL },
413         { 14, "VtcSigStatAll", NULL, dissect_teklink_vtc_sigstatall },
414         { 20, "VtlZMode", NULL, dissect_teklink_vtl_zmode },
415         { 21, "VtlSpinBits", NULL, dissect_teklink_vtl_spinbits },
416         { 65, "Unknown (65)", dissect_teklink_call65_call, dissect_teklink_call65_reply },
417         { 0, NULL, NULL, NULL }
418 };
419
420 static const value_string teklink_proc_vals[] = {
421         { 1, "TLAFrameOpen" },
422         { 2, "TLAFrameClose" },
423         { 3, "TLAFrameGetStatus" },
424         { 4, "GetInfo" },
425         { 5, "VtcIdent" },
426         { 7, "VtcOutEn" },
427         { 8, "VtcMap" },
428         { 9, "VtcOutSetup" },
429         { 10, "VtcClk" },
430         { 11, "VtcMode" },
431         { 12, "VtcRes" },
432         { 13, "VtcHardRes" },
433         { 14, "VtcSigStatAll" },
434         { 15, "VtcPeek" },
435         { 16, "VtcPoke" },
436         { 20, "VtlZMode" },
437         { 21, "VtlSpinBits" },
438         { 30, "TLAFrameResetVISA" },
439         { 35, "VtcRemoteDiag" },
440         { 36, "TLAFrameRunPostDiag" },
441         { 37, "TLAFrameTigerAccess" },
442         { 40, "XXX" },
443         { 41, "XXX" },
444         { 42, "TLAGetFrameError" },
445         { 50, "TLAFileOpen" },
446         { 51, "TLAReadFile" },
447         { 52, "TLAWriteFile" },
448         { 53, "TLAFileClose" },
449         { 54, "TLAFlashImage" },
450
451         { 0, NULL }
452 };
453
454 #if 0
455 static const value_string teklink_error_vals[] = {
456         { 0, NULL }
457 };
458 #endif
459
460 static const value_string teklink_cmd_vals[] = {
461         { 0, "TLKFreeResources" },
462         { 1, "TLKCreateDeleteEventRoute" },
463         { 2, "TLKDeleteRoutesForSignal" },
464         { 3, "CanRequestBeRouted" },
465         { 4, "TLKIsRouted" },
466         { 5, "TLACreateSysRoutes" },
467         { 6, "TLAStart" },
468         { 7, "TLAGetFrameDelay" },
469         { 8, "TLAFrameRegisterCallBack" },
470         { 10, "TLAGetTrggerDelay" },
471         { 0, NULL }
472 };
473
474 static const value_string teklink_tla_types[] = {
475         { 0x02, "TLA711" },
476         { 0x03, "TLA714" },
477         { 0x04, "TLA720" },
478         { 0x05, "TLA60X" },
479         { 0x06, "TLA6XX" },
480         { 0x13, "TLA714A" },
481         { 0x14, "TLA715" },
482         { 0x15, "TLA721" },
483         { 0x16, "TLA520X" },
484         { 0x17, "TLA7012" },
485         { 0x18, "TLA7016" },
486         { 0x00, NULL }
487 };
488
489 void
490 proto_register_teklink(void)
491 {
492         static hf_register_info hf_core[] = {
493                 { &hf_teklink_procedure, {
494                                 "Procedure", "teklink.procedure", FT_UINT8, BASE_DEC,
495                                 VALS(teklink_proc_vals), 0, NULL, HFILL }},
496                 { &hf_teklink_unknown_long, {
497                                 "Unknown long", "teklink.long", FT_UINT32, BASE_HEX,
498                                 NULL, 0, NULL, HFILL }},
499                 { &hf_teklink_unknown_string, {
500                                 "Unknown String", "teklink.string", FT_STRING, BASE_NONE,
501                                 NULL, 0, NULL, HFILL }},
502                 { &hf_teklink_cmd, {
503                                 "Command", "teklink.command", FT_UINT32, BASE_DEC,
504                                 VALS(teklink_cmd_vals), 0, NULL, HFILL }},
505                 { &hf_teklink_tla_type, {
506                                 "TLA Type", "teklink.tla_type", FT_UINT32, BASE_DEC,
507                                 VALS(teklink_tla_types), 0, NULL, HFILL }},
508                 { &hf_teklink_host, {
509                                 "Host", "teklink.host", FT_STRING, BASE_NONE,
510                                 NULL, 0, NULL, HFILL }},
511                 { &hf_teklink_user, {
512                                 "User", "teklink.user", FT_STRING, BASE_NONE,
513                                 NULL, 0, NULL, HFILL }},
514                 { &hf_teklink_location, {
515                                 "Location", "teklink.location", FT_STRING, BASE_NONE,
516                                 NULL, 0, NULL, HFILL }},
517                 { &hf_teklink_locked, {
518                                 "Locked", "teklink.locked", FT_UINT32, BASE_HEX,
519                                 NULL, 0, NULL, HFILL }},
520                 { &hf_teklink_vtc_dstnames, {
521                                 "Destination signal", "teklink.signal.destination", FT_UINT32, BASE_HEX,
522                                 VALS(teklink_vtc_dstnames), 0, NULL, HFILL }},
523                 { &hf_teklink_vtc_srcnames, {
524                                 "Source signal", "teklink.signal.source", FT_UINT32, BASE_HEX,
525                                 VALS(teklink_vtc_srcnames), 0, NULL, HFILL }},
526                 { &hf_teklink_vtc_sigen, {
527                                 "Signal Enable", "teklink.signal.enable", FT_UINT32, BASE_HEX,
528                                 VALS(teklink_vtc_sigen), 0, NULL, HFILL }},
529                 { &hf_teklink_vtc_sigpol, {
530                                 "Signal Polarity", "teklink.signal.polarity", FT_UINT32, BASE_HEX,
531                                 VALS(teklink_vtc_sigpol), 0, NULL, HFILL }},
532                 { &hf_teklink_vtc_clkmode, {
533                                 "Clock Mode", "teklink.clock.polarity", FT_UINT32, BASE_HEX,
534                                 VALS(teklink_vtc_clkmode), 0, NULL, HFILL }},
535                 { &hf_teklink_vtc_clkedge, {
536                                 "Clock Edge", "teklink.clock.polarity", FT_UINT32, BASE_HEX,
537                                 VALS(teklink_vtc_clkedge), 0, NULL, HFILL }},
538                 { &hf_teklink_vtc_clksource, {
539                                 "Clock Source", "teklink.clock.source", FT_UINT32, BASE_HEX,
540                                 VALS(teklink_vtc_clksource), 0, NULL, HFILL }},
541                 { &hf_teklink_vtc_mode, {
542                                 "Signal Mode", "teklink.signal.mode", FT_UINT32, BASE_HEX,
543                                 VALS(teklink_vtc_modes), 0, NULL, HFILL }},
544                 { &hf_teklink_vtc_edge, {
545                                 "Signal Edge", "teklink.signal.edge", FT_UINT32, BASE_HEX,
546                                 VALS(teklink_vtc_edge), 0, NULL, HFILL }},
547                 { &hf_teklink_vtc_sigfeedback, {
548                                 "Signal Feedbmode", "teklink.signal.feedback", FT_UINT32, BASE_HEX,
549                                 VALS(teklink_vtc_sigfeedback), 0, NULL, HFILL }}
550         };
551
552         static gint *ett[] = {
553                 &ett_teklink
554         };
555
556         proto_teklink = proto_register_protocol("TEKLINK", "TEKLINK", "teklink");
557         proto_register_field_array(proto_teklink, hf_core, array_length(hf_core));
558         proto_register_subtree_array(ett, array_length(ett));
559 }
560
561 void
562 proto_reg_handoff_teklink(void)
563 {
564         /* Register the protocol as RPC */
565         rpc_init_prog(proto_teklink, PROGRAM_TEKLINK, ett_teklink);
566
567         /* Register the procedure tables */
568         rpc_init_proc_table(PROGRAM_TEKLINK, 1, teklink_proc, hf_teklink_procedure);
569 }