blob: 6a605e4fe22073279d62cf62b3792639e5f62fd4 [file] [log] [blame]
Shad Ansarib7b0ced2018-05-11 21:53:32 +00001/*
Nicolas Palpacuerb78def42018-06-07 12:55:26 -04002 Copyright (C) 2018 Open Networking Foundation
Shad Ansarib7b0ced2018-05-11 21:53:32 +00003
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include <iostream>
19#include <memory>
20#include <string>
21
22#include "Queue.h"
23#include <iostream>
24#include <sstream>
25
26#include "core.h"
27#include "indications.h"
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -040028#include "stats_collection.h"
Nicolas Palpacuer73222e02018-07-16 12:20:26 -040029#include "error_format.h"
Shad Ansarib7b0ced2018-05-11 21:53:32 +000030
31extern "C"
32{
33#include <bcmos_system.h>
34#include <bal_api.h>
35#include <bal_api_end.h>
36}
37
38Status Enable_() {
39 static bool enabled = false;
40 bcmbal_access_terminal_cfg acc_term_obj;
41 bcmbal_access_terminal_key key = { };
42
43 if (!enabled) {
44 std::cout << "Enable OLT" << std::endl;
45 key.access_term_id = DEFAULT_ATERM_ID;
46 BCMBAL_CFG_INIT(&acc_term_obj, access_terminal, key);
47 BCMBAL_CFG_PROP_SET(&acc_term_obj, access_terminal, admin_state, BCMBAL_STATE_UP);
Nicolas Palpacuer73222e02018-07-16 12:20:26 -040048 bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(acc_term_obj.hdr));
49 if (err) {
Shad Ansarib7b0ced2018-05-11 21:53:32 +000050 std::cout << "ERROR: Failed to enable OLT" << std::endl;
Nicolas Palpacuer73222e02018-07-16 12:20:26 -040051 return bcm_to_grpc_err(err, "Failed to enable OLT");
Shad Ansarib7b0ced2018-05-11 21:53:32 +000052 }
53 enabled = true;
54 }
55 return Status::OK;
56}
57
58Status EnablePonIf_(uint32_t intf_id) {
59 bcmbal_interface_cfg interface_obj;
60 bcmbal_interface_key interface_key;
61
62 interface_key.intf_id = intf_id;
63 interface_key.intf_type = BCMBAL_INTF_TYPE_PON;
64
65 BCMBAL_CFG_INIT(&interface_obj, interface, interface_key);
66 BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_UP);
67
Nicolas Palpacuer73222e02018-07-16 12:20:26 -040068 bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr));
69 if (err) {
Shad Ansarib7b0ced2018-05-11 21:53:32 +000070 std::cout << "ERROR: Failed to enable PON interface: " << intf_id << std::endl;
Nicolas Palpacuer73222e02018-07-16 12:20:26 -040071 return bcm_to_grpc_err(err, "Failed to enable PON interface");
Shad Ansarib7b0ced2018-05-11 21:53:32 +000072 }
73
74 return Status::OK;
75}
76
Nicolas Palpacuer05ea0ea2018-07-06 11:47:21 -040077Status DisablePonIf_(uint32_t intf_id) {
78 bcmbal_interface_cfg interface_obj;
79 bcmbal_interface_key interface_key;
80
81 interface_key.intf_id = intf_id;
82 interface_key.intf_type = BCMBAL_INTF_TYPE_PON;
83
84 BCMBAL_CFG_INIT(&interface_obj, interface, interface_key);
85 BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_DOWN);
86
Nicolas Palpacuer73222e02018-07-16 12:20:26 -040087 bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr));
88 if (err) {
Nicolas Palpacuer05ea0ea2018-07-06 11:47:21 -040089 std::cout << "ERROR: Failed to disable PON interface: " << intf_id << std::endl;
Nicolas Palpacuer73222e02018-07-16 12:20:26 -040090 return bcm_to_grpc_err(err, "Failed to disable PON interface");
Nicolas Palpacuer05ea0ea2018-07-06 11:47:21 -040091 }
92
93 return Status::OK;
94}
95
Shad Ansarib7b0ced2018-05-11 21:53:32 +000096Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id,
97 const char *vendor_id, const char *vendor_specific) {
98
99 bcmbal_subscriber_terminal_cfg sub_term_obj = {};
100 bcmbal_subscriber_terminal_key subs_terminal_key;
101 bcmbal_serial_number serial_num = {};
102 bcmbal_registration_id registration_id = {};
103
104 std::cout << "Enabling ONU " << onu_id << " on PON " << intf_id << std::endl;
105 std::cout << "Vendor Id " << vendor_id
106 << "Vendor Specific Id " << vendor_specific
107 << std::endl;
108
109 subs_terminal_key.sub_term_id = onu_id;
110 subs_terminal_key.intf_id = intf_id;
111 BCMBAL_CFG_INIT(&sub_term_obj, subscriber_terminal, subs_terminal_key);
112
113 memcpy(serial_num.vendor_id, vendor_id, 4);
114 memcpy(serial_num.vendor_specific, vendor_specific, 4);
115 BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, serial_number, serial_num);
116
Shad Ansaricb004c52018-05-30 18:07:23 +0000117#if 0
118 // Commenting out as this is causing issues with onu activation
119 // with BAL 2.6 (Broadcom CS5248819).
120
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000121 // FIXME - Use a default (all zeros) registration id.
122 memset(registration_id.arr, 0, sizeof(registration_id.arr));
123 BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, registration_id, registration_id);
Shad Ansaricb004c52018-05-30 18:07:23 +0000124#endif
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000125
126 BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, admin_state, BCMBAL_STATE_UP);
127
Nicolas Palpacuer73222e02018-07-16 12:20:26 -0400128 bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(sub_term_obj.hdr));
129 if (err) {
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000130 std::cout << "ERROR: Failed to enable ONU: " << std::endl;
Nicolas Palpacuer73222e02018-07-16 12:20:26 -0400131 return bcm_to_grpc_err(err, "Failed to enable ONU");
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000132 }
133
134 return SchedAdd_(intf_id, onu_id, mk_agg_port_id(onu_id));
135
136 //return Status::OK;
137}
138
139#define MAX_CHAR_LENGTH 20
140#define MAX_OMCI_MSG_LENGTH 44
141Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt) {
142 bcmbal_u8_list_u32_max_2048 buf; /* A structure with a msg pointer and length value */
143 bcmos_errno err = BCM_ERR_OK;
144
145 /* The destination of the OMCI packet is a registered ONU on the OLT PON interface */
146 bcmbal_dest proxy_pkt_dest;
147
148 proxy_pkt_dest.type = BCMBAL_DEST_TYPE_ITU_OMCI_CHANNEL;
149 proxy_pkt_dest.u.itu_omci_channel.sub_term_id = onu_id;
150 proxy_pkt_dest.u.itu_omci_channel.intf_id = intf_id;
151
152 // ???
153 if ((pkt.size()/2) > MAX_OMCI_MSG_LENGTH) {
154 buf.len = MAX_OMCI_MSG_LENGTH;
155 } else {
156 buf.len = pkt.size()/2;
157 }
158
159 /* Send the OMCI packet using the BAL remote proxy API */
160 uint16_t idx1 = 0;
161 uint16_t idx2 = 0;
162 uint8_t arraySend[buf.len];
163 char str1[MAX_CHAR_LENGTH];
164 char str2[MAX_CHAR_LENGTH];
165 memset(&arraySend, 0, buf.len);
166
167 std::cout << "Sending omci msg to ONU of length is "
168 << buf.len
169 << std::endl;
170
171 for (idx1=0,idx2=0; idx1<((buf.len)*2); idx1++,idx2++) {
172 sprintf(str1,"%c", pkt[idx1]);
173 sprintf(str2,"%c", pkt[++idx1]);
174 strcat(str1,str2);
175 arraySend[idx2] = strtol(str1, NULL, 16);
176 }
177
178 buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t));
179 memcpy(buf.val, (uint8_t *)arraySend, buf.len);
180
181 std::cout << "After converting bytes to hex "
182 << buf.val << buf.len << std::endl;
183
184 err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len);
185
186 std::cout << "OMCI request msg of length " << buf.len
187 << " sent to ONU" << onu_id
188 << " through PON " << intf_id << std::endl;
189
190 free(buf.val);
191
192 return Status::OK;
193}
194
195Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt) {
196 bcmos_errno err = BCM_ERR_OK;
197 bcmbal_dest proxy_pkt_dest;
198 bcmbal_u8_list_u32_max_2048 buf;
199
200 proxy_pkt_dest.type = BCMBAL_DEST_TYPE_SUB_TERM,
201 proxy_pkt_dest.u.sub_term.sub_term_id = onu_id;
202 proxy_pkt_dest.u.sub_term.intf_id = intf_id;
203
204 buf.len = pkt.size();
205 buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t));
206 memcpy(buf.val, (uint8_t *)pkt.data(), buf.len);
207
208 err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len);
209
210 std::cout << "Packet out of length " << buf.len
211 << " sent to ONU" << onu_id
212 << " through PON " << intf_id << std::endl;
213
214 free(buf.val);
215
216 return Status::OK;
217}
218
Nicolas Palpacuerb78def42018-06-07 12:55:26 -0400219Status UplinkPacketOut_(uint32_t intf_id, const std::string pkt) {
220 bcmos_errno err = BCM_ERR_OK;
221 bcmbal_dest proxy_pkt_dest;
222 bcmbal_u8_list_u32_max_2048 buf;
223
224 proxy_pkt_dest.type = BCMBAL_DEST_TYPE_NNI,
225 proxy_pkt_dest.u.nni.intf_id = intf_id;
226
227 buf.len = pkt.size();
228 buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t));
229 memcpy(buf.val, (uint8_t *)pkt.data(), buf.len);
230
231 err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len);
232
233 std::cout << "Packet out of length " << buf.len
234 << " sent through uplink port " << intf_id << std::endl;
235
236 free(buf.val);
237
238 return Status::OK;
239}
240
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000241Status FlowAdd_(uint32_t onu_id,
242 uint32_t flow_id, const std::string flow_type,
243 uint32_t access_intf_id, uint32_t network_intf_id,
Nicolas Palpacuerd6cf5aa2018-07-16 15:14:39 -0400244 uint32_t gemport_id, uint32_t priority_value,
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000245 const ::openolt::Classifier& classifier,
246 const ::openolt::Action& action) {
247 bcmos_errno err;
248 bcmbal_flow_cfg cfg;
249 bcmbal_flow_key key = { };
250
251 std::cout << "flow add -"
252 << " intf_id:" << access_intf_id
253 << " onu_id:" << onu_id
254 << " flow_id:" << flow_id
255 << " flow_type:" << flow_type
256 << " gemport_id:" << gemport_id
257 << " network_intf_id:" << network_intf_id
258 << std::endl;
259
260 key.flow_id = flow_id;
261 if (flow_type.compare("upstream") == 0 ) {
262 key.flow_type = BCMBAL_FLOW_TYPE_UPSTREAM;
263 } else if (flow_type.compare("downstream") == 0) {
264 key.flow_type = BCMBAL_FLOW_TYPE_DOWNSTREAM;
265 } else {
266 std::cout << "Invalid flow type " << flow_type << std::endl;
Nicolas Palpacuer73222e02018-07-16 12:20:26 -0400267 return bcm_to_grpc_err(BCM_ERR_PARM, "Invalid flow type");
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000268 }
269
270 BCMBAL_CFG_INIT(&cfg, flow, key);
271
272 BCMBAL_CFG_PROP_SET(&cfg, flow, admin_state, BCMBAL_STATE_UP);
273 BCMBAL_CFG_PROP_SET(&cfg, flow, access_int_id, access_intf_id);
274 BCMBAL_CFG_PROP_SET(&cfg, flow, network_int_id, network_intf_id);
275 BCMBAL_CFG_PROP_SET(&cfg, flow, sub_term_id, onu_id);
276 BCMBAL_CFG_PROP_SET(&cfg, flow, svc_port_id, gemport_id);
Nicolas Palpacuerd6cf5aa2018-07-16 15:14:39 -0400277 BCMBAL_CFG_PROP_SET(&cfg, flow, priority, priority_value);
278
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000279
280 {
281 bcmbal_classifier val = { };
282
283 if (classifier.o_tpid()) {
284 val.o_tpid = classifier.o_tpid();
285 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_O_TPID;
286 }
287
288 if (classifier.o_vid()) {
289 val.o_vid = classifier.o_vid();
290 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_O_VID;
291 }
292
293 if (classifier.i_tpid()) {
294 val.i_tpid = classifier.i_tpid();
295 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_I_TPID;
296 }
297
298 if (classifier.i_vid()) {
299 val.i_vid = classifier.i_vid();
300 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_I_VID;
301 }
302
303 if (classifier.o_pbits()) {
304 val.o_pbits = classifier.o_pbits();
305 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_O_PBITS;
306 }
307
308 if (classifier.i_pbits()) {
309 val.i_pbits = classifier.i_pbits();
310 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_I_PBITS;
311 }
312
313 if (classifier.eth_type()) {
314 val.ether_type = classifier.eth_type();
315 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_ETHER_TYPE;
316 }
317
318 /*
319 if (classifier.dst_mac()) {
320 val.dst_mac = classifier.dst_mac();
321 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_DST_MAC;
322 }
323
324 if (classifier.src_mac()) {
325 val.src_mac = classifier.src_mac();
326 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_SRC_MAC;
327 }
328 */
329
330 if (classifier.ip_proto()) {
331 val.ip_proto = classifier.ip_proto();
332 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_IP_PROTO;
333 }
334
335 /*
336 if (classifier.dst_ip()) {
337 val.dst_ip = classifier.dst_ip();
338 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_DST_IP;
339 }
340
341 if (classifier.src_ip()) {
342 val.src_ip = classifier.src_ip();
343 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_SRC_IP;
344 }
345 */
346
347 if (classifier.src_port()) {
348 val.src_port = classifier.src_port();
349 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_SRC_PORT;
350 }
351
352 if (classifier.dst_port()) {
353 val.dst_port = classifier.dst_port();
354 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_DST_PORT;
355 }
356
357 if (!classifier.pkt_tag_type().empty()) {
358 if (classifier.pkt_tag_type().compare("untagged") == 0) {
359 val.pkt_tag_type = BCMBAL_PKT_TAG_TYPE_UNTAGGED;
360 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_PKT_TAG_TYPE;
361 } else if (classifier.pkt_tag_type().compare("single_tag") == 0) {
362 val.pkt_tag_type = BCMBAL_PKT_TAG_TYPE_SINGLE_TAG;
363 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_PKT_TAG_TYPE;
364 } else if (classifier.pkt_tag_type().compare("double_tag") == 0) {
365 val.pkt_tag_type = BCMBAL_PKT_TAG_TYPE_DOUBLE_TAG;
366 val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_PKT_TAG_TYPE;
367 }
368 }
369
370 BCMBAL_CFG_PROP_SET(&cfg, flow, classifier, val);
371 }
372
373 {
374 bcmbal_action val = { };
375
376 const ::openolt::ActionCmd& cmd = action.cmd();
377
378 if (cmd.add_outer_tag()) {
379 val.cmds_bitmask |= BCMBAL_ACTION_CMD_ID_ADD_OUTER_TAG;
380 val.presence_mask |= BCMBAL_ACTION_ID_CMDS_BITMASK;
381 }
382
383 if (cmd.remove_outer_tag()) {
384 val.cmds_bitmask |= BCMBAL_ACTION_CMD_ID_REMOVE_OUTER_TAG;
385 val.presence_mask |= BCMBAL_ACTION_ID_CMDS_BITMASK;
386 }
387
388 if (cmd.trap_to_host()) {
389 val.cmds_bitmask |= BCMBAL_ACTION_CMD_ID_TRAP_TO_HOST;
390 val.presence_mask |= BCMBAL_ACTION_ID_CMDS_BITMASK;
391 }
392
393 if (action.o_vid()) {
394 val.o_vid = action.o_vid();
395 val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_O_VID;
396 }
397
398 if (action.o_pbits()) {
399 val.o_pbits = action.o_pbits();
400 val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_O_PBITS;
401 }
402
403 if (action.o_tpid()) {
404 val.o_tpid = action.o_tpid();
405 val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_O_TPID;
406 }
407
408 if (action.i_vid()) {
409 val.i_vid = action.i_vid();
410 val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_I_VID;
411 }
412
413 if (action.i_pbits()) {
414 val.i_pbits = action.i_pbits();
415 val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_I_PBITS;
416 }
417
418 if (action.i_tpid()) {
419 val.i_tpid = action.i_tpid();
420 val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_I_TPID;
421 }
422
423 BCMBAL_CFG_PROP_SET(&cfg, flow, action, val);
424 }
425
426 {
427 bcmbal_tm_sched_id val;
428 val = (bcmbal_tm_sched_id) mk_sched_id(onu_id);
429 BCMBAL_CFG_PROP_SET(&cfg, flow, dba_tm_sched_id, val);
430 }
431
Nicolas Palpacuer73222e02018-07-16 12:20:26 -0400432 err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(cfg.hdr));
433 if (err) {
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000434 std::cout << "ERROR: flow add failed" << std::endl;
Nicolas Palpacuer73222e02018-07-16 12:20:26 -0400435 return bcm_to_grpc_err(err, "flow add failed");
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000436 }
437
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -0400438 register_new_flow(key);
439
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000440 return Status::OK;
441}
442
443Status SchedAdd_(int intf_id, int onu_id, int agg_port_id) {
444 bcmbal_tm_sched_cfg cfg;
445 bcmbal_tm_sched_key key = { };
446 bcmbal_tm_sched_type sched_type;
447
448 key.id = mk_sched_id(onu_id);
449 key.dir = BCMBAL_TM_SCHED_DIR_US;
450
451 BCMBAL_CFG_INIT(&cfg, tm_sched, key);
452
453 {
454 bcmbal_tm_sched_owner val = { };
455
456 val.type = BCMBAL_TM_SCHED_OWNER_TYPE_AGG_PORT;
457 val.u.agg_port.intf_id = (bcmbal_intf_id) intf_id;
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -0400458 val.u.agg_port.presence_mask = val.u.agg_port.presence_mask | BCMBAL_TM_SCHED_OWNER_AGG_PORT_ID_INTF_ID;
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000459 val.u.agg_port.sub_term_id = (bcmbal_sub_id) onu_id;
460 val.u.agg_port.presence_mask = val.u.agg_port.presence_mask | BCMBAL_TM_SCHED_OWNER_AGG_PORT_ID_SUB_TERM_ID;
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -0400461 val.u.agg_port.agg_port_id = (bcmbal_aggregation_port_id) agg_port_id;
462 val.u.agg_port.presence_mask = val.u.agg_port.presence_mask | BCMBAL_TM_SCHED_OWNER_AGG_PORT_ID_AGG_PORT_ID;
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000463
464 BCMBAL_CFG_PROP_SET(&cfg, tm_sched, owner, val);
465 }
466
Nicolas Palpacuer73222e02018-07-16 12:20:26 -0400467 bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(cfg.hdr));
468 if (err) {
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000469 std::cout << "ERROR: Failed to create upstream DBA sched"
470 << " id:" << key.id
471 << " intf_id:" << intf_id
472 << " onu_id:" << onu_id << std::endl;
Nicolas Palpacuer73222e02018-07-16 12:20:26 -0400473 return bcm_to_grpc_err(err, "Failed to create upstream DBA sched");
Shad Ansarib7b0ced2018-05-11 21:53:32 +0000474 //return 1;
475 }
476 std::cout << "create upstream DBA sched"
477 << " id:" << key.id
478 << " intf_id:" << intf_id
479 << " onu_id:" << onu_id << std::endl;
480
481 return Status::OK;
482 //return 0;
483}