blob: b8902aa1508c07ed60bbcccdb01a8327b5e66df3 [file] [log] [blame]
slowr67d05e42017-08-11 20:37:22 -07001/*
2 * Copyright 2015-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.xran.samplemessages;
18
19import org.onosproject.xran.codecs.api.CRNTI;
20import org.onosproject.xran.codecs.api.ECGI;
21import org.onosproject.xran.codecs.pdu.*;
22import org.openmuc.jasn1.ber.types.string.BerUTF8String;
23
24import java.io.UnsupportedEncodingException;
25
26public class HandoffRequest {
27
28 public static XrancPdu constructPacket(CRNTI crnti, ECGI ecgis, ECGI ecgit) throws UnsupportedEncodingException {
29 HORequest hoRequest = new HORequest();
30
31 hoRequest.setCrnti(crnti);
32 hoRequest.setEcgiS(ecgis);
33 hoRequest.setEcgiT(ecgit);
34
35 BerUTF8String ver = new BerUTF8String("2a");
36
37 XrancApiID apiID = new XrancApiID(14);
38 XrancPduBody body = new XrancPduBody();
39 body.setHORequest(hoRequest);
40
41 XrancPduHdr hdr = new XrancPduHdr();
42 hdr.setVer(ver);
43 hdr.setApiId(apiID);
44
45 XrancPdu pdu = new XrancPdu();
46 pdu.setBody(body);
47 pdu.setHdr(hdr);
48
49 return pdu;
50 }
51}