tr069網(wǎng)管系統(tǒng)的相關(guān)記錄

網(wǎng)管協(xié)議 TR069/TR135

Broadband Forum 發(fā)布,應(yīng)用層管理協(xié)議,CPE廣域網(wǎng)管理協(xié)議(CPE WAN Management Protocol)
TR069定義了一套全新的網(wǎng)管體系結(jié)構(gòu),包括管理模型,交互接口及基本的管理參數(shù),能夠有效地實(shí)施對家庭網(wǎng)絡(luò)設(shè)備的管理.

ACS:自動配置服務(wù)器,負(fù)責(zé)完成對客戶終端設(shè)備CPE的管理。
南向接口:ACS和CPE之間的接口 (TR069主要面向的)
北向接口:ACS與運(yùn)營商的其他網(wǎng)管系統(tǒng)、業(yè)務(wù)管理系統(tǒng)、計(jì)費(fèi)系統(tǒng)(OSS/BSS)之間的接口

使用的標(biāo)準(zhǔn)協(xié)議:
CPE/ACS Management Application
RPC Methods
SOAP
HTTP
SSL/TLS
TCP/IP


SOAP : Simple Object Access Protocol,簡單對象訪問協(xié)議,交換數(shù)據(jù)的一種協(xié)議規(guī)范,基于XML。
設(shè)計(jì)為在Web上交換結(jié)構(gòu)化和固化的信息?;陬悓ο蟮膫鬏攨f(xié)議,用于應(yīng)用程序之間的通信
1,封裝(envelop),定義了一個(gè)框架,描述信息內(nèi)容,發(fā)送者,接受者,如何處理
2,編碼規(guī)則,定義一種序列化機(jī)制,用于表示應(yīng)用程序需要使用的數(shù)據(jù)類型的實(shí)例
3,RPC表示,定義一個(gè)協(xié)定,表示遠(yuǎn)程調(diào)用過程和應(yīng)答
4,綁定,定義SOAP使用哪種協(xié)議交換信息。例如HTTP/TCP/UDP等
必需的 Envelope 元素,可把此 XML 文檔標(biāo)識為一條 SOAP 消息
可選的 Header 元素,包含頭部信息
必需的 Body 元素,包含所有的調(diào)用和響應(yīng)信息
可選的 Fault 元素,提供有關(guān)在處理此消息所發(fā)生錯誤的信息

實(shí)例:

<?xml version="1.0"?>
<soap:Envelope
    xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
    soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
    <soap:Header>
    ...
    ...
    </soap:Header>

    <soap:Body>
        ...
        ...
        <soap:Fault>
        ...
        ...
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

cJSON 庫


XML
XML Schema 描述 XML 文檔的結(jié)構(gòu)。
XML Schema 語言也稱作 XML Schema 定義(XML Schema Definition,XSD)。
XML Schema 的作用是定義 XML 文檔的合法構(gòu)建模塊,類似 DTD。


ping/ICMP
在IP網(wǎng)絡(luò)上,由于數(shù)據(jù)包被丟棄等原因,為了控制將必要的信息傳遞給發(fā)信方。ICMP協(xié)議是為了輔助IP 協(xié)議,
交換各種各樣的控制信息而被制造出來的。用途:差錯通知和信息查詢
ICMP作為IP的上層協(xié)議(報(bào)文格式的角度),同層協(xié)議(功能角度)
所有ICMP用來交流錯誤通知和信息詢問的報(bào)文,都是由類型和代碼的組合來表示的

