blob: 331ae63ac1f33c7569a41e509d49a1e669a8c6ff [file] [log] [blame]
Alexander Afanasyevfce5bbd2013-08-07 18:50:00 -07001## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2#
3# Copyright (c) 2011-2013, Regents of the University of California
4# Alexander Afanasyev
5#
6# GNU 3.0 license, See the LICENSE file for more information
7#
8# Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
9#
10
11#
12# Based on PyCCN code, copyrighted and licensed as follows
13#
14# Copyright (c) 2011-2013, Regents of the University of California
15# BSD license, See the COPYING file for more information
16# Written by: Derek Kulinski <takeda@takeda.tk>
17# Jeff Burke <jburke@ucla.edu>
18#
19
20import ns.core
21import ns.ndnSIM
22from Name import Name
23
24class KeyLocator (object):
25 def __init__(self, keyName = None):
26 self.keyName = keyName
27
28 @staticmethod
29 def getDefaultKeyLocator():
30 context = ns.core.Simulator.GetContext ()
31 keyLocator = ns.ndnSIM.ndn.Name ()
32 keyLocator.\
33 append ("default-key").\
34 append (str (context))
35
36 return Name (keyLocator)