summaryrefslogtreecommitdiffstats
path: root/example/dummy_ops.c
blob: 46415921fd2163df4ecd0dbb9d97d750ad17d4da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
#include <libdect.h>
#include "common.h"

/*
 * LLME Ops
 */

static void llme_mac_me_info_ind(struct dect_handle *dh,
				 const struct dect_ari *pari,
				 const struct dect_fp_capabilities *fpc)
{
}

static struct dect_llme_ops_ dummy_llme_ops;

/*
 * LCE Ops
 */

static bool lce_page_response(struct dect_handle *dh,
			      struct dect_data_link *ddl,
			      struct dect_lce_page_param *param)
{
	return false;
}

static void lce_group_ring_ind(struct dect_handle *dh,
			       enum dect_alerting_patterns pattern)
{
}

static void dl_establish_cfm(struct dect_handle *dh, bool success,
			     struct dect_data_link *ddl,
			     const struct dect_mac_conn_params *mcp)
{
}

static struct dect_lce_ops dummy_lce_ops;

/*
 * CC Ops
 */

static void mncc_setup_ind(struct dect_handle *dh, struct dect_call *call,
			   struct dect_mncc_setup_param *param)
{
}

static void mncc_setup_ack_ind(struct dect_handle *dh, struct dect_call *call,
			       struct dect_mncc_setup_ack_param *param)
{
}

static void mncc_reject_ind(struct dect_handle *dh, struct dect_call *call,
			    enum dect_causes cause,
			    struct dect_mncc_release_param *param)
{
}

static void mncc_call_proc_ind(struct dect_handle *dh, struct dect_call *call,
			       struct dect_mncc_call_proc_param *param)
{
}

static void mncc_alert_ind(struct dect_handle *dh, struct dect_call *call,
			   struct dect_mncc_alert_param *param)
{
}

static void mncc_connect_ind(struct dect_handle *dh, struct dect_call *call,
			     struct dect_mncc_connect_param *param)
{
}

static void mncc_connect_cfm(struct dect_handle *dh, struct dect_call *call,
			     struct dect_mncc_connect_param *param)
{
}

static void mncc_release_ind(struct dect_handle *dh, struct dect_call *call,
			     struct dect_mncc_release_param *param)
{
}

static void mncc_release_cfm(struct dect_handle *dh, struct dect_call *call,
			     enum dect_causes cause,
			     struct dect_mncc_release_param *param)
{
}

static void mncc_facility_ind(struct dect_handle *dh, struct dect_call *call,
			      struct dect_mncc_facility_param *param)
{
}

static void mncc_info_ind(struct dect_handle *dh, struct dect_call *call,
			  struct dect_mncc_info_param *param)
{
}

static void mncc_modify_ind(struct dect_handle *dh, struct dect_call *call,
			    struct dect_mncc_modify_param *param)
{
}

static void mncc_modify_cfm(struct dect_handle *dh, struct dect_call *call,
			    bool success, struct dect_mncc_modify_param *param)
{
}

static void mncc_hold_ind(struct dect_handle *dh, struct dect_call *call,
			  struct dect_mncc_hold_param *param)
{
}

static void mncc_hold_cfm(struct dect_handle *dh, struct dect_call *call,
			  struct dect_mncc_hold_param *param)
{
}

static void mncc_retrieve_ind(struct dect_handle *dh, struct dect_call *call,
			      struct dect_mncc_hold_param *param)
{
}

static void mncc_retrieve_cfm(struct dect_handle *dh, struct dect_call *call,
			      struct dect_mncc_hold_param *param)
{
}

static void mncc_iwu_info_ind(struct dect_handle *dh, struct dect_call *call,
			      struct dect_mncc_iwu_info_param *param)
{
}

static void dl_u_data_ind(struct dect_handle *dh, struct dect_call *call,
			  struct dect_msg_buf *mb)
{
}

static struct dect_cc_ops dummy_cc_ops;

/*
 * MM Ops
 */

static void mm_access_rights_ind(struct dect_handle *dh,
				 struct dect_mm_endpoint *mme,
				 struct dect_mm_access_rights_param *param)
{
	struct dect_mm_access_rights_param reply = {};