應(yīng)用:
【路徑MTU探索】向通信對方發(fā)送給IP數(shù)據(jù)包,設(shè)置分片禁止后再發(fā)送,收到ICMP通知返回的不分片即可傳輸?shù)?br> MTU
【改變路由】改變路由是指路由器向送信方計(jì)算機(jī)指示路徑改變這個(gè)功能。計(jì)算機(jī)根據(jù)自己的路由信息(路由表)
來決定傳送目標(biāo)。不知道發(fā)給誰好的時(shí)候,就將數(shù)據(jù)包發(fā)給設(shè)為默認(rèn)網(wǎng)關(guān)的路由器。被指定為默認(rèn)網(wǎng)關(guān)的路由器
接收到數(shù)據(jù)包,發(fā)現(xiàn)將數(shù)據(jù)包發(fā)給局域網(wǎng)內(nèi)的其它路由器會比較快的時(shí)候,將這一信息通過ICMP 通知發(fā)送方。
這時(shí)使用的是,類型是5,代碼是1 的ICMP 改變路由報(bào)文。在選項(xiàng)數(shù)據(jù)部分里寫著應(yīng)該發(fā)送給的路由器IP 地址。
Windows 收到這個(gè)報(bào)文后,重寫自己的路由表,與對方的通信將在一段時(shí)間里經(jīng)由被指定的路由器來實(shí)行。
【源點(diǎn)抑制】數(shù)據(jù)包集中到達(dá)某一路由器后,數(shù)據(jù)包因?yàn)閬聿患氨惶幚?,有可能被丟棄的情況。這時(shí)候,向送信
方發(fā)送的是ICMP 源點(diǎn)抑制報(bào)文,用來使送行方減慢發(fā)送速度。
【ping命令】ping 命令用來在IP 層次上調(diào)查與指定機(jī)器是否連通,調(diào)查數(shù)據(jù)包往復(fù)需要多少時(shí)間。為了實(shí)現(xiàn)這
個(gè)功能,ping 命令使用了兩個(gè)ICMP 報(bào)文。向目標(biāo)服務(wù)器發(fā)送回送請求報(bào)文,回送回答報(bào)文
【traceroute命令】調(diào)查到通信對方的路徑現(xiàn)在是怎么樣了。設(shè)置TTL為1,當(dāng)?shù)竭_(dá)第一個(gè)路由器時(shí)TTL被設(shè)置為0,
按規(guī)定將丟棄此包,錯誤通知報(bào)文用的ICMP報(bào)文是,類型為11,代碼為0的ICMP超時(shí)報(bào)文。依次增加TTL發(fā)送,到達(dá)
目標(biāo)服務(wù)器后,服務(wù)器回送ICMP回答報(bào)文,以此判斷到達(dá)目標(biāo)。
【端口掃描】檢查服務(wù)器不需要的端口是否開著。服務(wù)器管理者用來檢查有沒有安全上有問題的漏洞開著。根據(jù)
ICMP 規(guī)格,UDP 數(shù)據(jù)包到達(dá)不存在的端口時(shí),服務(wù)器需要返回ICMP 的“終點(diǎn)不可達(dá)”之一的“端口不可達(dá)”報(bào)文。
針對某個(gè)端口,發(fā)送UDP數(shù)據(jù)包,服務(wù)器回送ICMP 端口不可達(dá)報(bào)文。

安全:
【數(shù)據(jù)包攻擊】ping洪水攻擊;smurf攻擊,源IP 地址被偽裝成攻擊對象服務(wù)器的地址,目標(biāo)地址也不是攻擊
對象服務(wù)器的地址,而是成為中轉(zhuǎn)臺的網(wǎng)絡(luò)的廣播地址。
【黑洞路由器】關(guān)閉ICMP后,路徑MTU探索功能失效

ping實(shí)現(xiàn):
// 創(chuàng)建ICMP socket
struct protoent *proto = getprotobyname("icmp");
sock = socket(AF_INET, SOCK_RAW, (proto ? proto->p_proto : 1)));
struct sockaddr_in pingaddr= ;
setsockopt(pingsock, IPPROTO_IP, IP_TOS, (char *)&nDscp, sizeof(int)); // 設(shè)置DSCP
setsockopt(pingsock, IPPROTO_IP, IP_TTL, (char *)&nTTL, sizeof(int));
// 發(fā)送ping報(bào)文
struct icmp *pkt;
char packet[datalen + 8];
pkt = (struct icmp *) packet;
pkt->icmp_type = ICMP_ECHO;
pkt->icmp_code = 0;
pkt->icmp_cksum = 0;
pkt->icmp_seq = ntransmitted++;
pkt->icmp_id = myid;
CLR(pkt->icmp_seq % MAX_DUP_CHK);
pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
i = sendto(pingsock, packet, sizeof(packet), 0,(struct sockaddr *) &pingaddr, sizeof(struct sockaddr_in));
// 接收回復(fù),并解析
recvfrom(pingsock, packet, sizeof(packet), MSG_DONTWAIT,(struct sockaddr *) &from, &fromlen))


