summaryrefslogtreecommitdiffstats
path: root/test/test_bier.py
AgeCommit message (Expand)AuthorFilesLines
2020-10-21ip: convert u32 entry_flags to vl_api_mfib_entry_flags_t on mroute APINeale Ranns1-24/+40
2019-12-14tests: changes for scapy 2.4.3 migrationsnaramre1-1/+1
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
2019-10-21bier: tests support python3Ole Troan1-1/+1
2019-06-18fib: fib api updatesNeale Ranns1-16/+22
2019-05-16tests: refactor. Replace literal constant w/ named constant.Paul Vinciguerra1-2/+4
2019-03-12FIB: path parsing, table-id not fib-index (VPP-1586)Neale Ranns1-4/+6
2019-03-11VPP-1508: Use scapy.compat to manage packet level library differences.Paul Vinciguerra1-22/+24
2019-03-11Tests: use self.assertNotIn().Paul Vinciguerra1-1/+1
2019-03-01Tests: Remove all wildcard imports.Paul Vinciguerra1-6/+6
2018-12-20Tests: Cleanup @skip decorator.Paul Vinciguerra1-8/+8
2018-09-25BIER; bi-dir to/from underlayNeale Ranns1-0/+31
2018-09-20UDP-Encap: name counters for the stats segmentNeale Ranns1-3/+3
2018-09-14BIER API and load-balancing fixesNeale Ranns1-0/+94
2018-09-11GBP Endpoint UpdatesNeale Ranns1-1/+2
2018-03-20FIB Interpose SourceNeale Ranns1-17/+24
2018-03-09MPLS Unifom modeNeale Ranns1-13/+16
2018-02-16Allow providers to override glean behaviourNeale Ranns1-1/+1
2018-02-15Revert "Allow interface types to override glean adjacency behaivour"Ole Trøan1-1/+1
2018-02-15Allow interface types to override glean adjacency behaivourNeale Ranns1-1/+1
2018-02-06BIER: fix support for longer bit-string lengthsNeale Ranns1-77/+188
2018-01-09BIER: missing endian swap for imposition object in API returnNeale Ranns1-2/+6
2018-01-09test: consolidate the multiple versions of send_and_*Neale Ranns1-15/+0
2017-12-14BIER disposition default routeNeale Ranns1-0/+25
2017-12-09BIER in non-MPLS netowrksNeale Ranns1-10/+193
2017-11-09BIERNeale Ranns1-0/+390
ent, or both. See the example below. When running in VLIB process context, one must pay strict attention to loop invariant issues. If one walks a data structure and calls a function which may suspend, one had best know by construction that it cannot change. Often, it s best to simply make a snapshot copy of a data structure, walk the copy at leisure, then free the copy. Here's an example: <code><pre> \#define EXAMPLE_POLL_PERIOD 10.0 static uword example_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) { f64 poll_time_remaining; uword event_type, *event_data = 0; poll_time_remaining = EXAMPLE_POLL_PERIOD; while (1) { int i; // Sleep until next periodic call due, // or until we receive event(s) // poll_time_remaining = vlib_process_wait_for_event_or_clock (vm, poll_time_remaining); event_type = vlib_process_get_events (vm, &event_data); switch (event_type) { case ~0: // no events => timeout break; case EVENT1: for (i = 0; i < vec_len (event_data); i++) handle_event1 (mm, event_data[i]); break; case EVENT2: for (i = 0; i < vec_len (event_data); i++) handle_event2 (vm, event_data[i]); break; // ... and so forth for each event type default: // This should never happen... clib_warning ("BUG: unhandled event type %d", event_type); break; } vec_reset_length (event_data); // Timer expired, call periodic function if (vlib_process_suspend_time_is_zero (poll_time_remaining)) { example_periodic (vm); poll_time_remaining = EXAMPLE_POLL_PERIOD; } } // NOTREACHED return 0; } static VLIB_REGISTER_NODE (example_node) = { .function = example_process, .type = VLIB_NODE_TYPE_PROCESS, .name = "example-process", }; </pre></code> In this example, the VLIB process node waits for an event to occur, or for 10 seconds to elapse. The code demuxes on the event type, calling the appropriate handler function. Each call to vlib_process_get_events returns a vector of per-event-type data passed to successive vlib_process_signal_event calls; vec_len (event_data) >= 1. It is an error to process only event_data[0]. Resetting the event_data vector-length to 0 by calling vec_reset_length (event_data) - instead of calling vec_free (...) - means that the event scheme doesn t burn cycles continuously allocating and freeing the event data vector. This is a common coding pattern, well worth using when appropriate. */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */