forked from free5gc/smf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smf.go
49 lines (41 loc) · 923 Bytes
/
smf.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Nsmf_PDUSession
*
* SMF PDU Session Service
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package main
import (
"fmt"
"free5gc/src/app"
"free5gc/src/smf/logger"
"free5gc/src/smf/service"
"free5gc/src/smf/version"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"os"
)
var SMF = &service.SMF{}
var appLog *logrus.Entry
func init() {
appLog = logger.AppLog
}
func main() {
app := cli.NewApp()
app.Name = "smf"
fmt.Print(app.Name, "\n")
appLog.Infoln("SMF version: ", version.GetVersion())
app.Usage = "-free5gccfg common configuration file -smfcfg smf configuration file"
app.Action = action
app.Flags = SMF.GetCliCmd()
if err := app.Run(os.Args); err != nil {
logger.AppLog.Errorf("SMF Run error: %v", err)
}
}
func action(c *cli.Context) {
app.AppInitializeWillInitialize(c.String("free5gccfg"))
SMF.Initialize(c)
SMF.Start()
}