libevent-2.0.12-stable

Reactor的事件處理機(jī)制,Reactor逆置了事件處理流程,應(yīng)用程序需要提供相應(yīng)的接口并注冊到Reactor上,如果
相應(yīng)的事件發(fā)生,Reactor將主動調(diào)用應(yīng)用程序注冊的接口,這些接口又稱為“回調(diào)函數(shù)”。

Reactor模式是編寫高性能網(wǎng)絡(luò)服務(wù)器的必備技術(shù)之一,它具有如下的優(yōu)點(diǎn):
1)響應(yīng)快,不必為單個(gè)同步時(shí)間所阻塞,雖然Reactor本身依然是同步的;
2)編程相對簡單,可以最大程度的避免復(fù)雜的多線程及同步問題,并且避免了多線程/進(jìn)程的切換開銷;
3)可擴(kuò)展性,可以方便的通過增加Reactor實(shí)例個(gè)數(shù)來充分利用CPU資源;
4)可復(fù)用性,reactor框架本身與具體事件處理邏輯無關(guān),具有很高的復(fù)用性;

【事件源】文件描述符;句柄;
【事件多路分發(fā)器】由操作系統(tǒng)提供的I/O多路復(fù)用機(jī)制,比如select和epoll。將事件注冊到分發(fā)器后,事件到達(dá)
時(shí),分發(fā)器通知程序,程序開始處理事件(同步非阻塞)。
【Reactor】事件管理的接口,內(nèi)部使用“事件多路分發(fā)器”注冊、銷毀事件;運(yùn)行事件循環(huán);當(dāng)事件就緒時(shí),調(diào)用
事件處理函數(shù)。event_base結(jié)構(gòu)
【事件處理程序】event結(jié)構(gòu),定義一組接口,每個(gè)接口對應(yīng)一種類型的事件。

基本應(yīng)用場景:
1,初始化libevent庫,保存返回的指針。(相當(dāng)于初始化一個(gè)Reactor)
struct event_base * base = event_init();
或者event_base_new();
2,初始化事件event,設(shè)置回調(diào)函數(shù)和關(guān)注的事件
void event_set(struct event ev, int fd, short event, void (cb)(int, short, void *), void *arg); // event_assign
ev 需初始化的事件對象
fd 句柄或信號
event 關(guān)注的事件類型,EV_READ,EV_WRITE,EV_SIGNAL等
cb 事件響應(yīng)函數(shù)
arg 與fd event 一起被event_base傳入cb
3,注冊事件event到某個(gè)libevent實(shí)例上
event_base_set(base, &ev);
4,添加事件event
event_add(&ev, timeout);
5,程序進(jìn)入無限循環(huán),等待就緒事件并執(zhí)行事件處理
event_base_dispatch(base);
或event_dispatch()

對于定時(shí)事件,libevent使用一個(gè)小根堆管理,key為超時(shí)時(shí)間;
對于Signal和I/O事件,libevent將其放入到等待鏈表(wait list)中,這是一個(gè)雙向鏈表結(jié)構(gòu);Libevent將所有
的就緒事件,放入到激活鏈表中。對于激活鏈表中的事件調(diào)用事件回調(diào)函數(shù)處理事件。

