Shad Ansari | d88692c | 2022-02-01 22:47:43 +0000 | [diff] [blame] | 1 | """ |
Shad Ansari | b046c15 | 2022-06-07 14:34:14 -0700 | [diff] [blame^] | 2 | SPDX-FileCopyrightText: 2022-present Intel Corporation |
Shad Ansari | d88692c | 2022-02-01 22:47:43 +0000 | [diff] [blame] | 3 | SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
Shad Ansari | b046c15 | 2022-06-07 14:34:14 -0700 | [diff] [blame^] | 4 | SPDX-License-Identifier: Apache-2.0 |
Shad Ansari | d88692c | 2022-02-01 22:47:43 +0000 | [diff] [blame] | 5 | """ |
| 6 | |
| 7 | import logging as log |
| 8 | from datetime import datetime |
| 9 | |
| 10 | |
| 11 | class Device(object): |
Shad Ansari | ae3903e | 2022-02-05 01:03:01 +0000 | [diff] [blame] | 12 | def __init__(self, imsi_id, imsi, last_reachable=datetime.min, ip=None): |
Shad Ansari | d88692c | 2022-02-01 22:47:43 +0000 | [diff] [blame] | 13 | # log.debug("creating device, imsi_id={}, imsi={}, ip={}".format(imsi_id, imsi, ip)) |
| 14 | self.imsi_id = imsi_id |
| 15 | self.imsi = imsi |
| 16 | self.ip = ip |
| 17 | self.reachable = False |
Shad Ansari | ae3903e | 2022-02-05 01:03:01 +0000 | [diff] [blame] | 18 | self.last_reachable = last_reachable |
Shad Ansari | 0508ddf | 2022-03-24 03:16:51 +0000 | [diff] [blame] | 19 | |
| 20 | def __str__(self): |
| 21 | return("imsi_id={}, imsi={}, ip={}".format(self.imsi_id, self.imsi, self.ip)) |