free5gc总结

# free5gc总结
## 一、编译
准备系统环境,建议内核在 5.0.0-23-generic以上
>OS: Ubuntu 18.04
>gcc 7.3.0
>Go 1.12.9 linux/amd64
>kernel version 5.0.0-23-generic (MUST for UPF)

**本机为Ubuntu 20.04,kernel为 5.4.0**
```bash
renzt@free5gc:~/go/src/go.mongodb.org$ uname -a
Linux free5gc 5.4.0-33-generic #37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
```
按照github提示进行操作,但有些代码问题,需要自行处理。
### 1、提前准备mongodb驱动
在$GOPATH/go.mongo.org/目录下执行 **(注意不要使用官网mongo驱动,不兼容)** :
```bash
mkdir -p $GOPATH/go.mongo.org
git clone https://gitee.com/qiuyuyang/mongo-go-driver.git
```
将目录mongo-go-driver复制为mongo-driver:
```bash
cd $GOPATH/go.mongo.org/
cp mongo-go-driver mongo-driver
```
### 2、准备缺失go库
因下载受限,需要设置代理
```bash
export GOPROXY=https://goproxy.io
```
默认缺少crypto库,需要自行准备:
```bash
renzt@free5gc:~/go/src/golang.org/x$ git clone https://github.com/golang/crypto.git
```
### 3、代码bug
/home/renzt/go/src/free5gc/lib/ngap/ngapSctp/sctp.go
代码bug:失败时也会正常返回,导致panic。
不过全部调试通过后,程序走不到这块逻辑,也不影响测试结果,可忽略。
```golang
    ln, err := sctp.ListenSCTPExt("sctp", addr,
        sctp.InitMsg{NumOstreams: 3, MaxInstreams: 5, MaxAttempts: 4, MaxInitTimeout: 8})
    if err != nil {
        logger.NgapLog.Errorf("failed to listen: %v", err)
    }
    logger.NgapLog.Infof("Listen on %s", ln.Addr())
    return ln
```
**第二个bug,需要改代码**
```bash
../lib/MongoDBLibrary/ap

  • 5
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值