	dect_mm_access_rights_res(dh, mme, false, &reply);
}

static void mm_access_rights_cfm(struct dect_handle *dh,
				 struct dect_mm_endpoint *mme, bool accept,
				 struct dect_mm_access_rights_param *param)
{
}

static void mm_access_rights_terminate_ind(struct dect_handle *dh,
					   struct dect_mm_endpoint *mme,
					   struct dect_mm_access_rights_terminate_param *param)
{
	struct dect_mm_access_rights_terminate_param reply = {};

	dect_mm_access_rights_terminate_res(dh, mme, false, &reply);
}

static void mm_access_rights_terminate_cfm(struct dect_handle *dh,
					   struct dect_mm_endpoint *mme, bool accept,
					   struct dect_mm_access_rights_terminate_param *param)
{
}

static void mm_key_allocate_ind(struct dect_handle *dh,
				struct dect_mm_endpoint *mme,
				struct dect_mm_key_allocate_param *param)
{
}

static void mm_authenticate_ind(struct dect_handle *dh,
				struct dect_mm_endpoint *mme,
				struct dect_mm_authenticate_param *param)
{
	struct dect_mm_authenticate_param reply = {};

	dect_mm_authenticate_res(dh, mme, false, &reply);
}

static void mm_authenticate_cfm(struct dect_handle *dh,
				struct dect_mm_endpoint *mme, bool accept,
				struct dect_mm_authenticate_param *param)
{
}

static void mm_cipher_ind(struct dect_handle *dh,
			  struct dect_mm_endpoint *mme,
			  struct dect_mm_cipher_param *param)
{
	struct dect_mm_cipher_param reply = {};

	dect_mm_cipher_res(dh, mme, false, &reply, NULL);
}

static void mm_cipher_cfm(struct dect_handle *dh,
			  struct dect_mm_endpoint *mme, bool accept,
			  struct dect_mm_cipher_param *param)
{
}

static void mm_locate_ind(struct dect_handle *dh,
			  struct dect_mm_endpoint *mme,
			  struct dect_mm_locate_param *param)
{
	struct dect_mm_locate_param reply = {};

	dect_mm_locate_res(dh, mme, false, &reply);
}

static void mm_locate_cfm(struct dect_handle *dh,
			  struct dect_mm_endpoint *mme, bool accept,
			  struct dect_mm_locate_param *param)
{
}

static void mm_detach_ind(struct dect_handle *dh,
			  struct dect_mm_endpoint *mme,
			  struct dect_mm_detach_param *param)
{
}

static void mm_identity_ind(struct dect_handle *dh,
			    struct dect_mm_endpoint *mme,
			    struct dect_mm_identity_param *param)
{
	struct dect_mm_identity_param reply = {};

	dect_mm_identity_res(dh, mme, &reply);
}

static void mm_identity_cfm(struct dect_handle *dh,
			    struct dect_mm_endpoint *mme,
			    struct dect_mm_identity_param *param)
{
}

static void mm_identity_assign_ind(struct dect_handle *dh,
				   struct dect_mm_endpoint *mme,
				   struct dect_mm_identity_assign_param *param)
{
	struct dect_mm_identity_assign_param reply = {};

	dect_mm_identity_assign_res(dh, mme, false, &reply);
}

static void mm_identity_assign_cfm(struct dect_handle *dh,
				   struct dect_mm_endpoint *mme, bool accept,
				   struct dect_mm_identity_assign_param *param)
{
}

static void mm_info_ind(struct dect_handle *dh,
			struct dect_mm_endpoint *mme,
			struct dect_mm_info_param *param)
{
	struct dect_mm_info_param reply = {};

	dect_mm_info_res(dh, mme, false, &reply);
}

static void mm_info_cfm(struct dect_handle *dh,
			struct dect_mm_endpoint *mme, bool accept,
			struct dect_mm_info_param *param)
{
}

static void mm_iwu_ind(struct dect_handle *dh,
		       struct dect_mm_endpoint *mme,
		       struct dect_mm_iwu_param *param)
{
}

