Skip to content
Snippets Groups Projects
dslmngr.h 3.25 KiB
Newer Older
  • Learn to ignore specific revisions
  • /*
     * dslmngr header file
     *
     * Copyright (C) 2019 iopsys Software Solutions AB. All rights reserved.
     *
     * Author: anjan.chanda@iopsys.eu
     *         yalu.zhang@iopsys.eu
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     * This program is distributed in the hope that it will be useful, but
     * WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     * General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
     * 02110-1301 USA
     */
    #ifndef _DSLMNGR_H
    #define _DSLMNGR_H
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #include <stdio.h>
    #include <syslog.h>
    #include <libubus.h>
    
    extern int current_log_level;
    
    #define DSLMNGR_LOG(log_level, format...) do { \
    		if (log_level <= current_log_level) \
    
    			fprintf(stderr, ##format);	/* Flawfinder: ignore */ \
    
    #define CHECK_POINT() printf("Check point at %s@%s:%d\n", __func__, __FILE__, __LINE__)
    
    
    int dsl_oem_init();
    
    int dsl_add_ubus_objects(struct ubus_context *ctx);
    
    int dsl_line_status(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    int dsl_channel_status(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    int dsl_status_all(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    
    int dsl_line_stats(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    int dsl_channel_stats(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    int dsl_stats_all(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    
    int fast_line_status(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    int fast_line_stats_handler(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    
    int atm_link_status(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    int atm_link_stats_handler(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    int ptm_link_status(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    
    int dsl_line_configure(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    int atm_link_configure(struct ubus_context *ctx, struct ubus_object *obj,
    		struct ubus_request_data *req, const char *method, struct blob_attr *msg);
    
    #ifdef __cplusplus
    }
    #endif
    #endif /* _DSLMNGR_H */