From 58b5831009a698b8e9bf99be616efe73c1fe0d9d Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Mon, 9 Oct 2017 19:35:00 +0100 Subject: [PATCH] Starting to create SCTP socket for S1APP --- srsepc/hdr/mme/s1ap.h | 6 +++++- srsepc/src/mme/s1ap.cc | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/srsepc/hdr/mme/s1ap.h b/srsepc/hdr/mme/s1ap.h index de1cf9b43..2e93db2d4 100644 --- a/srsepc/hdr/mme/s1ap.h +++ b/srsepc/hdr/mme/s1ap.h @@ -24,10 +24,14 @@ * */ +namespace srsepc{ + class s1ap { public: s1ap(); virtual ~s1ap(); int enb_listen(); -} +}; + +} //namespace srsepc diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 37e71b834..514060178 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -24,10 +24,48 @@ * */ +#include //TODO Remove + +#include +#include +#include +#include +#include +#include "mme/s1ap.h" + namespace srsepc{ s1ap::s1ap() { } +s1ap::~s1ap() +{ +} + +int +s1ap::enb_listen() +{ + /*This function sets up the SCTP socket for eNBs to connect to*/ + int sock_fd; + struct sockaddr_in s1mme_addr;//TODO make this a configurable class memeber. + + sock_fd = socket (AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); + if (sock_fd == -1){ + std::cout << "[S1APP] Could not create SCTP socket" <