20180813_jeffrey - silenceuncrio/diary GitHub Wiki

0910

review

M300 待作事項有

Tag Job Start End
TNN Reset by scheduling 7/10 8/21
Xentino Status page: Add FW(Firmware), IMEI 8/6 8/21
Xentino Status/Identification page: Add Serial Number 8/6 8/21
Xentino Status/Identification page: Add LAN ETH MAC, WAN ETH MAC 8/6 8/21
Xentino Status page: Display VPN active connection number 8/6 8/21
Xentino Status page: Display LTE/WAN ETH connectioin time 8/6 8/21
是方電訊 GRE tunnel with NHRP 8/6 9/10

0925

Tag Job Start End
Xentino Status page: Add FW(Firmware), IMEI 8/6 8/21

FW(Firmware) 與 IMEI 在原本的 Identification web page 就有了

  <table class="table table-striped table-condensed">
  <thead>
  <tr>
    <th>{{ 'IDENTIFICATION_ATTR' | translate }}</th>
    <th>{{ 'IDENTIFICATION_VALUE' | translate }}</th>
  </tr>
  </thead>
  <tbody>
  <tr><td>{{ 'IDENTIFICATION_HOST_NAME' | translate }}</td><td>{{vm.system_config.szHostName}}</td></tr>
  <tr><td>{{ 'IDENTIFICATION_MAC_ADDRESS' | translate }}</td><td>{{vm.system.szMac}}</td></tr>
  <tr><td>{{ 'IDENTIFICATION_SOFTWARE_VERSION' | translate }}</td><td>{{vm.system.szSwMobileRouterVersion}}</td></tr>
  <tr><td>{{ 'IDENTIFICATION_SOFTWARE_MCSV' | translate }}</td><td>{{vm.system.szSwMCSV}}</td></tr>

  <tr><td>{{ 'IDENTIFICATION_HARDWARE_MCSV' | translate }}</td><td>{{vm.system.szHwMCSV}}</td></tr>

  <tr><td>{{ 'IDENTIFICATION_MODEM_FIRMWARE_VERSION' | translate }}</td><td>{{vm.lte.modem_firmware}}</td></tr>
  <tr><td>IMEI</td><td>{{vm.lte.IMEI}}</td></tr>
  <tr><td>{{ 'IDENTIFICATION_SYSTEM_UPTIME' | translate }}</td><td>{{vm.system.sysUpTime_text}}</td></tr>
  </tbody>
  </table>

相對應的 json object 與其 remote URL

  • vm.system - icos.system.status() - cgi-bin/system.cgi?act=status
  • vm.lte - icos.lte.shm() - cgi-bin/icos_shm.cgi?act=shm&name=lte

一樣併在 status.cgi

diff --git a/proscend/prosrc/webcgi/status.c b/proscend/prosrc/webcgi/status.c
index 66f7c47..53abcf7 100644
--- a/proscend/prosrc/webcgi/status.c
+++ b/proscend/prosrc/webcgi/status.c
@@ -60,6 +60,11 @@ static json_object * _status_obj()
     PROTO6INFO_T *_shm_lte1_proto6 = ICOS_shm_status_getPtr(SHM_LTE1_PROTO6);
     PROTO6INFO_T *_shm_eth_proto6 = ICOS_shm_status_getPtr(SHM_ETH_PROTO6);

+    char *_shm_lte_cur_imei = ICOS_shm_status_getPtr(SHM_LTE_CUR_IMEI);
+
+    sSystemInformation _systemInformation;
+    ICOS_GetStatus(MODULE_SYSTEM, 0, 0, &_systemInformation, sizeof(_systemInformation));
+



@@ -273,6 +278,21 @@ static json_object * _status_obj()



+    // modem_firmware
+    json_object_object_add(obj, "modem_firmware", json_object_new_string(_shm_lte->modem_firmware));
+
+
+
+    // lte_cur_imei
+    json_object_object_add(obj, "lte_cur_imei", json_object_new_string(_shm_lte_cur_imei));
+
+
+
+    // szSwMobileRouterVersion
+    json_object_object_add(obj, "szSwMobileRouterVersion", json_object_new_string(_systemInformation.szSwMobileRouterVersion));
+
+
+
     return obj;
 }

0950

commit 1bdb984240c4bb4ee15c64dee2877d2d26f114f0
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 13 09:49:42 2018 +0800

    add more information to 'status.cgi'

 proscend/prosrc/webcgi/status.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

0955

Tag Job Start End
Xentino Status/Identification page: Add Serial Number 8/6 8/21

serial number 這個資可以從 CGI cgi-bin/system.cgi?act=status 得到

commit 1cbb9c67138dcf707d6e91f0f3c5e62c58b9880c
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 13 09:56:22 2018 +0800

    add 'szSerialNo' to 'status.cgi'

 proscend/prosrc/webcgi/status.c | 5 +++++
 1 file changed, 5 insertions(+)

1000

Tag Job Start End
Xentino Status/Identification page: Add LAN ETH MAC, WAN ETH MAC 8/6 8/21

LAN ETH MACWAN ETH MAC 都可從 cgi-bin/system.cgi?act=status 得到