源代碼組織結(jié)構(gòu):
1,頭文件 event.h
事件宏定義、接口函數(shù)聲明,主要結(jié)構(gòu)體event的聲明
2,內(nèi)部頭文件 xxx-internal.h
內(nèi)部數(shù)據(jù)結(jié)構(gòu)和函數(shù),對外不可見,以達(dá)到信息隱藏的目的
3,libevent框架 event.c
event整體框架的代碼實(shí)現(xiàn)
4,對系統(tǒng)I/O多路復(fù)用機(jī)制的封裝
epoll.c,select.c,devpoll.c,kqueue.c
5,定時(shí)事件管理 min-heap.h
6,信號管理 signal.c
7,輔助功能函數(shù) evutil.h 和 evutil.c
8,日志 log.h和log.c
9,緩沖區(qū)管理 evbuffer.c和buffer.c
10,基本數(shù)據(jù)結(jié)構(gòu) compat/sys/queue.h
是libevent基本數(shù)據(jù)結(jié)構(gòu)的實(shí)現(xiàn),包括鏈表,雙向鏈表,隊(duì)列等
11,實(shí)用網(wǎng)絡(luò)庫 http和evdns
基于libevent實(shí)現(xiàn)的http服務(wù)器和異步dns查詢庫

主要數(shù)據(jù)結(jié)構(gòu) event:

struct event {
    struct event_callback ev_evcallback; // 事件回調(diào)函數(shù)

    /* for managing timeouts */
    union {
        TAILQ_ENTRY(event) ev_next_with_common_timeout; // 定時(shí)事件鏈表指針
        int min_heap_idx; // 在小根堆的索引值
    } ev_timeout_pos;
    evutil_socket_t ev_fd; // 文件描述符或者信號

    struct event_base *ev_base; // 事件所屬的Reactor

    union {
        /* used for io events */
        struct {
            LIST_ENTRY (event) ev_io_next; // I/O事件鏈表指針
            struct timeval ev_timeout;
        } ev_io;

        /* used by signal events */
        struct {
            LIST_ENTRY (event) ev_signal_next; // 信號事件鏈表指針
            short ev_ncalls;    // 事件就緒時(shí)調(diào)用回調(diào)的次數(shù),通常為1
            /* Allows deletes in callback */
            short *ev_pncalls;  // 通常指向ev_ncalls 或者NULL
        } ev_signal;
    } ev_;

    short ev_events;  // EV_READ EV_WRITE EV_SIGNAL EV_TIMEOUT(定時(shí)事件) EV_PERSIST(永久事件)
    short ev_res;       /* result passed to event callback */
    struct timeval ev_timeout;
};

struct event_callback {
    TAILQ_ENTRY(event_callback) evcb_active_next; // 激活事件鏈表指針
    short evcb_flags;   // libevent用來標(biāo)記event信息的字段,表明其當(dāng)前的狀態(tài)。 
                        // EVLIST_TIMEOUT EVLIST_INSERTED EVLIST_SIGNAL EVLIST_ACTIVE 
                        // EVLIST_INTERNAL EVLIST_INIT
    ev_uint8_t evcb_pri;    /* smaller numbers are higher priority */
    ev_uint8_t evcb_closure;
    /* allows us to adopt for different types of events */
    union {
        void (*evcb_callback)(evutil_socket_t, short, void *);
        void (*evcb_selfcb)(struct event_callback *, void *);
        void (*evcb_evfinalize)(struct event *, void *);
        void (*evcb_cbfinalize)(struct event_callback *, void *);
    } evcb_cb_union;
    void *evcb_arg; // 在設(shè)置event時(shí)指定參數(shù)
};

事件設(shè)置接口函數(shù):

void event_set(struct event *ev, int fd, short events,void (*callback)(int, short, void *), void *arg);
int event_base_set(struct event_base *base, struct event *ev);
int event_priority_set(struct event *ev, int pri);// ev處于就緒狀態(tài)時(shí)不能設(shè)置,返回-1

全局event_base指針 current_base,默認(rèn)注冊其上。

