+where you extend the classes Model, Resource and Action, and then create an
+implementation of this interface.
+
+
+\section simgrid_dev_guide_surf_callbacks How to use surf callbacks?
+
+Adding features to surf could also be handle by using surf callbacks (instead
+of adding new implementation model). The list of available callbacks is
+accessible there \ref SURF_callbacks. An example of using surf callbacks is the
+energy plugin. If you want to add a plugin you need to define callback function
+and to connect them to callbacks handler in an initialization function.
+
+~~~~
+static void MyNetworkLinkCreatedCallback(NetworkLinkPtr cpu){
+ // your code
+}
+
+static void MyNetworkLinkDestructedCallback(NetworkLinkPtr cpu){
+ // your code
+}
+
+static void MyNetworkCommunicationCallback(NetworkActionPtr cpu,
+ RoutingEdgePtr src,
+ RoutingEdgePtr dst){
+ // your code
+}
+
+void sg_my_network_plugin_init() {
+ surf_callback_connect(networkLinkCreatedCallbacks,
+ MyNetworkLinkCreatedCallback);
+ surf_callback_connect(networkLinkDestructedCallbacks,
+ MyNetworkLinkDestructedCallback);
+ surf_callback_connect(networkCommunicationCallbacks,
+ MyNetworkCommunicationCallback);
+}
+~~~~
+
+Then you need to add an entry in surf_interface.cpp refering to your
+initialization function.
+
+~~~~
+s_surf_model_description_t surf_plugin_description[] = {
+ {"Energy",
+ "Cpu energy consumption.",
+ sg_energy_plugin_init},
+ {"MyNetworkPlugin",
+ "My network plugin.",
+ sg_my_network_plugin_init},
+ {NULL, NULL, NULL} // this array must be NULL terminated
+};
+~~~~