helloworldd_ui.c

Go to the documentation of this file.
00001 /*
00002  * $Id: helloworldd_ui.c 346460 2009-11-14 05:06:47Z ssiano $
00003  *
00004  * This code is provided as is by Juniper Networks SDK Developer Support.
00005  * It is provided with no warranties or guarantees, and Juniper Networks
00006  * will not provide support or maintenance of this code in any fashion.
00007  * The code is provided only to help a developer better understand how
00008  * the SDK can be used.
00009  *
00010  * Copyright (c) 2007-2008, Juniper Networks, Inc.
00011  * All rights reserved.
00012  */
00013 
00021 #include <jnx/mgmt_sock_pub.h>
00022 #include <jnx/ms_parse.h>
00023 #include <junoscript/xmlrpc.h>
00024 #include <junoscript/xmllib_pub.h>
00025 #include <ddl/defs.h>
00026 #include "helloworldd_config.h"
00027 
00028 #include HELLOWORLD_OUT_H
00029 #include HELLOWORLD_ODL_H
00030 
00031 /*** Data Structures ***/
00032 
00033 
00034 // See menu structure at the bottom of this file
00035 
00036 /*** STATIC/INTERNAL Functions ***/
00037 
00052 static int32_t
00053 helloworld_show_message (mgmt_sock_t *msp,
00054                         parse_status_t *csb __unused,
00055                         char *unparsed __unused)
00056 {
00057     helloworld_data_t * data;
00058     
00059     XML_OPEN(msp, ODCI_MESSAGES);
00060 
00061     for (data = first_message(); data != NULL; data = next_message(data)) {
00062         XML_ELT(msp, ODCI_MESSAGE, "%s", data->message);
00063     }
00064 
00065     XML_CLOSE(msp, ODCI_MESSAGES);
00066     
00067     return 0;
00068 }
00069 
00070 
00071 /*** GLOBAL/EXTERNAL Functions ***/
00072 
00073 
00074 
00075 /******************************************************************************
00076  *                        Menu Structure
00077  *****************************************************************************/
00078 
00079 /*
00080  * format (from libjuniper's ms_parse.h):
00081  *   command,
00082  *   help desc (or NULL),
00083  *   user data arg block (or 0),
00084  *   child (next) menu (or NULL),
00085  *   handler for command(or 0)
00086  */
00087 
00091 static const parse_menu_t show_sync_helloworld_menu[] = {
00092     { "message", NULL, 0, NULL, helloworld_show_message },
00093     { NULL, NULL, 0, NULL, NULL }
00094 };
00095 
00099 static const parse_menu_t show_sync_menu[] = {
00100     { "helloworld", NULL, 0, show_sync_helloworld_menu, NULL },
00101     { NULL, NULL, 0, NULL, NULL }
00102 };
00103 
00107 static const parse_menu_t show_menu[] = {
00108     { "sync", NULL, 0, show_sync_menu, NULL },
00109     { NULL, NULL, 0, NULL, NULL }
00110 };
00111 
00115 const parse_menu_t master_menu[] = {
00116     { "show", NULL, 0, show_menu, NULL },
00117     { NULL, NULL, 0, NULL, NULL }
00118 };
00119 

2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:59 2010 for SDK Your Net Corporation Helloworld Example 1.0 by Doxygen 1.5.1