struct event_base {
    const struct eventop *evsel; // 指向了全局變量static const struct eventop *eventops[]中的一個(gè)
                                 // libevent將系統(tǒng)提供的I/O demultiplex機(jī)制統(tǒng)一封裝成了eventop結(jié)構(gòu);
                                 // 因此eventops[]包含了select、poll、kequeue和epoll等等其中的若干個(gè)
                                 // 全局實(shí)例對象。event_base_new中根據(jù)配置決定使用哪個(gè)。編譯階段決定
    void *evbase; // evbase實(shí)際上是一個(gè)eventop實(shí)例對象

    /** List of changes to tell backend about at next dispatch.  Only used
     * by the O(1) backends. */
    struct event_changelist changelist;

    const struct eventop *evsigsel; // 指向信號事件使用的后端
    /** Data to implement the common signal handelr code. */
    struct evsig_info sig;

    int virtual_event_count; // 虛擬事件數(shù)
    int event_count; // 事件數(shù)
    int event_count_active; // 就緒事件數(shù)

    int event_gotterm; // 是否一旦處理完事件就終止事件循環(huán)
    int event_break; // 是否立即終止事件循環(huán)

    int running_loop; // 設(shè)置是否正在執(zhí)行event_base_loop, 避免重復(fù)調(diào)用

    // 就緒事件管理,數(shù)組索引為優(yōu)先級,數(shù)字小的優(yōu)先級高
    struct event_list *activequeues;
    int nactivequeues;

    /* common timeout logic */

    /** An array of common_timeout_list* for all of the common timeout
     * values we know. */
    struct common_timeout_list **common_timeout_queues;
    /** The number of entries used in common_timeout_queues */
    int n_common_timeouts;
    /** The total size of common_timeout_queues. */
    int n_common_timeouts_allocated;

    /** List of defered_cb that are active.  We run these after the active
     * events. */
    struct deferred_cb_queue defer_queue;

    /** Mapping from file descriptors to enabled (added) events */
    struct event_io_map io;

    /** Mapping from signal numbers to enabled (added) events. */
    struct event_signal_map sigmap;

    struct event_list eventqueue; // 保存所有添加事件的指針

    /** Stored timeval; used to detect when time is running backwards. */
    struct timeval event_tv;

    struct min_heap timeheap; // 定時(shí)事件小根堆

    /** Stored timeval: used to avoid calling gettimeofday/clock_gettime
     * too often. */
    struct timeval tv_cache;

#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
    /** Difference between internal time (maybe from clock_gettime) and
     * gettimeofday. */
    struct timeval tv_clock_diff;
    /** Second in which we last updated tv_clock_diff, in monotonic time. */
    time_t last_updated_clock_diff;
#endif

#ifndef _EVENT_DISABLE_THREAD_SUPPORT
    /* threading support */
    /** The thread currently running the event_loop for this base */
    unsigned long th_owner_id;
    /** A lock to prevent conflicting accesses to this event_base */
    void *th_base_lock;
    /** The event whose callback is executing right now */
    struct event *current_event;
    /** A condition that gets signalled when we're done processing an
     * event with waiters on it. */
    void *current_event_cond;
    /** Number of threads blocking on current_event_cond. */
    int current_event_waiters;
#endif

#ifdef WIN32
    /** IOCP support structure, if IOCP is enabled. */
    struct event_iocp_port *iocp;
#endif

    /** Flags that this base was configured with */
    enum event_base_config_flag flags;

    /* Notify main thread to wake up break, etc. */
    /** True if the base already has a pending notify, and we don't need
     * to add any more. */
    int is_notify_pending;
    /** A socketpair used by some th_notify functions to wake up the main
     * thread. */
    evutil_socket_t th_notify_fd[2];
    /** An event used by some th_notify functions to wake up the main
     * thread. */
    struct event th_notify;
    /** A function used to wake up the main thread from another thread. */
    int (*th_notify_fn)(struct event_base *base);
};


