github.com/cilium/cilium@v1.16.2/pkg/monitor/alignchecker/alignchecker.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package alignchecker
     5  
     6  import (
     7  	check "github.com/cilium/cilium/pkg/alignchecker"
     8  	"github.com/cilium/cilium/pkg/monitor"
     9  )
    10  
    11  // See pkg/datapath/alignchecker/alignchecker.go:CheckStructAlignments()
    12  // comment.
    13  func CheckStructAlignments(path string) error {
    14  	// Validate alignments of C and Go equivalent structs
    15  	toCheck := map[string][]any{
    16  		"trace_notify":          {monitor.TraceNotify{}},
    17  		"drop_notify":           {monitor.DropNotify{}},
    18  		"debug_msg":             {monitor.DebugMsg{}},
    19  		"debug_capture_msg":     {monitor.DebugCapture{}},
    20  		"policy_verdict_notify": {monitor.PolicyVerdictNotify{}},
    21  		"trace_sock_notify":     {monitor.TraceSockNotify{}},
    22  	}
    23  	return check.CheckStructAlignments(path, toCheck, true)
    24  }