@@ -371,6 +371,20 @@ impl<'a> EbpfVmMbuff<'a> {
371
371
Ok ( ( ) )
372
372
}
373
373
374
+ /// Register a set of built-in or user-defined helper functions in order to use them later from
375
+ /// within the eBPF program. It is a convenience function to register multiple helpers at once.
376
+ /// See [EbpfVmMbuff::register_helper] for more information.
377
+ ///
378
+ /// # Warning
379
+ /// This function will replace any previously registered helpers with the new set.
380
+ pub fn register_helper_set (
381
+ & mut self ,
382
+ helpers : HashMap < u32 , ebpf:: Helper > ,
383
+ ) -> Result < ( ) , Error > {
384
+ self . helpers = helpers;
385
+ Ok ( ( ) )
386
+ }
387
+
374
388
/// Register a set of addresses that the eBPF program is allowed to load and store.
375
389
///
376
390
/// When using certain helpers, typically map lookups, the Linux kernel will return pointers
@@ -983,6 +997,19 @@ impl<'a> EbpfVmFixedMbuff<'a> {
983
997
self . parent . register_helper ( key, function)
984
998
}
985
999
1000
+ /// Register a set of built-in or user-defined helper functions in order to use them later from
1001
+ /// within the eBPF program. It is a convenience function to register multiple helpers at once.
1002
+ /// See [EbpfVmFixedMbuff::register_helper] for more information.
1003
+ ///
1004
+ /// # Warning
1005
+ /// This function will replace any previously registered helpers with the new set.
1006
+ pub fn register_helper_set (
1007
+ & mut self ,
1008
+ helpers : HashMap < u32 , ebpf:: Helper > ,
1009
+ ) -> Result < ( ) , Error > {
1010
+ self . parent . register_helper_set ( helpers)
1011
+ }
1012
+
986
1013
/// Register an object that the eBPF program is allowed to load and store.
987
1014
///
988
1015
/// When using certain helpers, typically map lookups, the Linux kernel will return pointers
@@ -1513,6 +1540,19 @@ impl<'a> EbpfVmRaw<'a> {
1513
1540
self . parent . register_helper ( key, function)
1514
1541
}
1515
1542
1543
+ /// Register a set of built-in or user-defined helper functions in order to use them later from
1544
+ /// within the eBPF program. It is a convenience function to register multiple helpers at once.
1545
+ /// See [EbpfVmRaw::register_helper] for more information.
1546
+ ///
1547
+ /// # Warning
1548
+ /// This function will replace any previously registered helpers with the new set.
1549
+ pub fn register_helper_set (
1550
+ & mut self ,
1551
+ helpers : HashMap < u32 , ebpf:: Helper > ,
1552
+ ) -> Result < ( ) , Error > {
1553
+ self . parent . register_helper_set ( helpers)
1554
+ }
1555
+
1516
1556
/// Register an object that the eBPF program is allowed to load and store.
1517
1557
///
1518
1558
/// When using certain helpers, typically map lookups, the Linux kernel will return pointers
@@ -1951,6 +1991,19 @@ impl<'a> EbpfVmNoData<'a> {
1951
1991
self . parent . register_helper ( key, function)
1952
1992
}
1953
1993
1994
+ /// Register a set of built-in or user-defined helper functions in order to use them later from
1995
+ /// within the eBPF program. It is a convenience function to register multiple helpers at once.
1996
+ /// See [EbpfVmNoData::register_helper] for more information.
1997
+ ///
1998
+ /// # Warning
1999
+ /// This function will replace any previously registered helpers with the new set.
2000
+ pub fn register_helper_set (
2001
+ & mut self ,
2002
+ helpers : HashMap < u32 , ebpf:: Helper > ,
2003
+ ) -> Result < ( ) , Error > {
2004
+ self . parent . register_helper_set ( helpers)
2005
+ }
2006
+
1954
2007
/// Register an object that the eBPF program is allowed to load and store.
1955
2008
///
1956
2009
/// When using certain helpers, typically map lookups, the Linux kernel will return pointers
0 commit comments