oaisim_mme_sctp_test.c 2.01 KB
Newer Older
1 2 3 4 5
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

Cedric Roux's avatar
Cedric Roux committed
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
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>
#include <arpa/inet.h>

#include "sctp_primitives_client.h"

#include "s1ap_common.h"
#include "s1ap_eNB.h"
#include "s1ap_mme.h"
#include "s1ap_ies_defs.h"

#include "s1ap_eNB_encoder.h"
#include "s1ap_eNB_decoder.h"

int recv_callback(uint32_t  assocId,
                  uint32_t  stream,
                  uint8_t  *buffer,
                  uint32_t  length)
{

49
  free(buffer);
Cedric Roux's avatar
Cedric Roux committed
50

51
  return 0;
Cedric Roux's avatar
Cedric Roux committed
52 53 54 55 56 57 58 59
}

int sctp_connected(void     *args,
                   uint32_t  assocId,
                   uint32_t  instreams,
                   uint32_t  outstreams)
{

60
  return 0;
Cedric Roux's avatar
Cedric Roux committed
61 62 63 64
}

int main(int argc, char *argv[])
{
65
  asn_enc_rval_t retVal;
Cedric Roux's avatar
Cedric Roux committed
66

67
  int i;
Cedric Roux's avatar
Cedric Roux committed
68

69 70 71
  for (i = 0; i < nb_eNB; i++) {
    sctp_connect_to_remote_host(ip_addr, 36412, NULL, sctp_connected, recv_callback);
  }
Cedric Roux's avatar
Cedric Roux committed
72

73 74 75
  while (1) {
    sleep(1);
  }
Cedric Roux's avatar
Cedric Roux committed
76

77 78 79
  sctp_terminate();

  return(0);
gauthier's avatar
gauthier committed
80
}