@@ -744,21 +744,25 @@ int BPF_KPROBE(skb_consume_udp, struct sock *sk, struct sk_buff *skb, int len) {
744
744
}
745
745
746
746
/**
747
- * Hook function for kprobe on icmp_send function.
747
+ * Hook function for kprobe on __icmp_send function.
748
748
*
749
- * Populates the statkey structure with information from the ICMP packet and
749
+ * Populates the statkey structure with information from the ICMPv4 packet and
750
750
* the process ID associated with the packet, and updates the packet and byte
751
751
* counters in the packet count map.
752
752
*
753
- * @param skb pointer to the socket buffer containing the ICMP packet
754
- * @param type type of ICMP packet
753
+ * @param skb pointer to the socket buffer containing the ICMPv4 packet
754
+ * @param type type of ICMPv4 packet
755
+ * @param code code of ICMPv4 packet
756
+ * @param info additional information for the ICMPv4 packet
757
+ * @param opt pointer to the ip_options structure
755
758
*
756
759
* @return 0
757
760
*
758
761
* @throws none
759
762
*/
760
763
SEC ("kprobe/__icmp_send" )
761
- int BPF_KPROBE (__icmp_send , struct sk_buff * skb , int type ) {
764
+ int BPF_KPROBE (__icmp_send , struct sk_buff * skb , __u8 type , __u8 code ,
765
+ __be32 info , const struct ip_options * opt ) {
762
766
statkey key ;
763
767
__builtin_memset (& key , 0 , sizeof (key ));
764
768
@@ -782,13 +786,16 @@ int BPF_KPROBE(__icmp_send, struct sk_buff *skb, int type) {
782
786
*
783
787
* @param skb pointer to the socket buffer containing the ICMPv6 packet
784
788
* @param type type of ICMPv6 packet
789
+ * @param code code of ICMPv6 packet
790
+ * @param info additional information for the ICMPv6 packet
785
791
*
786
792
* @return 0
787
793
*
788
794
* @throws none
789
795
*/
790
796
SEC ("kprobe/icmp6_send" )
791
- int BPF_KPROBE (icmp6_send , struct sk_buff * skb , int type ) {
797
+ int BPF_KPROBE (icmp6_send , struct sk_buff * skb , __u8 type , __u8 code ,
798
+ __u32 info ) {
792
799
statkey key ;
793
800
__builtin_memset (& key , 0 , sizeof (key ));
794
801
@@ -811,14 +818,13 @@ int BPF_KPROBE(icmp6_send, struct sk_buff *skb, int type) {
811
818
* counters in the packet count map.
812
819
*
813
820
* @param skb pointer to the socket buffer containing the ICMP packet
814
- * @param type type of ICMP packet
815
821
*
816
822
* @return 0
817
823
*
818
824
* @throws none
819
825
*/
820
826
SEC ("kprobe/icmp_rcv" )
821
- int BPF_KPROBE (icmp_rcv , struct sk_buff * skb , int type ) {
827
+ int BPF_KPROBE (icmp_rcv , struct sk_buff * skb ) {
822
828
statkey key ;
823
829
__builtin_memset (& key , 0 , sizeof (key ));
824
830
@@ -841,14 +847,13 @@ int BPF_KPROBE(icmp_rcv, struct sk_buff *skb, int type) {
841
847
* counters in the packet count map.
842
848
*
843
849
* @param skb pointer to the socket buffer containing the ICMPv6 packet
844
- * @param type type of ICMPv6 packet
845
850
*
846
851
* @return 0
847
852
*
848
853
* @throws none
849
854
*/
850
855
SEC ("kprobe/icmpv6_rcv" )
851
- int BPF_KPROBE (icmpv6_rcv , struct sk_buff * skb , int type ) {
856
+ int BPF_KPROBE (icmpv6_rcv , struct sk_buff * skb ) {
852
857
statkey key ;
853
858
__builtin_memset (& key , 0 , sizeof (key ));
854
859
0 commit comments