1 /* $OpenBSD: if_bridge.h,v 1.51 2016/09/03 13:46:57 reyk Exp $ */ 2 3 /* 4 * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) 5 * Copyright (c) 2006 Andrew Thompson (thompsa@FreeBSD.org) 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 26 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * POSSIBILITY OF SUCH DAMAGE. 28 * 29 * Effort sponsored in part by the Defense Advanced Research Projects 30 * Agency (DARPA) and Air Force Research Laboratory, Air Force 31 * Materiel Command, USAF, under agreement number F30602-01-2-0537. 32 * 33 */ 34 35 #ifndef _NET_IF_BRIDGE_H_ 36 #define _NET_IF_BRIDGE_H_ 37 38 #include <sys/timeout.h> 39 #include <net/pfvar.h> 40 41 /* 42 * Bridge control request: add/delete member interfaces. 43 */ 44 struct ifbreq { 45 char ifbr_name[IFNAMSIZ]; /* bridge ifs name */ 46 char ifbr_ifsname[IFNAMSIZ]; /* member ifs name */ 47 u_int32_t ifbr_ifsflags; /* member ifs flags */ 48 u_int32_t ifbr_portno; /* member port number */ 49 50 u_int8_t ifbr_state; /* member stp state */ 51 u_int8_t ifbr_priority; /* member stp priority */ 52 u_int32_t ifbr_path_cost; /* member stp path cost */ 53 u_int32_t ifbr_stpflags; /* member stp flags */ 54 u_int8_t ifbr_proto; /* member stp protocol */ 55 u_int8_t ifbr_role; /* member stp role */ 56 u_int32_t ifbr_fwd_trans; /* member stp fwd transitions */ 57 u_int64_t ifbr_desg_bridge; /* member stp designated bridge */ 58 u_int32_t ifbr_desg_port; /* member stp designated port */ 59 u_int64_t ifbr_root_bridge; /* member stp root bridge */ 60 u_int32_t ifbr_root_cost; /* member stp root cost */ 61 u_int32_t ifbr_root_port; /* member stp root port */ 62 }; 63 64 /* SIOCBRDGIFFLGS, SIOCBRDGIFFLGS */ 65 #define IFBIF_LEARNING 0x0001 /* ifs can learn */ 66 #define IFBIF_DISCOVER 0x0002 /* ifs sends packets w/unknown dest */ 67 #define IFBIF_BLOCKNONIP 0x0004 /* ifs blocks non-IP/ARP in/out */ 68 #define IFBIF_STP 0x0008 /* ifs participates in spanning tree */ 69 #define IFBIF_BSTP_EDGE 0x0010 /* member stp edge port */ 70 #define IFBIF_BSTP_AUTOEDGE 0x0020 /* member stp autoedge enabled */ 71 #define IFBIF_BSTP_PTP 0x0040 /* member stp ptp */ 72 #define IFBIF_BSTP_AUTOPTP 0x0080 /* member stp autoptp enabled */ 73 #define IFBIF_SPAN 0x0100 /* ifs is a span port (ro) */ 74 #define IFBIF_LOCAL 0x1000 /* local port in switch(4) */ 75 #define IFBIF_RO_MASK 0x0f00 /* read only bits */ 76 77 /* SIOCBRDGFLUSH */ 78 #define IFBF_FLUSHDYN 0x0 /* flush dynamic addresses only */ 79 #define IFBF_FLUSHALL 0x1 /* flush all addresses from cache */ 80 81 /* port states */ 82 #define BSTP_IFSTATE_DISABLED 0 83 #define BSTP_IFSTATE_LISTENING 1 84 #define BSTP_IFSTATE_LEARNING 2 85 #define BSTP_IFSTATE_FORWARDING 3 86 #define BSTP_IFSTATE_BLOCKING 4 87 #define BSTP_IFSTATE_DISCARDING 5 88 89 #define BSTP_TCSTATE_ACTIVE 1 90 #define BSTP_TCSTATE_DETECTED 2 91 #define BSTP_TCSTATE_INACTIVE 3 92 #define BSTP_TCSTATE_LEARNING 4 93 #define BSTP_TCSTATE_PROPAG 5 94 #define BSTP_TCSTATE_ACK 6 95 #define BSTP_TCSTATE_TC 7 96 #define BSTP_TCSTATE_TCN 8 97 98 #define BSTP_ROLE_DISABLED 0 99 #define BSTP_ROLE_ROOT 1 100 #define BSTP_ROLE_DESIGNATED 2 101 #define BSTP_ROLE_ALTERNATE 3 102 #define BSTP_ROLE_BACKUP 4 103 104 /* 105 * Interface list structure 106 */ 107 struct ifbifconf { 108 char ifbic_name[IFNAMSIZ]; /* bridge ifs name */ 109 u_int32_t ifbic_len; /* buffer size */ 110 union { 111 caddr_t ifbicu_buf; 112 struct ifbreq *ifbicu_req; 113 } ifbic_ifbicu; 114 #define ifbic_buf ifbic_ifbicu.ifbicu_buf 115 #define ifbic_req ifbic_ifbicu.ifbicu_req 116 }; 117 118 /* 119 * Bridge address request 120 */ 121 struct ifbareq { 122 char ifba_name[IFNAMSIZ]; /* bridge name */ 123 char ifba_ifsname[IFNAMSIZ]; /* destination ifs */ 124 u_int8_t ifba_age; /* address age */ 125 u_int8_t ifba_flags; /* address flags */ 126 struct ether_addr ifba_dst; /* destination addr */ 127 struct sockaddr_storage ifba_dstsa; /* tunnel endpoint */ 128 }; 129 130 #define IFBAF_TYPEMASK 0x03 /* address type mask */ 131 #define IFBAF_DYNAMIC 0x00 /* dynamically learned */ 132 #define IFBAF_STATIC 0x01 /* static address */ 133 134 struct ifbaconf { 135 char ifbac_name[IFNAMSIZ]; /* bridge ifs name */ 136 u_int32_t ifbac_len; /* buffer size */ 137 union { 138 caddr_t ifbacu_buf; /* buffer */ 139 struct ifbareq *ifbacu_req; /* request pointer */ 140 } ifbac_ifbacu; 141 #define ifbac_buf ifbac_ifbacu.ifbacu_buf 142 #define ifbac_req ifbac_ifbacu.ifbacu_req 143 }; 144 145 struct ifbrparam { 146 char ifbrp_name[IFNAMSIZ]; 147 union { 148 u_int32_t ifbrpu_csize; /* cache size */ 149 int ifbrpu_ctime; /* cache time (sec) */ 150 u_int16_t ifbrpu_prio; /* bridge priority */ 151 u_int8_t ifbrpu_hellotime; /* hello time (sec) */ 152 u_int8_t ifbrpu_fwddelay; /* fwd delay (sec) */ 153 u_int8_t ifbrpu_maxage; /* max age (sec) */ 154 u_int8_t ifbrpu_proto; /* bridge protocol */ 155 u_int8_t ifbrpu_txhc; /* bpdu tx holdcount */ 156 u_int64_t ifbrpu_datapath; /* datapath-id */ 157 u_int32_t ifbrpu_maxgroup; /* group size */ 158 } ifbrp_ifbrpu; 159 }; 160 #define ifbrp_csize ifbrp_ifbrpu.ifbrpu_csize 161 #define ifbrp_ctime ifbrp_ifbrpu.ifbrpu_ctime 162 #define ifbrp_prio ifbrp_ifbrpu.ifbrpu_prio 163 #define ifbrp_proto ifbrp_ifbrpu.ifbrpu_proto 164 #define ifbrp_txhc ifbrp_ifbrpu.ifbrpu_txhc 165 #define ifbrp_hellotime ifbrp_ifbrpu.ifbrpu_hellotime 166 #define ifbrp_fwddelay ifbrp_ifbrpu.ifbrpu_fwddelay 167 #define ifbrp_maxage ifbrp_ifbrpu.ifbrpu_maxage 168 #define ifbrp_datapath ifbrp_ifbrpu.ifbrpu_datapath 169 #define ifbrp_maxflow ifbrp_ifbrpu.ifbrpu_csize 170 #define ifbrp_maxgroup ifbrp_ifbrpu.ifbrpu_maxgroup 171 172 /* Protocol versions */ 173 #define BSTP_PROTO_ID 0x00 174 #define BSTP_PROTO_STP 0x00 175 #define BSTP_PROTO_RSTP 0x02 176 #define BSTP_PROTO_MAX BSTP_PROTO_RSTP 177 178 /* 179 * Bridge current operational parameters structure. 180 */ 181 struct ifbropreq { 182 char ifbop_name[IFNAMSIZ]; 183 u_int8_t ifbop_holdcount; 184 u_int8_t ifbop_maxage; 185 u_int8_t ifbop_hellotime; 186 u_int8_t ifbop_fwddelay; 187 u_int8_t ifbop_protocol; 188 u_int16_t ifbop_priority; 189 u_int64_t ifbop_root_bridge; 190 u_int16_t ifbop_root_port; 191 u_int32_t ifbop_root_path_cost; 192 u_int64_t ifbop_desg_bridge; 193 struct timeval ifbop_last_tc_time; 194 }; 195 196 /* 197 * Bridge mac rules 198 */ 199 struct ifbrlreq { 200 char ifbr_name[IFNAMSIZ]; /* bridge ifs name */ 201 char ifbr_ifsname[IFNAMSIZ]; /* member ifs name */ 202 u_int8_t ifbr_action; /* disposition */ 203 u_int8_t ifbr_flags; /* flags */ 204 struct ether_addr ifbr_src; /* source mac */ 205 struct ether_addr ifbr_dst; /* destination mac */ 206 char ifbr_tagname[PF_TAG_NAME_SIZE]; /* pf tagname */ 207 }; 208 #define BRL_ACTION_BLOCK 0x01 /* block frame */ 209 #define BRL_ACTION_PASS 0x02 /* pass frame */ 210 #define BRL_FLAG_IN 0x08 /* input rule */ 211 #define BRL_FLAG_OUT 0x04 /* output rule */ 212 #define BRL_FLAG_SRCVALID 0x02 /* src valid */ 213 #define BRL_FLAG_DSTVALID 0x01 /* dst valid */ 214 215 struct ifbrlconf { 216 char ifbrl_name[IFNAMSIZ]; /* bridge ifs name */ 217 char ifbrl_ifsname[IFNAMSIZ];/* member ifs name */ 218 u_int32_t ifbrl_len; /* buffer size */ 219 union { 220 caddr_t ifbrlu_buf; 221 struct ifbrlreq *ifbrlu_req; 222 } ifbrl_ifbrlu; 223 #define ifbrl_buf ifbrl_ifbrlu.ifbrlu_buf 224 #define ifbrl_req ifbrl_ifbrlu.ifbrlu_req 225 }; 226 227 #ifdef _KERNEL 228 /* STP port flags */ 229 #define BSTP_PORT_CANMIGRATE 0x0001 230 #define BSTP_PORT_NEWINFO 0x0002 231 #define BSTP_PORT_DISPUTED 0x0004 232 #define BSTP_PORT_ADMCOST 0x0008 233 #define BSTP_PORT_AUTOEDGE 0x0010 234 #define BSTP_PORT_AUTOPTP 0x0020 235 236 /* BPDU priority */ 237 #define BSTP_PDU_SUPERIOR 1 238 #define BSTP_PDU_REPEATED 2 239 #define BSTP_PDU_INFERIOR 3 240 #define BSTP_PDU_INFERIORALT 4 241 #define BSTP_PDU_OTHER 5 242 243 /* BPDU flags */ 244 #define BSTP_PDU_PRMASK 0x0c /* Port Role */ 245 #define BSTP_PDU_PRSHIFT 2 /* Port Role offset */ 246 #define BSTP_PDU_F_UNKN 0x00 /* Unknown port (00) */ 247 #define BSTP_PDU_F_ALT 0x01 /* Alt/Backup port (01) */ 248 #define BSTP_PDU_F_ROOT 0x02 /* Root port (10) */ 249 #define BSTP_PDU_F_DESG 0x03 /* Designated port (11) */ 250 251 #define BSTP_PDU_STPMASK 0x81 /* strip unused STP flags */ 252 #define BSTP_PDU_RSTPMASK 0x7f /* strip unused RSTP flags */ 253 #define BSTP_PDU_F_TC 0x01 /* Topology change */ 254 #define BSTP_PDU_F_P 0x02 /* Proposal flag */ 255 #define BSTP_PDU_F_L 0x10 /* Learning flag */ 256 #define BSTP_PDU_F_F 0x20 /* Forwarding flag */ 257 #define BSTP_PDU_F_A 0x40 /* Agreement flag */ 258 #define BSTP_PDU_F_TCA 0x80 /* Topology change ack */ 259 260 /* 261 * Bridge filtering rules 262 */ 263 SIMPLEQ_HEAD(brl_head, brl_node); 264 265 struct brl_node { 266 SIMPLEQ_ENTRY(brl_node) brl_next; /* next rule */ 267 struct ether_addr brl_src; /* source mac address */ 268 struct ether_addr brl_dst; /* destination mac address */ 269 u_int16_t brl_tag; /* pf tag ID */ 270 u_int8_t brl_action; /* what to do with match */ 271 u_int8_t brl_flags; /* comparision flags */ 272 }; 273 274 struct bstp_timer { 275 u_int16_t active; 276 u_int16_t value; 277 u_int32_t latched; 278 }; 279 280 struct bstp_pri_vector { 281 u_int64_t pv_root_id; 282 u_int32_t pv_cost; 283 u_int64_t pv_dbridge_id; 284 u_int16_t pv_dport_id; 285 u_int16_t pv_port_id; 286 }; 287 288 struct bstp_config_unit { 289 struct bstp_pri_vector cu_pv; 290 u_int16_t cu_message_age; 291 u_int16_t cu_max_age; 292 u_int16_t cu_forward_delay; 293 u_int16_t cu_hello_time; 294 u_int8_t cu_message_type; 295 u_int8_t cu_topology_change_ack; 296 u_int8_t cu_topology_change; 297 u_int8_t cu_proposal; 298 u_int8_t cu_agree; 299 u_int8_t cu_learning; 300 u_int8_t cu_forwarding; 301 u_int8_t cu_role; 302 }; 303 304 struct bstp_tcn_unit { 305 u_int8_t tu_message_type; 306 }; 307 308 struct bstp_port { 309 LIST_ENTRY(bstp_port) bp_next; 310 struct ifnet *bp_ifp; /* parent if */ 311 struct bstp_state *bp_bs; 312 void *bp_lhcookie; /* if linkstate hook */ 313 u_int8_t bp_active; 314 u_int8_t bp_protover; 315 u_int32_t bp_flags; 316 u_int32_t bp_path_cost; 317 u_int16_t bp_port_msg_age; 318 u_int16_t bp_port_max_age; 319 u_int16_t bp_port_fdelay; 320 u_int16_t bp_port_htime; 321 u_int16_t bp_desg_msg_age; 322 u_int16_t bp_desg_max_age; 323 u_int16_t bp_desg_fdelay; 324 u_int16_t bp_desg_htime; 325 struct bstp_timer bp_edge_delay_timer; 326 struct bstp_timer bp_forward_delay_timer; 327 struct bstp_timer bp_hello_timer; 328 struct bstp_timer bp_message_age_timer; 329 struct bstp_timer bp_migrate_delay_timer; 330 struct bstp_timer bp_recent_backup_timer; 331 struct bstp_timer bp_recent_root_timer; 332 struct bstp_timer bp_tc_timer; 333 struct bstp_config_unit bp_msg_cu; 334 struct bstp_pri_vector bp_desg_pv; 335 struct bstp_pri_vector bp_port_pv; 336 u_int16_t bp_port_id; 337 u_int8_t bp_state; 338 u_int8_t bp_tcstate; 339 u_int8_t bp_role; 340 u_int8_t bp_infois; 341 u_int8_t bp_tc_ack; 342 u_int8_t bp_tc_prop; 343 u_int8_t bp_fdbflush; 344 u_int8_t bp_priority; 345 u_int8_t bp_ptp_link; 346 u_int8_t bp_agree; 347 u_int8_t bp_agreed; 348 u_int8_t bp_sync; 349 u_int8_t bp_synced; 350 u_int8_t bp_proposing; 351 u_int8_t bp_proposed; 352 u_int8_t bp_operedge; 353 u_int8_t bp_reroot; 354 u_int8_t bp_rcvdtc; 355 u_int8_t bp_rcvdtca; 356 u_int8_t bp_rcvdtcn; 357 u_int32_t bp_forward_transitions; 358 u_int8_t bp_txcount; 359 }; 360 361 /* 362 * Software state for each bridge STP. 363 */ 364 struct bstp_state { 365 struct ifnet *bs_ifp; 366 struct bstp_pri_vector bs_bridge_pv; 367 struct bstp_pri_vector bs_root_pv; 368 struct bstp_port *bs_root_port; 369 u_int8_t bs_protover; 370 u_int16_t bs_migration_delay; 371 u_int16_t bs_edge_delay; 372 u_int16_t bs_bridge_max_age; 373 u_int16_t bs_bridge_fdelay; 374 u_int16_t bs_bridge_htime; 375 u_int16_t bs_root_msg_age; 376 u_int16_t bs_root_max_age; 377 u_int16_t bs_root_fdelay; 378 u_int16_t bs_root_htime; 379 u_int16_t bs_hold_time; 380 u_int16_t bs_bridge_priority; 381 u_int8_t bs_txholdcount; 382 u_int8_t bs_allsynced; 383 struct timeout bs_bstptimeout; /* stp timeout */ 384 struct bstp_timer bs_link_timer; 385 struct timeval bs_last_tc_time; 386 LIST_HEAD(, bstp_port) bs_bplist; 387 }; 388 #define bs_ifflags bs_ifp->if_flags 389 390 /* 391 * Bridge interface list 392 */ 393 struct bridge_iflist { 394 TAILQ_ENTRY(bridge_iflist) next; /* next in list */ 395 struct bridge_softc *bridge_sc; 396 struct bstp_port *bif_stp; /* STP port state */ 397 struct brl_head bif_brlin; /* input rules */ 398 struct brl_head bif_brlout; /* output rules */ 399 struct ifnet *ifp; /* member interface */ 400 u_int32_t bif_flags; /* member flags */ 401 }; 402 #define bif_state bif_stp->bp_state 403 404 #define SAME_BRIDGE(_bp1, _bp2) \ 405 (_bp1 && _bp2 && ((struct bridge_iflist *)_bp1)->bridge_sc == \ 406 ((struct bridge_iflist *)_bp2)->bridge_sc) 407 408 /* 409 * Bridge tunnel tagging 410 */ 411 struct bridge_tunneltag { 412 union pfsockaddr_union brtag_src; 413 union pfsockaddr_union brtag_dst; 414 u_int32_t brtag_id; 415 }; 416 417 /* 418 * Bridge route node 419 */ 420 struct bridge_rtnode { 421 LIST_ENTRY(bridge_rtnode) brt_next; /* next in list */ 422 struct ifnet *brt_if; /* destination ifs */ 423 u_int8_t brt_flags; /* address flags */ 424 u_int8_t brt_age; /* age counter */ 425 struct ether_addr brt_addr; /* dst addr */ 426 struct bridge_tunneltag brt_tunnel; /* tunnel endpoint */ 427 }; 428 429 #ifndef BRIDGE_RTABLE_SIZE 430 #define BRIDGE_RTABLE_SIZE 1024 431 #endif 432 #define BRIDGE_RTABLE_MASK (BRIDGE_RTABLE_SIZE - 1) 433 434 /* 435 * Software state for each bridge 436 */ 437 struct bridge_softc { 438 struct ifnet sc_if; /* the interface */ 439 u_int32_t sc_brtmax; /* max # addresses */ 440 u_int32_t sc_brtcnt; /* current # addrs */ 441 int sc_brttimeout; /* timeout ticks */ 442 u_int64_t sc_hashkey[2]; /* siphash key */ 443 struct timeout sc_brtimeout; /* timeout state */ 444 struct bstp_state *sc_stp; /* stp state */ 445 TAILQ_HEAD(, bridge_iflist) sc_iflist; /* interface list */ 446 TAILQ_HEAD(, bridge_iflist) sc_spanlist; /* span ports */ 447 LIST_HEAD(, bridge_rtnode) sc_rts[BRIDGE_RTABLE_SIZE]; /* hash table */ 448 }; 449 450 extern const u_int8_t bstp_etheraddr[]; 451 struct llc; 452 453 void bridge_ifdetach(struct ifnet *); 454 int bridge_output(struct ifnet *, struct mbuf *, struct sockaddr *, 455 struct rtentry *); 456 void bridge_update(struct ifnet *, struct ether_addr *, int); 457 void bridge_rtdelete(struct bridge_softc *, struct ifnet *, int); 458 void bridge_rtagenode(struct ifnet *, int); 459 struct bridge_tunneltag *bridge_tunnel(struct mbuf *); 460 struct bridge_tunneltag *bridge_tunneltag(struct mbuf *); 461 void bridge_tunneluntag(struct mbuf *); 462 void bridge_copyaddr(struct sockaddr *, struct sockaddr *); 463 void bridge_copytag(struct bridge_tunneltag *, struct bridge_tunneltag *); 464 465 struct bstp_state *bstp_create(struct ifnet *); 466 void bstp_destroy(struct bstp_state *); 467 void bstp_initialization(struct bstp_state *); 468 void bstp_stop(struct bstp_state *); 469 int bstp_ioctl(struct ifnet *, u_long, caddr_t); 470 struct bstp_port *bstp_add(struct bstp_state *, struct ifnet *); 471 void bstp_delete(struct bstp_port *); 472 struct mbuf *bstp_input(struct bstp_state *, struct bstp_port *, 473 struct ether_header *, struct mbuf *); 474 void bstp_ifstate(void *); 475 u_int8_t bstp_getstate(struct bstp_state *, struct bstp_port *); 476 void bstp_ifsflags(struct bstp_port *, u_int); 477 void bridge_send_icmp_err(struct bridge_softc *, struct ifnet *, 478 struct ether_header *, struct mbuf *, int, struct llc *, int, int, int); 479 480 int bridgectl_ioctl(struct ifnet *, u_long, caddr_t); 481 struct ifnet *bridge_rtupdate(struct bridge_softc *, 482 struct ether_addr *, struct ifnet *ifp, int, u_int8_t, struct mbuf *); 483 struct bridge_rtnode *bridge_rtlookup(struct bridge_softc *, 484 struct ether_addr *); 485 void bridge_rtflush(struct bridge_softc *, int); 486 void bridge_timer(void *); 487 488 u_int8_t bridge_filterrule(struct brl_head *, struct ether_header *, 489 struct mbuf *); 490 void bridge_flushrule(struct bridge_iflist *); 491 492 struct mbuf *bridge_ip(struct bridge_softc *, int, struct ifnet *, 493 struct ether_header *, struct mbuf *); 494 void bridge_fragment(struct bridge_softc *, struct ifnet *, 495 struct ether_header *, struct mbuf *); 496 int bridge_ifenqueue(struct bridge_softc *, struct ifnet *, struct mbuf *); 497 498 #endif /* _KERNEL */ 499 #endif /* _NET_IF_BRIDGE_H_ */ 500