Get the App
SLTechnology News&Howtos  ›  Network Security  › 

How to modify the free5Gc source code to recompile a network element

Shulou Source: shulou.com Published: 2022-05-31 23:03:51 10月03日 Update

This article mainly shows you "how to modify the free5Gc source code to recompile a network element", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to modify the free5Gc source code to recompile a network element" this article.

In the process of reading the free5Gc source code and doing some functional verification, we may find that bug exists in the source code implementation of free5Gc.

Take the AMF network element as an example, the sentence "UEContextTransferProcedure lacks a red box" is instantiated, resulting in a null pointer exception triggered when a request is made:

In order to make the functionality available again, we need to modify the source code and recompile it, as follows.

Download the free5Gc source code

Git clone-- recursive-b v3.0.3-j `nproc` https://github.com/free5gc/free5gc.git

Cd free5gc

Git checkout master

Git submodule sync

Git submodule update-init-jobs `nproc`

Git submodule foreach git checkout master

Git submodule foreach git pull-- jobs `nproc`

The source code of each network element will be modified as needed in free5gc/src/ {under the network element name}.

II. Recompile amf

Export CGO_ENABLED=0

Go build-o bin/amf-x src/amf/amf.go

Re-copy the compiled amf to the amf container

Sudo docker cp. / amf amf:/free5gc/amf/amf

4. Restart the amf container

Sudo docker stop amf

Sudo docker start amf

The above is all the contents of the article "how to modify the free5Gc source code to recompile a network element". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Source code compilation content articles functions containers learning help names examples copies pointers easy to understand more organization steps knowledge editing industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info NVidia OPPO Reno Shulou Technology Linux