commit 413d957b6392024c1331cd1123d1c96a2def1d07
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 13 10:01:14 2018 +0800

    add 'szMacLan' and 'szMacWan' to 'status.cgi'

 proscend/prosrc/webcgi/status.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

1005

Tag Job Start End
Xentino Status page: Display VPN active connection number 8/6 8/21

這些資訊我可以從 ICOS_shm_status_getPtr(SHM_VPN) 得到

commit 35f64d9872d5d0ca56aa4e7335357ed7f0e43491
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 13 10:13:27 2018 +0800

    add the vpn related informations to 'status.cgi'

 proscend/prosrc/webcgi/status.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

1015

Tag Job Start End
Xentino Status page: Display LTE/WAN ETH connectioin time 8/6 8/21

這些資訊我可以透過以下 API 得到

WAN_CONNECT_TIME_T *_shm_wan_conn_time = ICOS_shm_status_getPtr(SHM_WAN_CONN_TIME);

注意到 WAN_CONNECT_TIME_T 結構裡的 unsigned long long 型態

typedef struct _wan_conn_t
{
    unsigned long long eth_conntime;  // WAN ETH connection time Seconds
    unsigned long long lte_conntime;  // LTE connection time Seconds
    unsigned long long v6_conntime;   // IPv6 connection time Seconds
} WAN_CONNECT_TIME_T;

這需要搭配 json_object_new_int64 而不是 json_object_new_int

commit 2716855e55fbea05a87fb0b04cb1882bed57f926
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 13 10:26:47 2018 +0800

    add 'wan_conn_time' to 'status.cgi'

 proscend/prosrc/webcgi/status.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

1030

整併一下 status.cgi

  • modem_firmware
  • szMacLan
  • szMacWan
  • szSerialNo
  • szSerialNo
  • lte_cur_imei
  • szSwMobileRouterVersion

併在 system 的 json object 裡

commit 08e12c65b7f49d111c23faa4bc5313df8313ffa7
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 13 10:34:00 2018 +0800

    combine the following informations into 'system' json object in 'status.cgi':
    - modem_firmware
    - lte_cur_imei
    - szSwMobileRouterVersion
    - szSerialNo
    - szMacLan
    - szMacWan

 proscend/prosrc/webcgi/status.c | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)

1100

下午要遠端 support PI 來解決 BGP 的問題

先準備一個 skype 帳號方便聯繫

1300

既然 status.cgi 都把材料準備好了

就來把 xentino 點的 status web page 作一作吧

1405

commit 147f3a3063562c74376f0eaacdc62f637f6ceb66
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 13 14:05:11 2018 +0800

    finish the 'Status' web page for customer xentino

 proscend/prosrc/www/app/locale-en.json             |  20 ++
 proscend/prosrc/www/app/locale-fr.json             |  20 ++
 proscend/prosrc/www/app/locale-zh-tw.json          |  20 ++
 .../www/brand_xentino/app/feature/status.html.src  | 251 ++++++++++++++++++++-
 .../prosrc/www/brand_xentino/app/feature/status.js |  35 +++
 5 files changed, 340 insertions(+), 6 deletions(-)

這樣就完成了

Tag Job Start End
Xentino Status page: Add FW(Firmware), IMEI 8/6 8/21
Xentino Status page: Display VPN active connection number 8/6 8/21
Xentino Status page: Display LTE/WAN ETH connectioin time 8/6 8/21

還剩

Tag Job Start End
TNN Reset by scheduling 7/10 8/21
Xentino Status/Identification page: Add Serial Number 8/6 8/21
Xentino Status/Identification page: Add LAN ETH MAC, WAN ETH MAC 8/6 8/21
是方電訊 GRE tunnel with NHRP 8/6 9/10

1415

commit 3bf9708d8fd87a6cff7b2e0732a6bcbe522778e2
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 13 14:15:03 2018 +0800

    add the following informations at 'Management / Identification' web page:
    - LAN Ethernet MAC Address
    - WAN Ethernet MAC Address
    - Serial Number

 .../prosrc/www/app/feature/identification.html     | 27 ++++++++++++++--------
 proscend/prosrc/www/app/locale-en.json             |  3 +++
 proscend/prosrc/www/app/locale-fr.json             |  3 +++
 proscend/prosrc/www/app/locale-zh-tw.json          |  3 +++
 4 files changed, 27 insertions(+), 9 deletions(-)

完成

Tag Job Start End
Xentino Status/Identification page: Add Serial Number 8/6 8/21
Xentino Status/Identification page: Add LAN ETH MAC, WAN ETH MAC 8/6 8/21

還剩

Tag Job Start End
TNN Reset by scheduling 7/10 8/21
是方電訊 GRE tunnel with NHRP 8/6 9/10

1705

PI 對 BGP 的需求如下

image

M360-P

  • WAN: 10.55.11.66/24
  • AS: 101
  • Loopback: 4.4.4.1/32

Peer

  • WAN: 10.55.11.69
  • AS: 9730
  • Loopback: 3.3.3.1/32

M360-P BGP neighbor 必須是 3.3.3.1/32

1725

google 一下 quagga bgp loopback 看看有什麼相關的

⚠️ **GitHub.com Fallback** ⚠️