]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_bfd.c
Merge pull request #9053 from opensourcerouting/ospfv3-debug-guard
[mirror_frr.git] / bgpd / bgp_bfd.c
1 /**
2 * bgp_bfd.c: BGP BFD handling routines
3 *
4 * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
5 *
6 * This file is part of GNU Zebra.
7 *
8 * GNU Zebra is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * GNU Zebra is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #include <zebra.h>
24
25 #include "command.h"
26 #include "linklist.h"
27 #include "memory.h"
28 #include "prefix.h"
29 #include "thread.h"
30 #include "buffer.h"
31 #include "stream.h"
32 #include "vrf.h"
33 #include "zclient.h"
34 #include "bfd.h"
35 #include "lib/json.h"
36 #include "filter.h"
37
38 #include "bgpd/bgpd.h"
39 #include "bgp_fsm.h"
40 #include "bgpd/bgp_bfd.h"
41 #include "bgpd/bgp_debug.h"
42 #include "bgpd/bgp_vty.h"
43
44 DEFINE_MTYPE_STATIC(BGPD, BFD_CONFIG, "BFD configuration data");
45
46 extern struct zclient *zclient;
47
48 static void bfd_session_status_update(struct bfd_session_params *bsp,
49 const struct bfd_session_status *bss,
50 void *arg)
51 {
52 struct peer *peer = arg;
53
54 if (BGP_DEBUG(bfd, BFD_LIB))
55 zlog_debug("%s: neighbor %s vrf %s(%u) bfd state %s -> %s",
56 __func__, peer->conf_if ? peer->conf_if : peer->host,
57 bfd_sess_vrf(bsp), bfd_sess_vrf_id(bsp),
58 bfd_get_status_str(bss->previous_state),
59 bfd_get_status_str(bss->state));
60
61 if (bss->state == BSS_DOWN && bss->previous_state == BSS_UP) {
62 if (CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_MODE)
63 && bfd_sess_cbit(bsp) && !bss->remote_cbit) {
64 if (BGP_DEBUG(bfd, BFD_LIB))
65 zlog_info(
66 "%s BFD DOWN message ignored in the process of graceful restart when C bit is cleared",
67 peer->host);
68 return;
69 }
70 peer->last_reset = PEER_DOWN_BFD_DOWN;
71 BGP_EVENT_ADD(peer, BGP_Stop);
72 }
73
74 if (bss->state == BSS_UP && bss->previous_state != BSS_UP
75 && !peer_established(peer)) {
76 if (!BGP_PEER_START_SUPPRESSED(peer)) {
77 bgp_fsm_nht_update(peer, true);
78 BGP_EVENT_ADD(peer, BGP_Start);
79 }
80 }
81 }
82
83 void bgp_peer_config_apply(struct peer *p, struct peer_group *pg)
84 {
85 struct listnode *n;
86 struct peer *pn;
87 struct peer *gconfig;
88
89 /* When called on a group, apply to all peers. */
90 if (CHECK_FLAG(p->sflags, PEER_STATUS_GROUP)) {
91 for (ALL_LIST_ELEMENTS_RO(p->group->peer, n, pn))
92 bgp_peer_config_apply(pn, pg);
93 return;
94 }
95
96 /* No group, just use current configuration. */
97 if (pg == NULL || pg->conf->bfd_config == NULL) {
98 bfd_sess_set_timers(p->bfd_config->session,
99 p->bfd_config->detection_multiplier,
100 p->bfd_config->min_rx,
101 p->bfd_config->min_tx);
102 bfd_sess_set_cbit(p->bfd_config->session, p->bfd_config->cbit);
103 bfd_sess_set_profile(p->bfd_config->session,
104 p->bfd_config->profile);
105 bfd_sess_install(p->bfd_config->session);
106 return;
107 }
108
109 /*
110 * Check if the group configuration was overwritten or apply group
111 * configuration.
112 */
113 gconfig = pg->conf;
114
115 /*
116 * If using default control plane independent configuration,
117 * then prefer group's (e.g. it means it wasn't manually configured).
118 */
119 if (!p->bfd_config->cbit)
120 bfd_sess_set_cbit(p->bfd_config->session,
121 gconfig->bfd_config->cbit);
122 else
123 bfd_sess_set_cbit(p->bfd_config->session, p->bfd_config->cbit);
124
125 /* If no profile was specified in peer, then use the group profile. */
126 if (p->bfd_config->profile[0] == 0)
127 bfd_sess_set_profile(p->bfd_config->session,
128 gconfig->bfd_config->profile);
129 else
130 bfd_sess_set_profile(p->bfd_config->session,
131 p->bfd_config->profile);
132
133 /* If no specific timers were configured, then use the group timers. */
134 if (p->bfd_config->detection_multiplier == BFD_DEF_DETECT_MULT
135 || p->bfd_config->min_rx == BFD_DEF_MIN_RX
136 || p->bfd_config->min_tx == BFD_DEF_MIN_TX)
137 bfd_sess_set_timers(p->bfd_config->session,
138 gconfig->bfd_config->detection_multiplier,
139 gconfig->bfd_config->min_rx,
140 gconfig->bfd_config->min_tx);
141 else
142 bfd_sess_set_timers(p->bfd_config->session,
143 p->bfd_config->detection_multiplier,
144 p->bfd_config->min_rx,
145 p->bfd_config->min_tx);
146
147 bfd_sess_install(p->bfd_config->session);
148 }
149
150 void bgp_peer_bfd_update_source(struct peer *p)
151 {
152 struct bfd_session_params *session = p->bfd_config->session;
153 bool changed = false;
154 int family;
155 union {
156 struct in_addr v4;
157 struct in6_addr v6;
158 } src, dst;
159
160 /* Nothing to do for groups. */
161 if (CHECK_FLAG(p->sflags, PEER_STATUS_GROUP))
162 return;
163
164 /* Update peer's source/destination addresses. */
165 bfd_sess_addresses(session, &family, &src.v6, &dst.v6);
166 if (family == AF_INET) {
167 if ((p->su_local
168 && p->su_local->sin.sin_addr.s_addr != src.v4.s_addr)
169 || p->su.sin.sin_addr.s_addr != dst.v4.s_addr) {
170 if (BGP_DEBUG(bfd, BFD_LIB))
171 zlog_debug(
172 "%s: address [%pI4->%pI4] to [%pI4->%pI4]",
173 __func__, &src.v4, &dst.v4,
174 p->su_local ? &p->su_local->sin.sin_addr
175 : &src.v4,
176 &p->su.sin.sin_addr);
177
178 bfd_sess_set_ipv4_addrs(
179 session,
180 p->su_local ? &p->su_local->sin.sin_addr : NULL,
181 &p->su.sin.sin_addr);
182 changed = true;
183 }
184 } else {
185 if ((p->su_local
186 && memcmp(&p->su_local->sin6, &src.v6, sizeof(src.v6)))
187 || memcmp(&p->su.sin6, &dst.v6, sizeof(dst.v6))) {
188 if (BGP_DEBUG(bfd, BFD_LIB))
189 zlog_debug(
190 "%s: address [%pI6->%pI6] to [%pI6->%pI6]",
191 __func__, &src.v6, &dst.v6,
192 p->su_local
193 ? &p->su_local->sin6.sin6_addr
194 : &src.v6,
195 &p->su.sin6.sin6_addr);
196
197 bfd_sess_set_ipv6_addrs(
198 session,
199 p->su_local ? &p->su_local->sin6.sin6_addr
200 : NULL,
201 &p->su.sin6.sin6_addr);
202 changed = true;
203 }
204 }
205
206 /* Update interface. */
207 if (p->nexthop.ifp && bfd_sess_interface(session) == NULL) {
208 if (BGP_DEBUG(bfd, BFD_LIB))
209 zlog_debug("%s: interface none to %s", __func__,
210 p->nexthop.ifp->name);
211
212 bfd_sess_set_interface(session, p->nexthop.ifp->name);
213 changed = true;
214 }
215
216 /*
217 * Update TTL.
218 *
219 * Two cases:
220 * - We detected that the peer is a hop away from us (remove multi hop).
221 * (this happens when `p->shared_network` is set to `true`)
222 * - eBGP multi hop / TTL security changed.
223 */
224 if (!PEER_IS_MULTIHOP(p) && bfd_sess_hop_count(session) > 1) {
225 if (BGP_DEBUG(bfd, BFD_LIB))
226 zlog_debug("%s: TTL %d to 1", __func__,
227 bfd_sess_hop_count(session));
228
229 bfd_sess_set_hop_count(session, 1);
230 changed = true;
231 }
232 if (PEER_IS_MULTIHOP(p) && p->ttl != bfd_sess_hop_count(session)) {
233 if (BGP_DEBUG(bfd, BFD_LIB))
234 zlog_debug("%s: TTL %d to %d", __func__,
235 bfd_sess_hop_count(session), p->ttl);
236
237 bfd_sess_set_hop_count(session, p->ttl);
238 changed = true;
239 }
240
241 /* Update VRF. */
242 if (bfd_sess_vrf_id(session) != p->bgp->vrf_id) {
243 if (BGP_DEBUG(bfd, BFD_LIB))
244 zlog_debug(
245 "%s: VRF %s(%d) to %s(%d)", __func__,
246 bfd_sess_vrf(session), bfd_sess_vrf_id(session),
247 vrf_id_to_name(p->bgp->vrf_id), p->bgp->vrf_id);
248
249 bfd_sess_set_vrf(session, p->bgp->vrf_id);
250 changed = true;
251 }
252
253 if (changed)
254 bfd_sess_install(session);
255 }
256
257 /**
258 * Reset BFD configuration data structure to its defaults settings.
259 */
260 static void bgp_peer_bfd_reset(struct peer *p)
261 {
262 /* Set defaults. */
263 p->bfd_config->detection_multiplier = BFD_DEF_DETECT_MULT;
264 p->bfd_config->min_rx = BFD_DEF_MIN_RX;
265 p->bfd_config->min_tx = BFD_DEF_MIN_TX;
266 p->bfd_config->cbit = false;
267 p->bfd_config->profile[0] = 0;
268 }
269
270 void bgp_peer_configure_bfd(struct peer *p, bool manual)
271 {
272 /* Groups should not call this. */
273 assert(!CHECK_FLAG(p->sflags, PEER_STATUS_GROUP));
274
275 /* Already configured, skip it. */
276 if (p->bfd_config) {
277 /* If manually active update flag. */
278 if (!p->bfd_config->manual)
279 p->bfd_config->manual = manual;
280
281 return;
282 }
283
284 /* Allocate memory for configuration overrides. */
285 p->bfd_config = XCALLOC(MTYPE_BFD_CONFIG, sizeof(*p->bfd_config));
286 p->bfd_config->manual = manual;
287
288 /* Create new session and assign callback. */
289 p->bfd_config->session = bfd_sess_new(bfd_session_status_update, p);
290 bgp_peer_bfd_reset(p);
291
292 /* Configure session with basic BGP peer data. */
293 if (p->su.sa.sa_family == AF_INET)
294 bfd_sess_set_ipv4_addrs(p->bfd_config->session,
295 p->su_local ? &p->su_local->sin.sin_addr
296 : NULL,
297 &p->su.sin.sin_addr);
298 else
299 bfd_sess_set_ipv6_addrs(
300 p->bfd_config->session,
301 p->su_local ? &p->su_local->sin6.sin6_addr : NULL,
302 &p->su.sin6.sin6_addr);
303
304 bfd_sess_set_vrf(p->bfd_config->session, p->bgp->vrf_id);
305 bfd_sess_set_hop_count(p->bfd_config->session,
306 PEER_IS_MULTIHOP(p) ? p->ttl : 1);
307
308 if (p->nexthop.ifp)
309 bfd_sess_set_interface(p->bfd_config->session,
310 p->nexthop.ifp->name);
311 }
312
313 static void bgp_peer_remove_bfd(struct peer *p)
314 {
315 /* Groups should not call this. */
316 assert(!CHECK_FLAG(p->sflags, PEER_STATUS_GROUP));
317
318 /*
319 * Peer configuration was removed, however we must check if there
320 * is still a group configuration to keep this running.
321 */
322 if (p->group && p->group->conf->bfd_config) {
323 p->bfd_config->manual = false;
324 bgp_peer_bfd_reset(p);
325 bgp_peer_config_apply(p, p->group);
326 return;
327 }
328
329 if (p->bfd_config)
330 bfd_sess_free(&p->bfd_config->session);
331
332 XFREE(MTYPE_BFD_CONFIG, p->bfd_config);
333 }
334
335 static void bgp_group_configure_bfd(struct peer *p)
336 {
337 struct listnode *n;
338 struct peer *pn;
339
340 /* Peers should not call this. */
341 assert(CHECK_FLAG(p->sflags, PEER_STATUS_GROUP));
342
343 /* Already allocated: do nothing. */
344 if (p->bfd_config)
345 return;
346
347 p->bfd_config = XCALLOC(MTYPE_BFD_CONFIG, sizeof(*p->bfd_config));
348
349 /* Set defaults. */
350 p->bfd_config->detection_multiplier = BFD_DEF_DETECT_MULT;
351 p->bfd_config->min_rx = BFD_DEF_MIN_RX;
352 p->bfd_config->min_tx = BFD_DEF_MIN_TX;
353
354 for (ALL_LIST_ELEMENTS_RO(p->group->peer, n, pn))
355 bgp_peer_configure_bfd(pn, false);
356 }
357
358 static void bgp_group_remove_bfd(struct peer *p)
359 {
360 struct listnode *n;
361 struct peer *pn;
362
363 /* Peers should not call this. */
364 assert(CHECK_FLAG(p->sflags, PEER_STATUS_GROUP));
365
366 /* Already freed: do nothing. */
367 if (p->bfd_config == NULL)
368 return;
369
370 /* Free configuration and point to `NULL`. */
371 XFREE(MTYPE_BFD_CONFIG, p->bfd_config);
372
373 /* Now that it is `NULL` recalculate configuration for all peers. */
374 for (ALL_LIST_ELEMENTS_RO(p->group->peer, n, pn)) {
375 if (pn->bfd_config->manual)
376 bgp_peer_config_apply(pn, NULL);
377 else
378 bgp_peer_remove_bfd(pn);
379 }
380 }
381
382 void bgp_peer_remove_bfd_config(struct peer *p)
383 {
384 if (CHECK_FLAG(p->sflags, PEER_STATUS_GROUP))
385 bgp_group_remove_bfd(p);
386 else
387 bgp_peer_remove_bfd(p);
388 }
389
390 /*
391 * bgp_bfd_peer_config_write - Write the peer BFD configuration.
392 */
393 void bgp_bfd_peer_config_write(struct vty *vty, const struct peer *peer,
394 const char *addr)
395 {
396 /*
397 * Always show group BFD configuration, but peer only when explicitly
398 * configured.
399 */
400 if ((!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)
401 && peer->bfd_config->manual)
402 || CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
403 #if HAVE_BFDD > 0
404 vty_out(vty, " neighbor %s bfd\n", addr);
405 #else
406 vty_out(vty, " neighbor %s bfd %d %d %d\n", addr,
407 peer->bfd_config->detection_multiplier,
408 peer->bfd_config->min_rx, peer->bfd_config->min_tx);
409 #endif /* HAVE_BFDD */
410 }
411
412 if (peer->bfd_config->profile[0])
413 vty_out(vty, " neighbor %s bfd profile %s\n", addr,
414 peer->bfd_config->profile);
415
416 if (peer->bfd_config->cbit)
417 vty_out(vty, " neighbor %s bfd check-control-plane-failure\n",
418 addr);
419 }
420
421 /*
422 * bgp_bfd_show_info - Show the peer BFD information.
423 */
424 void bgp_bfd_show_info(struct vty *vty, const struct peer *peer,
425 json_object *json_neigh)
426 {
427 bfd_sess_show(vty, json_neigh, peer->bfd_config->session);
428 }
429
430 DEFUN (neighbor_bfd,
431 neighbor_bfd_cmd,
432 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd",
433 NEIGHBOR_STR
434 NEIGHBOR_ADDR_STR2
435 "Enables BFD support\n")
436 {
437 int idx_peer = 1;
438 struct peer *peer;
439
440 peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
441 if (!peer)
442 return CMD_WARNING_CONFIG_FAILED;
443
444 if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
445 bgp_group_configure_bfd(peer);
446 else
447 bgp_peer_configure_bfd(peer, true);
448
449 bgp_peer_config_apply(peer, peer->group);
450
451 return CMD_SUCCESS;
452 }
453
454 #if HAVE_BFDD > 0
455 DEFUN_HIDDEN(
456 #else
457 DEFUN(
458 #endif /* HAVE_BFDD */
459 neighbor_bfd_param,
460 neighbor_bfd_param_cmd,
461 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd (2-255) (50-60000) (50-60000)",
462 NEIGHBOR_STR
463 NEIGHBOR_ADDR_STR2
464 "Enables BFD support\n"
465 "Detect Multiplier\n"
466 "Required min receive interval\n"
467 "Desired min transmit interval\n")
468 {
469 int idx_peer = 1;
470 int idx_number_1 = 3;
471 int idx_number_2 = 4;
472 int idx_number_3 = 5;
473 long detection_multiplier, min_rx, min_tx;
474 struct peer *peer;
475
476 peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
477 if (!peer)
478 return CMD_WARNING_CONFIG_FAILED;
479
480 detection_multiplier = strtol(argv[idx_number_1]->arg, NULL, 10);
481 min_rx = strtol(argv[idx_number_2]->arg, NULL, 10);
482 min_tx = strtol(argv[idx_number_3]->arg, NULL, 10);
483
484 if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
485 bgp_group_configure_bfd(peer);
486 else
487 bgp_peer_configure_bfd(peer, true);
488
489 peer->bfd_config->detection_multiplier = detection_multiplier;
490 peer->bfd_config->min_rx = min_rx;
491 peer->bfd_config->min_tx = min_tx;
492 bgp_peer_config_apply(peer, peer->group);
493
494 return CMD_SUCCESS;
495 }
496
497 DEFUN (neighbor_bfd_check_controlplane_failure,
498 neighbor_bfd_check_controlplane_failure_cmd,
499 "[no] neighbor <A.B.C.D|X:X::X:X|WORD> bfd check-control-plane-failure",
500 NO_STR
501 NEIGHBOR_STR
502 NEIGHBOR_ADDR_STR2
503 "BFD support\n"
504 "Link dataplane status with BGP controlplane\n")
505 {
506 const char *no = strmatch(argv[0]->text, "no") ? "no" : NULL;
507 int idx_peer = 0;
508 struct peer *peer;
509
510 if (no)
511 idx_peer = 2;
512 else
513 idx_peer = 1;
514 peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
515 if (!peer) {
516 vty_out(vty, "%% Specify remote-as or peer-group commands first\n");
517 return CMD_WARNING_CONFIG_FAILED;
518 }
519
520 if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
521 bgp_group_configure_bfd(peer);
522 else
523 bgp_peer_configure_bfd(peer, true);
524
525 peer->bfd_config->cbit = no == NULL;
526 bgp_peer_config_apply(peer, peer->group);
527
528 return CMD_SUCCESS;
529 }
530
531 DEFUN (no_neighbor_bfd,
532 no_neighbor_bfd_cmd,
533 #if HAVE_BFDD > 0
534 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd",
535 #else
536 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd [(2-255) (50-60000) (50-60000)]",
537 #endif /* HAVE_BFDD */
538 NO_STR
539 NEIGHBOR_STR
540 NEIGHBOR_ADDR_STR2
541 "Disables BFD support\n"
542 #if HAVE_BFDD == 0
543 "Detect Multiplier\n"
544 "Required min receive interval\n"
545 "Desired min transmit interval\n"
546 #endif /* !HAVE_BFDD */
547 )
548 {
549 int idx_peer = 2;
550 struct peer *peer;
551
552 peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
553 if (!peer)
554 return CMD_WARNING_CONFIG_FAILED;
555
556 if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
557 bgp_group_remove_bfd(peer);
558 else
559 bgp_peer_remove_bfd(peer);
560
561 return CMD_SUCCESS;
562 }
563
564 #if HAVE_BFDD > 0
565 DEFUN(neighbor_bfd_profile, neighbor_bfd_profile_cmd,
566 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd profile BFDPROF",
567 NEIGHBOR_STR
568 NEIGHBOR_ADDR_STR2
569 "BFD integration\n"
570 BFD_PROFILE_STR
571 BFD_PROFILE_NAME_STR)
572 {
573 int idx_peer = 1, idx_prof = 4;
574 struct peer *peer;
575
576 peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
577 if (!peer)
578 return CMD_WARNING_CONFIG_FAILED;
579
580 if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
581 bgp_group_configure_bfd(peer);
582 else
583 bgp_peer_configure_bfd(peer, true);
584
585 strlcpy(peer->bfd_config->profile, argv[idx_prof]->arg,
586 sizeof(peer->bfd_config->profile));
587 bgp_peer_config_apply(peer, peer->group);
588
589 return CMD_SUCCESS;
590 }
591
592 DEFUN(no_neighbor_bfd_profile, no_neighbor_bfd_profile_cmd,
593 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd profile [BFDPROF]",
594 NO_STR
595 NEIGHBOR_STR
596 NEIGHBOR_ADDR_STR2
597 "BFD integration\n"
598 BFD_PROFILE_STR
599 BFD_PROFILE_NAME_STR)
600 {
601 int idx_peer = 2;
602 struct peer *peer;
603
604 peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
605 if (!peer)
606 return CMD_WARNING_CONFIG_FAILED;
607
608 if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
609 bgp_group_configure_bfd(peer);
610 else
611 bgp_peer_configure_bfd(peer, true);
612
613 peer->bfd_config->profile[0] = 0;
614 bgp_peer_config_apply(peer, peer->group);
615
616 return CMD_SUCCESS;
617 }
618 #endif /* HAVE_BFDD */
619
620 void bgp_bfd_init(struct thread_master *tm)
621 {
622 /* Initialize BFD client functions */
623 bfd_protocol_integration_init(zclient, tm);
624
625 /* "neighbor bfd" commands. */
626 install_element(BGP_NODE, &neighbor_bfd_cmd);
627 install_element(BGP_NODE, &neighbor_bfd_param_cmd);
628 install_element(BGP_NODE, &neighbor_bfd_check_controlplane_failure_cmd);
629 install_element(BGP_NODE, &no_neighbor_bfd_cmd);
630
631 #if HAVE_BFDD > 0
632 install_element(BGP_NODE, &neighbor_bfd_profile_cmd);
633 install_element(BGP_NODE, &no_neighbor_bfd_profile_cmd);
634 #endif /* HAVE_BFDD */
635 }