static struct dect_mm_ops dummy_mm_ops;

/*
 * SS Ops
 */

static void mnss_setup_ind(struct dect_handle *dh, struct dect_ss_endpoint *sse,
			   struct dect_mnss_param *param)
{

}

static void mnss_facility_ind(struct dect_handle *dh, struct dect_ss_endpoint *sse,
			      struct dect_mnss_param *param)
{

}

static void mnss_release_ind(struct dect_handle *dh, struct dect_ss_endpoint *sse,
			     struct dect_mnss_param *param)

{

}

static struct dect_ss_ops dummy_ss_ops;

/*
 * CLMS Ops
 */

static void mncl_unitdata_ind(struct dect_handle *dh,
			      enum dect_clms_message_types type,
			      struct dect_mncl_unitdata_param *param,
			      struct dect_msg_buf *mb)
{
}

static struct dect_clms_ops dummy_clms_ops;

void dect_dummy_ops_init(struct dect_ops *ops)
{
	struct dect_llme_ops_ *llme_ops;
	struct dect_lce_ops *lce_ops;
	struct dect_cc_ops *cc_ops;
	struct dect_mm_ops *mm_ops;
	struct dect_ss_ops *ss_ops;
	struct dect_clms_ops *clms_ops;

	if (!ops->llme_ops)
		ops->llme_ops = &dummy_llme_ops;
	llme_ops = (void *)ops->llme_ops;

	if (!llme_ops->mac_me_info_ind)
		llme_ops->mac_me_info_ind = llme_mac_me_info_ind;

	if (!ops->lce_ops)
		ops->lce_ops = &dummy_lce_ops;
	lce_ops = (void *)ops->lce_ops;

	if (!lce_ops->lce_page_response)
		lce_ops->lce_page_response = lce_page_response;
	if (!lce_ops->lce_group_ring_ind)
		lce_ops->lce_group_ring_ind = lce_group_ring_ind;
	if (!lce_ops->dl_establish_cfm)
		lce_ops->dl_establish_cfm = dl_establish_cfm;

	if (!ops->cc_ops)
		ops->cc_ops = &dummy_cc_ops;
	cc_ops = (void *)ops->cc_ops;

	if (!cc_ops->mncc_setup_ind)
		cc_ops->mncc_setup_ind = mncc_setup_ind;
	if (!cc_ops->mncc_setup_ack_ind)
		cc_ops->mncc_setup_ack_ind = mncc_setup_ack_ind;
	if (!cc_ops->mncc_reject_ind)
		cc_ops->mncc_reject_ind = mncc_reject_ind;
	if (!cc_ops->mncc_call_proc_ind)
		cc_ops->mncc_call_proc_ind = mncc_call_proc_ind;
	if (!cc_ops->mncc_alert_ind)
		cc_ops->mncc_alert_ind = mncc_alert_ind;
	if (!cc_ops->mncc_connect_ind)
		cc_ops->mncc_connect_ind = mncc_connect_ind;
	if (!cc_ops->mncc_connect_cfm)
		cc_ops->mncc_connect_cfm = mncc_connect_cfm;
	if (!cc_ops->mncc_release_ind)
		cc_ops->mncc_release_ind = mncc_release_ind;
	if (!cc_ops->mncc_release_cfm)
		cc_ops->mncc_release_cfm = mncc_release_cfm;
	if (!cc_ops->mncc_facility_ind)
		cc_ops->mncc_facility_ind = mncc_facility_ind;
	if (!cc_ops->mncc_info_ind)
		cc_ops->mncc_info_ind = mncc_info_ind;
	if (!cc_ops->mncc_modify_ind)
		cc_ops->mncc_modify_ind = mncc_modify_ind;
	if (!cc_ops->mncc_modify_cfm)
		cc_ops->mncc_modify_cfm = mncc_modify_cfm;
	if (!cc_ops->mncc_hold_ind)
		cc_ops->mncc_hold_ind = mncc_hold_ind;
	if (!cc_ops->mncc_hold_cfm)
		cc_ops->mncc_hold_cfm = mncc_hold_cfm;
	if (!cc_ops->mncc_retrieve_ind)
		cc_ops->mncc_retrieve_ind = mncc_retrieve_ind;
	if (!cc_ops->mncc_retrieve_cfm)
		cc_ops->mncc_retrieve_cfm = mncc_retrieve_cfm;
	if (!cc_ops->mncc_iwu_info_ind)
		cc_ops->mncc_iwu_info_ind = mncc_iwu_info_ind;
	if (!cc_ops->dl_u_data_ind)
		cc_ops->dl_u_data_ind = dl_u_data_ind;

	if (!ops->mm_ops)
		ops->mm_ops = &dummy_mm_ops;
	mm_ops = (void *)ops->mm_ops;

	if (!mm_ops->mm_access_rights_ind)
		mm_ops->mm_access_rights_ind = mm_access_rights_ind;
	if (!mm_ops->mm_access_rights_cfm)
		mm_ops->mm_access_rights_cfm = mm_access_rights_cfm;
	if (!mm_ops->mm_access_rights_terminate_ind)
		mm_ops->mm_access_rights_terminate_ind = mm_access_rights_terminate_ind;
	if (!mm_ops->mm_access_rights_terminate_cfm)
		mm_ops->mm_access_rights_terminate_cfm = mm_access_rights_terminate_cfm;
	if (!mm_ops->mm_key_allocate_ind)
		mm_ops->mm_key_allocate_ind = mm_key_allocate_ind;
	if (!mm_ops->mm_authenticate_ind)
		mm_ops->mm_authenticate_ind = mm_authenticate_ind;
	if (!mm_ops->mm_authenticate_cfm)
		mm_ops->mm_authenticate_cfm = mm_authenticate_cfm;
	if (!mm_ops->mm_cipher_ind)
		mm_ops->mm_cipher_ind = mm_cipher_ind;
	if (!mm_ops->mm_cipher_cfm)
		mm_ops->mm_cipher_cfm = mm_cipher_cfm;
	if (!mm_ops->mm_locate_ind)
		mm_ops->mm_locate_ind = mm_locate_ind;
	if (!mm_ops->mm_locate_cfm)
		mm_ops->mm_locate_cfm = mm_locate_cfm;
	if (!mm_ops->mm_authenticate_ind)
		mm_ops->mm_detach_ind = mm_detach_ind;
	if (!mm_ops->mm_identity_ind)
		mm_ops->mm_identity_ind = mm_identity_ind;
	if (!mm_ops->mm_identity_cfm)
		mm_ops->mm_identity_cfm = mm_identity_cfm;
	if (!mm_ops->mm_identity_assign_ind)
		mm_ops->mm_identity_assign_ind = mm_identity_assign_ind;
	if (!mm_ops->mm_identity_assign_cfm)
		mm_ops->mm_identity_assign_cfm = mm_identity_assign_cfm;
	if (!mm_ops->mm_info_ind)
		mm_ops->mm_info_ind = mm_info_ind;
	if (!mm_ops->mm_info_cfm)
		mm_ops->mm_info_cfm = mm_info_cfm;
	if (!mm_ops->mm_iwu_ind)
		mm_ops->mm_iwu_ind = mm_iwu_ind;

	if (!ops->ss_ops)
		ops->ss_ops = &dummy_ss_ops;
	ss_ops = (void *)ops->ss_ops;

	if (!ss_ops->mnss_setup_ind)
		ss_ops->mnss_setup_ind = mnss_setup_ind;
	if (!ss_ops->mnss_facility_ind)
		ss_ops->mnss_facility_ind = mnss_facility_ind;
	if (!ss_ops->mnss_release_ind)
		ss_ops->mnss_release_ind = mnss_release_ind;

	if (!ops->clms_ops)
		ops->clms_ops = &dummy_clms_ops;
	clms_ops = (void *)ops->clms_ops;

	if (!clms_ops->mncl_unitdata_ind)
		clms_ops->mncl_unitdata_ind = mncl_unitdata_ind;
}