Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add label for img output node links #110

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

kimitoboku
Copy link
Contributor

@kimitoboku kimitoboku commented Sep 12, 2023

I want to add information such as IP address to the output of graphviz.
And, just add mermaid output format that only graph connection.

Example:

nodes:
- name: client
  image: nicolaka/netshoot
  interfaces:
  - { name: net0, type: direct, args: R1#net0, label: "10.0.0.2/24"}
- name: R1
  image: nicolaka/netshoot
  interfaces:
  - { name: net0, type: direct, args: client#net0, label: "10.0.0.1/24"}
  - { name: net1, type: direct, args: root#net0 , label: "10.0.1.1/24"}
  - { name: net2, type: direct, args: resolver#net0 , label: "10.0.2.1/24"}
  - { name: net3, type: direct, args: nomns#net0, label: "10.0.3.1/24"}
- name: root
  image: nicolaka/netshoot
  interfaces:
  - { name: net0, type: direct, args: R1#net1, label: "10.0.1.2/24"}
- name: resolver
  image: nicolaka/netshoot
  interfaces:
  - { name: net0, type: direct, args: R1#net2, label: "10.0.2.2/24"}
- name: nomns
  image: nicolaka/netshoot
  interfaces:
    - { name: net0, type: direct, args: R1#net3, label: "10.0.3.2/24"}
digraph  {

	n2[label="R1"];
	n1[label="client"];
	n5[label="nomns"];
	n4[label="resolver"];
	n3[label="root"];
	n2->n3[arrowhead="none",fontsize="8",headlabel="net0(10.0.1.2/24)",labelfloat="true",taillabel="net1(10.0.1.1/24)"];
	n2->n4[arrowhead="none",fontsize="8",headlabel="net0(10.0.2.2/24)",labelfloat="true",taillabel="net2(10.0.2.1/24)"];
	n2->n5[arrowhead="none",fontsize="8",headlabel="net0(10.0.3.2/24)",labelfloat="true",taillabel="net3(10.0.3.1/24)"];
	n1->n2[arrowhead="none",fontsize="8",headlabel="net0(10.0.0.1/24)",labelfloat="true",taillabel="net0(10.0.0.2/24)"];

}
$ ./tinet img -c example.yaml  -f mermaid
graph TD;
	n2("R1");
	n1("client");
	n5("nomns");
	n4("resolver");
	n3("root");
	n2-->n3;
	n2-->n4;
	n2-->n5;
	n1-->n2;

@slankdev slankdev merged commit 83ec2b1 into tinynetwork:master Oct 17, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants