Alexander Afanasyev | fce5bbd | 2013-08-07 18:50:00 -0700 | [diff] [blame] | 1 | ## -*- 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 | |
| 20 | import ns.core |
| 21 | import ns.ndnSIM |
| 22 | from Name import Name |
| 23 | |
| 24 | class 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) |