// 定義給定event_base的后端,統(tǒng)一了各個(gè)I/O多路復(fù)用機(jī)制
struct eventop {
    const char *name; // 后端名字
    /** Function to set up an event_base to use this backend.  It should
     * create a new structure holding whatever information is needed to
     * run the backend, and return it.  The returned pointer will get
     * stored by event_init into the event_base.evbase field.  On failure,
     * this function should return NULL. */
    void *(*init)(struct event_base *);
    /** Enable reading/writing on a given fd or signal.  'events' will be
     * the events that we're trying to enable: one or more of EV_READ,
     * EV_WRITE, EV_SIGNAL, and EV_ET.  'old' will be those events that
     * were enabled on this fd previously.  'fdinfo' will be a structure
     * associated with the fd by the evmap; its size is defined by the
     * fdinfo field below.  It will be set to 0 the first time the fd is
     * added.  The function should return 0 on success and -1 on error.
     */
    int (*add)(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo);
    /** As "add", except 'events' contains the events we mean to disable. */
    int (*del)(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo);
    /** Function to implement the core of an event loop.  It must see which
        added events are ready, and cause event_active to be called for each
        active event (usually via event_io_active or such).  It should
        return 0 on success and -1 on error.
     */
    int (*dispatch)(struct event_base *, struct timeval *);
    /** Function to clean up and free our data from the event_base. */
    void (*dealloc)(struct event_base *);
    /** Flag: set if we need to reinitialize the event base after we fork.
     */
    int need_reinit;
    /** Bit-array of supported event_method_features that this backend can
     * provide. */
    enum event_method_feature features;
    /** Length of the extra information we should record for each fd that
        has one or more active events.  This information is recorded
        as part of the evmap entry for each fd, and passed as an argument
        to the add and del functions above.
     */
    size_t fdinfo_len;
};

// 將事件注冊到ev->ev_base上,注冊成功ev將被插入到已注冊鏈表中
// tv != NULL會同時(shí)注冊定時(shí)事件,添加到,timer堆中
int event_add(struct event *ev, const struct timeval *tv);
// 刪除事件
int event_del(struct event *ev):
// 進(jìn)入事件循環(huán)
int event_loop(int flags); // 默認(rèn)event_base
int event_base_loop(struct event_base *base, int flags);

【I/O和Timer事件的統(tǒng)一】
將Timer事件融合到系統(tǒng)I/O多路復(fù)用機(jī)制中,因?yàn)橄到y(tǒng)的I/O機(jī)制像select()和epoll_wait()都允許程序制定一個(gè)
最大等待時(shí)間(也稱為最大超時(shí)時(shí)間)timeout,即使沒有I/O事件發(fā)生,它們也保證能在timeout時(shí)間內(nèi)返回。
那么根據(jù)所有Timer事件的最小超時(shí)時(shí)間來設(shè)置系統(tǒng)I/O的timeout時(shí)間;當(dāng)系統(tǒng)I/O返回時(shí),再激活所有就緒的
Timer事件就可以了,這樣就能將Timer事件完美的融合到系統(tǒng)的I/O機(jī)制中了。

【I/O和Signal事件的統(tǒng)一】
當(dāng)Signal發(fā)生時(shí),并不立即調(diào)用event的callback函數(shù)處理信號,而是設(shè)法通知系統(tǒng)的I/O機(jī)制,讓其返回,
然后再統(tǒng)一和I/O事件以及Timer一起處理。
創(chuàng)建socketpair,將讀端在event_base上注冊一個(gè)persist事件。信號到來時(shí)寫讀端,通知event_base

【緩沖事件IO】
bufferevent, 提供輸入輸出buffer,無需主動讀寫I/O socket。

bufferevent_new()
bufferevent_enable()/bufferevent_disable(),通過這兩個(gè)接口重復(fù)使用bufferevent結(jié)構(gòu)
bufferevent_read()/bufferevent_write()

【timer事件】

evtimer_set(); // 初始化事件為timer事件
evtimer_add()/evtimer_del()

【超時(shí)事件 timerout】

timeout_set();// 初始化事件為timeout事件
timeout_add()/timeout_del()

【evdns 異步DNS解析】

#include <evdns.h>
evdns_init()
evdns_resolve_ipv4(); //將主機(jī)名轉(zhuǎn)換為IP
evdns_resolve_reverse(); // 反向查詢

