mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-09 07:19:17 +07:00
chore: remove selective loading bpf objects
This commit is contained in:
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* Copyright (c) 2022-2023, v2rayA Organization <team@v2raya.org>
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var output string
|
||||
flag.StringVar(&output, "o", "", "Place the output into <file>.")
|
||||
flag.Parse()
|
||||
|
||||
if output == "" {
|
||||
fmt.Println("Please provide flag \"-o <file>\"")
|
||||
os.Exit(1)
|
||||
}
|
||||
output, err := filepath.Abs(output)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to get absolute path of \"%v\": %v", output, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
// Trick: write a dummy bpfObjectsLan{} and bpfObjectsWan{} before call control package.
|
||||
if err := os.WriteFile(output, []byte(`package control
|
||||
type bpfObjectsLan struct{}
|
||||
type bpfObjectsWan struct{}`), 0644); err != nil {
|
||||
fmt.Printf("Failed to write \"%v\": %v", output, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Printf("Generated dummy %v\n", output)
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* Copyright (c) 2022-2023, v2rayA Organization <team@v2raya.org>
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/v2rayA/dae/control"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var output string
|
||||
flag.StringVar(&output, "o", "", "Place the output into <file>.")
|
||||
flag.Parse()
|
||||
|
||||
if output == "" {
|
||||
fmt.Println("Please provide flag \"-o <file>\"")
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Printf("Generating %v\n", output)
|
||||
control.GenerateObjects(output)
|
||||
fmt.Printf("Generated %v\n", output)
|
||||
}
|
Reference in New Issue
Block a user