【evhttp事件驅(qū)動HTTP服務(wù)器】

#include <evhttp.h>
evhttp_new()
evhttp_bind_socket(); //監(jiān)聽地址+端口
evhttp_set_gencb(); // 注冊通用回調(diào)

【evrpc RPC框架】

在 libevent 中,如果需要處理信號,只能將信號注冊到一個(gè) libevent 實(shí)例上

TR135 相關(guān)概念
【RTP statistics】
基于Loss Event概念。一個(gè)丟包序列,中間可能含有收到的包島(最多包含Gmin-1個(gè)包)。Gmin個(gè)收包終止Loss Event。
Gmin的值可配置。如果Gmin=1,表示不會有包島,任何丟包序列都是一個(gè)Loss Event。
Loss Event 從第一個(gè)丟包,到最后一個(gè)丟包,數(shù)目即為length。
Gmin=2的情況
? R, L, R, R (length = 1)
? R, L, L, R, R (length = 2)
? R, L, R, L, R, R (length = 3)

Service Monitoring statistics 會收集Loss Event的length,以及分布。
相關(guān)參數(shù):
maximum “non severe” length:A
minimum “non severe” distance:B 相鄰Loss Event的距離
Loss Event的長度比A長,或者距離接近B,稱為“severe(嚴(yán)重)”

ACS 在任何時(shí)候都可以改變這些參數(shù),改變立即生效。但是數(shù)據(jù)得在下一次采樣才會有效

Error Correction EC
STB數(shù)據(jù)模型提供一些錯誤校正前和錯誤校正后的統(tǒng)計(jì)數(shù)據(jù)。如果沒使能EC,則數(shù)據(jù)一樣。

Discarded packets:
Late:太晚而不能播放
Out of Sequence:參考RTP序列長度的定義

【Service Monitoring】

【linux 操作文件】
struct __dirstream
{
void *__fd;
char *__data;
int __entry_data;
char *__ptr;
int __entry_ptr;
size_t __allocation;
size_t __size;
__libc_lock_define (, __lock)
};
typedef struct __dirstream DIR;

struct dirent
{
  long d_ino; ///< inode number 索引節(jié)點(diǎn)號
off_t d_off; ///< offset to this dirent 在目錄文件中的偏移
unsigned short d_reclen; ///< length of this d_name 文件名長
unsigned char d_type; ///< the type of d_name 文件類型
char d_name [NAME_MAX+1]; ///< file name (null-terminated) 文件名,最長255字符 int stat(const char *file_name, struct stat *buf);
}

struct stat
{
mode_t st_mode; ///< 文件訪問權(quán)限
ino_t st_ino; ///< 索引節(jié)點(diǎn)號
dev_t st_dev; ///< 文件使用的設(shè)備號
dev_t st_rdev; ///< 設(shè)備文件的設(shè)備號
nlink_t st_nlink; ///< 文件的硬連接數(shù)
uid_t st_uid; ///< 所有者用戶識別號
gid_t st_gid; ///< 組識別號
off_t st_size; ///< 以字節(jié)為單位的文件容量
time_t st_atime; ///< 最后一次訪問該文件的時(shí)間
time_t st_mtime; ///< 最后一次修改該文件的時(shí)間
time_t st_ctime; ///< 最后一次改變該文件狀態(tài)的時(shí)間
blksize_t st_blksize; ///< 包含該文件的磁盤塊的大小
blkcnt_t st_blocks; ///< 該文件所占的磁盤塊
};

DIR *opendir(const char *pathname); ///< 打開文件目錄
struct dirent *readdir(DIR *dp);
void rewinddir(DIR *dp);
int closedir(DIR *dp);
long telldir(DIR *dp);
void seekdir(DIR *dp,long loc);


Android 相關(guān)

執(zhí)行Linux命令
Process proc = Runtime.getRuntime().exec(cmdLine); // 如 "busybox ifconfig"
InputStreamReader is = new InputStreamReader(proc.getInputStream());
BufferedReader br = new BufferedReader (is);

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容